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::IObject Diligent::ITextureD3D11 Diligent::ITextureD3D12 Diligent::ITextureGL Diligent::RefCountedObject< ITextureD3D11, FixedBlockMemoryAllocator > Diligent::RefCountedObject< ITextureD3D12, FixedBlockMemoryAllocator > Diligent::RefCountedObject< ITextureGL, FixedBlockMemoryAllocator > Diligent::ObjectBase< ITextureD3D11, FixedBlockMemoryAllocator > Diligent::ObjectBase< ITextureD3D12, FixedBlockMemoryAllocator > Diligent::ObjectBase< ITextureGL, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< ITextureD3D11, TextureDesc, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< ITextureD3D12, TextureDesc, FixedBlockMemoryAllocator > Diligent::DeviceObjectBase< ITextureGL, TextureDesc, FixedBlockMemoryAllocator > Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator > Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator > Diligent::TextureBase< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator, 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, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData)=0
 Map the texture - not implemented yet.
 
virtual void Unmap (IDeviceContext *pContext, MAP_TYPE MapType)=0
 Unmap the textute - not implemented yet.
 
- Public Member Functions inherited from Diligent::IObject
virtual Atomics::Long AddRef ()=0
 Increments the number of strong references by 1. More...
 
virtual Atomics::Long Release ()=0
 Decrements the number of strong references by 1 and destroys the object when the counter reaches zero. More...
 
virtual IReferenceCountersGetReferenceCounters () const =0
 Returns the pointer to IReferenceCounters interface of the associated reference counters object. The metod does NOT increment the number of strong references to the returned object.
 

Detailed Description

Texture inteface.

Member Function Documentation

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< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBaseD3D11, Diligent::TextureBaseGL, and Diligent::TextureD3D12Impl.

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< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, and Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >.

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< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, and Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >.

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< ITextureGL, TextureViewGLImpl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D12, TextureViewD3D12Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBase< ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator, FixedBlockMemoryAllocator >, Diligent::TextureBaseD3D11, and Diligent::TextureD3D12Impl.