4#include "TextureData.h"
5#include "SamplerState.h"
56 virtual TextureHandle loadTexture(
const unsigned char * bytes,
unsigned int width,
unsigned int height, TextureFormat format,
unsigned int flags = 0) = 0;
69 virtual TextureHandle loadTexture(
const unsigned char * bytes,
unsigned int width,
unsigned int height, TextureFormat format,
unsigned int numSamples,
unsigned int flags) = 0;
82 virtual TextureHandle loadTextureMipMaps(
const unsigned char ** bytes,
size_t numLevels,
const unsigned int * widths,
const unsigned int * heights, TextureFormat format,
unsigned int flags = 0) = 0;
97 virtual TextureHandle loadTextureArray(
const unsigned char ** bytes,
const size_t arraySize,
const size_t numLevels,
const unsigned int * widths,
const unsigned int * heights, TextureFormat format,
unsigned int flags = 0) = 0;
112 virtual TextureHandle loadCubeMap(
const unsigned char ** bytes,
const size_t arraySize,
const size_t numLevels,
const unsigned int * widths,
const unsigned int * heights, TextureFormat format,
unsigned int flags = 0) = 0;
130 uint32_t layer_offset = 0,
131 uint32_t face_offset = 0,
132 uint32_t level_offset = 0) { (void)textureHandle; (void)data; (void)layer_offset; (void)face_offset; (void)level_offset; }
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
constexpr size_t hash() noexcept
Simple getter function that returns the initial value for fnv1a hashing.
handle_type handle
Internal resource handle.
Provides texture management functionality.
virtual SamplerStateHandle loadSamplerState(const SamplerState &state)=0
Load a sampler state object.
virtual void uploadTextureData(TextureHandle textureHandle, const TextureData &data, uint32_t layer_offset=0, uint32_t face_offset=0, uint32_t level_offset=0)
Upload a texture from the given description.
virtual void releaseResources()=0
Release all allocated texture resources.
virtual void releaseNativeTexture(TextureNativeHandle nativeHandle)
Release a native texture handle.
virtual TextureViewHandle createTextureView(TextureViewDescription &viewDescription)=0
Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
virtual void * getNativeHandle(TextureHandle textureHandle)=0
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given...
virtual void generateMipmaps(TextureHandle textureHandle)=0
Use the graphics device to generate mipmaps for the texture with the given texture handle.
virtual void annotate(TextureHandle handle, const StringView &name)
Associate a name with an object for use in graphics debugging.
virtual TextureHandle loadTexture(const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int numSamples, unsigned int flags)=0
Load a texture using the given data to populate the texture contents.
virtual void releaseTexture(TextureHandle textureHandle)=0
Release the texture with the given textureHandle.
virtual TextureHandle loadTextureMipMaps(const unsigned char **bytes, size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
Load a texture with multiple mipmap levels using the given data to populate the texture contents.
virtual void releaseSamplerState(SamplerStateHandle handle)=0
Release the sampler state with the given handle.
virtual TextureHandle loadTexture(const TextureDescription &desc, const TextureData *data)=0
Load a texture from the given description.
virtual TextureHandle loadTexture(const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int flags=0)=0
Load a texture using the given data to populate the texture contents.
virtual TextureHandle loadTextureArray(const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
Load an array texture with mipmaps using the given data to populate the texture contents.
virtual void releaseTextureView(const TextureViewHandle &handle)=0
Release the given texture view.
virtual TextureHandle loadCubeMap(const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0
Load a cube map texture with mipmaps using the given data to populate the texture contents.
Encapsulates state for texture sampling in a state object.
Describes how to fetch data from a texture in shaders.
uint32_t layerIndex
Index of the first layer (if array) to fetch from.
uint32_t numLayers
Number of array layers available.
uint32_t numLevels
Number of mipmap levels available.
uint32_t levelIndex
First mipmap level to fetch data from.
TextureHandle texture
Texture.