Diligent Engine API Reference
Public Member Functions | List of all members
Diligent::ITexture Class Referenceabstract

Texture inteface. More...

Inheritance diagram for Diligent::ITexture:
Diligent::IDeviceObject Diligent::ITextureD3D11 Diligent::ITextureD3D12 Diligent::ITextureGL Diligent::RefCountedObject< ITextureD3D11 > Diligent::RefCountedObject< ITextureD3D12 > Diligent::RefCountedObject< ITextureGL > Diligent::ObjectBase< ITextureD3D11 > Diligent::ObjectBase< ITextureD3D12 > Diligent::ObjectBase< ITextureGL > Diligent::DeviceObjectBase< ITextureD3D11, TextureDesc > Diligent::DeviceObjectBase< ITextureD3D12, TextureDesc > Diligent::DeviceObjectBase< ITextureGL, TextureDesc > Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator > Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator > Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator > Diligent::TextureBaseD3D11 Diligent::TextureD3D12Impl Diligent::TextureBaseGL Diligent::Texture1D_D3D11 Diligent::Texture2D_D3D11 Diligent::Texture3D_D3D11

Public Member Functions

virtual void QueryInterface (const Diligent::INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface, see IObject::QueryInterface() for details.
 
virtual const TextureDescGetDesc () const =0
 Returns the texture description used to create the object.
 
virtual void CreateView (const struct TextureViewDesc &ViewDesc, class ITextureView **ppView)=0
 Creates a new texture view. More...
 
virtual ITextureViewGetDefaultView (TEXTURE_VIEW_TYPE ViewType)=0
 Returns the pointer to the default view. More...
 
virtual void UpdateData (class IDeviceContext *pContext, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData)=0
 Updates the data in the texture. More...
 
virtual void CopyData (IDeviceContext *pContext, ITexture *pSrcTexture, Uint32 SrcMipLevel, Uint32 SrcSlice, const Box *pSrcBox, Uint32 DstMipLevel, Uint32 DstSlice, Uint32 DstX, Uint32 DstY, Uint32 DstZ)=0
 Copies data from another texture. More...
 
virtual void Map (IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags, MappedTextureSubresource &MappedData)=0
 Map the texture - not implemented yet.
 
virtual void Unmap (IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags)=0
 Unmap the textute - not implemented yet.
 
virtual void * GetNativeHandle ()=0
 Returns native texture handle specific to the underlying graphics API. More...
 
- Public Member Functions inherited from Diligent::IDeviceObject
virtual void QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface, see IObject::QueryInterface() for details.
 

Detailed Description

Texture inteface.

Member Function Documentation

◆ CopyData()

virtual void Diligent::ITexture::CopyData ( IDeviceContext pContext,
ITexture pSrcTexture,
Uint32  SrcMipLevel,
Uint32  SrcSlice,
const Box pSrcBox,
Uint32  DstMipLevel,
Uint32  DstSlice,
Uint32  DstX,
Uint32  DstY,
Uint32  DstZ 
)
pure virtual

Copies data from another texture.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]pSrcTexture- Source texture for the copy operation
[in]SrcMipLevel- Mip level of the source texture to copy data from.
[in]SrcSlice- Array slice of the source texture to copy data from. Should be 0 for non-array textures.
[in]pSrcBox- Source region to copy. Use nullptr to copy the entire subresource.
[in]DstMipLevel- Mip level to copy data to.
[in]DstSlice- Array slice to copy data to. Must be 0 for non-array textures.
[in]DstX- X offset on the destination subresource
[in]DstY- Y offset on the destination subresource
[in]DstZ- Z offset on the destination subresource

Implemented in Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator >, Diligent::TextureBaseGL, Diligent::TextureD3D12Impl, and Diligent::TextureBaseD3D11.

◆ CreateView()

virtual void Diligent::ITexture::CreateView ( const struct TextureViewDesc ViewDesc,
class ITextureView **  ppView 
)
pure virtual

Creates a new texture view.

Parameters
[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.
Remarks
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.

Implemented in Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator >, and Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator >.

◆ GetDefaultView()

virtual ITextureView* Diligent::ITexture::GetDefaultView ( TEXTURE_VIEW_TYPE  ViewType)
pure virtual

Returns the pointer to the default view.

Parameters
[in]ViewType- Type of the requested view. See Diligent::TEXTURE_VIEW_TYPE.
Returns
Pointer to the interface
Note
The function does not increase the reference counter for the returned interface, so Release() must NOT be called.

Implemented in Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator >, and Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator >.

◆ GetNativeHandle()

virtual void* Diligent::ITexture::GetNativeHandle ( )
pure virtual

Returns native texture handle specific to the underlying graphics API.

Returns
pointer to ID3D11Resource interface, for D3D11 implementation
pointer to ID3D12Resource interface, for D3D12 implementation
GL buffer handle, for GL implementation

Implemented in Diligent::TextureBaseGL, Diligent::TextureBaseD3D11, and Diligent::TextureD3D12Impl.

◆ UpdateData()

virtual void Diligent::ITexture::UpdateData ( class IDeviceContext pContext,
Uint32  MipLevel,
Uint32  Slice,
const Box DstBox,
const TextureSubResData SubresData 
)
pure virtual

Updates the data in the texture.

Parameters
[in]pContext- Pointer to the device context interface to be used to perform the operation.
[in]MipLevel- Mip level of the texture subresource to update.
[in]Slice- Array slice. Should be 0 for non-array textures.
[in]DstBox- Destination region on the texture to update.
[in]SubresData- Source data to copy to the texture.

Implemented in Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator >, Diligent::TextureBaseD3D11, and Diligent::TextureD3D12Impl.