Diligent Engine API Reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexViewObjAllocator > Class Template Referenceabstract

Base implementation of the ITexture interface. More...

Inheritance diagram for Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexViewObjAllocator >:
Diligent::DeviceObjectBase< BaseInterface, TextureDesc > Diligent::ObjectBase< BaseInterface > Diligent::RefCountedObject< BaseInterface >

Public Member Functions

 TextureBase (IReferenceCounters *pRefCounters, TTexViewObjAllocator &TexViewObjAllocator, IRenderDevice *pDevice, const TextureDesc &Desc, bool bIsDeviceInternal=false)
 
virtual void CreateView (const struct TextureViewDesc &ViewDesc, ITextureView **ppView) override
 Implementaiton of ITexture::CreateView(); calls CreateViewInternal() virtual function that creates texture view for the specific engine implementation.
 
virtual void UpdateData (IDeviceContext *pContext, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData) override=0
 Base implementaiton of ITexture::UpdateData(); validates input parameters.
 
virtual void CopyData (IDeviceContext *pContext, ITexture *pSrcTexture, Uint32 SrcMipLevel, Uint32 SrcSlice, const Box *pSrcBox, Uint32 DstMipLevel, Uint32 DstSlice, Uint32 DstX, Uint32 DstY, Uint32 DstZ) override=0
 Base implementaiton of ITexture::CopyData(); validates input parameters.
 
virtual void Map (IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags, MappedTextureSubresource &MappedData) override=0
 Base implementaiton of ITexture::Map()
 
virtual void Unmap (IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags) override=0
 Base implementaiton of ITexture::Unmap()
 
void CreateDefaultViews ()
 Creates default texture views. More...
 
- Public Member Functions inherited from Diligent::DeviceObjectBase< BaseInterface, TextureDesc >
 DeviceObjectBase (IReferenceCounters *pRefCounters, IRenderDevice *pDevice, const TextureDesc &ObjDesc, bool bIsDeviceInternal=false)
 
UniqueIdentifier GetUniqueID () const
 Returns unique identifier. More...
 

Protected Member Functions

virtual void CreateViewInternal (const struct TextureViewDesc &ViewDesc, ITextureView **ppView, bool bIsDefaultView)=0
 Pure virtual function that creates texture view for the specific engine implementation.
 
ITextureViewGetDefaultView (TEXTURE_VIEW_TYPE ViewType) override
 Implementation of ITexture::GetDefaultView().
 

Protected Attributes

std::unique_ptr< TTextureViewImpl, STDDeleter< TTextureViewImpl, TTexViewObjAllocator > > m_pDefaultSRV
 Default SRV addressing the entire texture.
 
std::unique_ptr< TTextureViewImpl, STDDeleter< TTextureViewImpl, TTexViewObjAllocator > > m_pDefaultRTV
 Default RTV addressing the most detailed mip level.
 
std::unique_ptr< TTextureViewImpl, STDDeleter< TTextureViewImpl, TTexViewObjAllocator > > m_pDefaultDSV
 Default DSV addressing the most detailed mip level.
 
std::unique_ptr< TTextureViewImpl, STDDeleter< TTextureViewImpl, TTexViewObjAllocator > > m_pDefaultUAV
 Default UAV addressing the entire texture.
 
- Protected Attributes inherited from Diligent::DeviceObjectBase< BaseInterface, TextureDesc >
const String m_ObjectNameCopy
 Copy of a device object name. More...
 
TextureDesc m_Desc
 Object description.
 

Detailed Description

template<class BaseInterface, class TTextureViewImpl, class TTexViewObjAllocator>
class Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexViewObjAllocator >

Base implementation of the ITexture interface.

Template Parameters
BaseInterface- base interface that this class will inheret (Diligent::ITextureD3D11, Diligent::ITextureD3D12 or Diligent::ITextureGL).
TTextureViewImpl- type of the texture view implementation (Diligent::TextureViewD3D11Impl, Diligent::TextureViewD3D12Impl or Diligent::TextureViewGLImpl).
TTexViewObjAllocator- type of the allocator that is used to allocate memory for the texture view object instances

Constructor & Destructor Documentation

◆ TextureBase()

template<class BaseInterface, class TTextureViewImpl, class TTexViewObjAllocator>
Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexViewObjAllocator >::TextureBase ( IReferenceCounters *  pRefCounters,
TTexViewObjAllocator &  TexViewObjAllocator,
IRenderDevice pDevice,
const TextureDesc Desc,
bool  bIsDeviceInternal = false 
)
inline
Parameters
pRefCounters- reference counters object that controls the lifetime of this texture.
TexViewObjAllocator- allocator that is used to allocate memory for the instances of the texture view object. This parameter is only used for debug purposes.
pDevice- pointer to the device
Desc- texture description
bIsDeviceInternal- flag indicating if the texture is an internal device object and must not keep a strong reference to the device

Member Function Documentation

◆ CreateDefaultViews()

template<class BaseInterface , class TTextureViewImpl , class TTexViewObjAllocator >
void Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexViewObjAllocator >::CreateDefaultViews ( )

Creates default texture views.

The function calls CreateViewInternal().