Texture interface. More...
#include <Texture.h>
Public Member Functions | |
virtual const TextureDesc &DILIGENT_CALL_TYPE | GetDesc () const override=0 |
Returns the texture description used to create the object. | |
virtual void DILIGENT_CALL_TYPE | CreateView (const TextureViewDesc &ViewDesc, ITextureView **ppView)=0 |
Creates a new texture view. | |
virtual ITextureView *DILIGENT_CALL_TYPE | GetDefaultView (TEXTURE_VIEW_TYPE ViewType)=0 |
Returns the pointer to the default view. | |
virtual Uint64 DILIGENT_CALL_TYPE | GetNativeHandle ()=0 |
Returns native texture handle specific to the underlying graphics API. | |
virtual void DILIGENT_CALL_TYPE | SetState (RESOURCE_STATE State)=0 |
Sets the usage state for all texture subresources. | |
virtual RESOURCE_STATE DILIGENT_CALL_TYPE | GetState () const =0 |
Returns the internal texture state. | |
virtual const SparseTextureProperties &DILIGENT_CALL_TYPE | GetSparseProperties () const =0 |
Returns the sparse texture properties, see Diligent::SparseTextureProperties. | |
![]() | |
virtual Int32 DILIGENT_CALL_TYPE | GetUniqueID () const =0 |
Returns unique identifier assigned to an object. | |
virtual void DILIGENT_CALL_TYPE | SetUserData (IObject *pUserData)=0 |
Stores a pointer to the user-provided data object. | |
virtual IObject *DILIGENT_CALL_TYPE | GetUserData () const =0 |
Returns a pointer to the user data object previously set with SetUserData() method. | |
![]() | |
virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
Queries the specific interface. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
Increments the number of strong references by 1. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
Texture interface.
|
pure virtual |
Creates a new texture view.
[in] | ViewDesc | - View description. See Diligent::TextureViewDesc for details. |
[out] | ppView | - Address of the memory location where the pointer to the view interface will be written to. |
To create a shader resource view addressing the entire texture, set only TextureViewDesc::ViewType member of the ViewDesc parameter to Diligent::TEXTURE_VIEW_SHADER_RESOURCE and leave all other members in their default values. Using the same method, you can create render target or depth stencil view addressing the largest mip level.
If texture view format is Diligent::TEX_FORMAT_UNKNOWN, the view format will match the texture format.
If texture view type is Diligent::TEXTURE_VIEW_UNDEFINED, the type will match the texture type. If the number of mip levels is 0, and the view type is shader resource, the view will address all mip levels.
For other view types it will address one mip level.
If the number of slices is 0, all slices from FirstArraySlice or FirstDepthSlice will be referenced by the view. For non-array textures, the only allowed values for the number of slices are 0 and 1.
Texture view will contain strong reference to the texture, so the texture will not be destroyed until all views are released.
The function calls AddRef() for the created interface, so it must be released by a call to Release() when it is no longer needed.
|
pure virtual |
Returns the pointer to the default view.
[in] | ViewType | - Type of the requested view. See Diligent::TEXTURE_VIEW_TYPE. |
|
pure virtual |
Returns native texture handle specific to the underlying graphics API.
ID3D11Resource
interface, for D3D11 implementationID3D12Resource
interface, for D3D12 implementationVkImage
handle, for Vulkan implementationMtlTexture
, for Metal implementationWGPUTexture
for WebGPU implementation
|
pure virtual |
Sets the usage state for all texture subresources.
This method does not perform state transition, but resets the internal texture state to the given value. This method should be used after the application finished manually managing the texture state and wants to hand over state management back to the engine.