2#include <unordered_map>
3#include "../Base/TexturesCommon.h"
5#include "CommonD3D11.h"
17 TextureFormat format = TextureFormat::Unknown;
19 inline ID3D11Resource* resource() {
return texture2D ? (ID3D11Resource*)texture2D : (ID3D11Resource*)texture3D; }
42 this->context = context_set;
47 using TexturesCommon::loadTexture;
64 return this->textures[textureHandle].resource();
68 return this->textures[textureHandle].texture2D;
71 size_t textureMemoryConsumption = 0;
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
Encapsulates state for texture sampling in a state object.
Describes how to fetch data from a texture in shaders.
void releaseResources() override
Release all allocated texture resources.
SamplerStateHandle loadSamplerState(const SamplerState &state) override
Load a sampler state object.
void releaseTextureView(const TextureViewHandle &handle) override
Release the given texture view.
TextureHandle loadTexture(const TextureDescription &desc, const TextureData *data) override
Load a texture from the given description.
void generateMipmaps(TextureHandle texureHandle) override
Use the graphics device to generate mipmaps for the texture with the given texture handle.
void * getNativeHandle(TextureHandle textureHandle) override
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given...
void releaseSamplerState(SamplerStateHandle handle) override
Release the sampler state with the given handle.
void releaseTexture(TextureHandle textureHandle) override
Release the texture with the given textureHandle.
TextureViewHandle createTextureView(TextureViewDescription &view) override
Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
void annotate(TextureHandle handle, const StringView &name) override
Associate a name with an object for use in graphics debugging.