class
render::Texture
Render thread counterpart of a Texture.
Public
Constructors
Texture
Methods
~Texture
Initialize
Called on the render thread when the object is first created.
SetName
Assigns an name to the image, primarily used for easier debugging.
GetName
Returns the name of the image.
Primarily used for debugging purposes.
GetSupportedFormat
Returns the pixel format this texture is using.
This may be different from the requested format in case the device doesn't support it.
Map
Maps a texture subresource for CPU access.
- mipLevel
- Mipmap level to map.
- arrayLayer
- Texture array layer (or cubemap face, or depth slice) to map.
- options
- Specifies read/write intent for the mapping.
Returns: RAII scope containing PixelData with mapped memory.
Flush
Flushes CPU writes to the specified subresource to make them visible to the GPU.
Only relevant for directly mappable textures with non-coherent memory.
- mipLevel
- Mipmap level to flush.
- arrayLayer
- Array layer (or cubemap face, or depth slice) to flush.
Invalidate
Invalidates GPU writes to the specified subresource to make them visible to the CPU.
Only relevant for directly mappable textures with non-coherent memory.
- mipLevel
- Mipmap level to invalidate.
- arrayLayer
- Array layer (or cubemap face, or depth slice) to invalidate.
RecreateInternalTexture
Recreates the underlying texture.
Note this will clear all currently written data. Old texture will be released once its done being used.
GetMappedMemory
Returns a pointer to persistently mapped memory, or nullptr if not mappable.
GetUseMask
Returns which GPU queues are currently using the specified subresource.
- mipLevel
- Mipmap level.
- arrayLayer
- Texture array layer (or cubemap face, or depth slice).
- accessFlags
- Filter by read/write access type.
GetBoundCount
Returns how many command buffers the specified subresource is bound to.
GetUseCount
Returns how many submitted command buffers are using the specified subresource.
GetProperties
Returns properties that contain information about the texture.
RequestView
Requests a texture view for the specified mip and array ranges.
Returns an existing view of one for the specified ranges already exists, otherwise creates a new one. You must release all views by calling ReleaseView() when done.
- surface
- Texture surface to create a view for.
- usage
- Usage of the texture view.
Protected
Methods
CreateView
Creates a view of a specific subresource in a texture.
ClearBufferViews
Releases all internal texture view references.