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

Base implementation of the ITexture interface. More...

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

Public Member Functions

 TextureBase (TTexObjAllocator &TexObjAllocator, 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)=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)=0
 Base implementaiton of ITexture::CopyData(); validates input parameters.
 
virtual void Map (IDeviceContext *pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData)=0
 Base implementaiton of ITexture::Map()
 
virtual void Unmap (IDeviceContext *pContext, MAP_TYPE MapType)=0
 Base implementaiton of ITexture::Unmap()
 
void CreateDefaultViews ()
 Creates default texture views. More...
 
- Public Member Functions inherited from Diligent::DeviceObjectBase< BaseInterface, TextureDesc, TTexObjAllocator >
 DeviceObjectBase (TTexObjAllocator &ObjAllocator, class IRenderDevice *pDevice, const TextureDesc &ObjDesc, IObject *pOwner=nullptr, 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, TTexObjAllocator >
const String m_ObjectNameCopy
 Copy of a device object name. More...
 
TextureDesc m_Desc
 Object description.
 

Detailed Description

template<class BaseInterface, class TTextureViewImpl, class TTexObjAllocator, class TTexViewObjAllocator>
class Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexObjAllocator, 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).
TTexObjAllocator- type of the allocator that is used to allocate memory for the texture object instances
TTexViewObjAllocator- type of the allocator that is used to allocate memory for the texture view object instances

Constructor & Destructor Documentation

template<class BaseInterface, class TTextureViewImpl, class TTexObjAllocator, class TTexViewObjAllocator>
Diligent::TextureBase< BaseInterface, TTextureViewImpl, TTexObjAllocator, TTexViewObjAllocator >::TextureBase ( TTexObjAllocator &  TexObjAllocator,
TTexViewObjAllocator &  TexViewObjAllocator,
IRenderDevice pDevice,
const TextureDesc Desc,
bool  bIsDeviceInternal = false 
)
inline
Parameters
TexObjAllocator- allocator that was used to allocate memory for this instance of the texture object
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

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

Creates default texture views.

The function calls CreateViewInternal().