Diligent Engine API Reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Diligent::BufferBase< BaseInterface, BufferViewImplType, TBuffObjAllocator, TBuffViewObjAllocator > Class Template Referenceabstract

Template class implementing base functionality for a buffer object. More...

Inheritance diagram for Diligent::BufferBase< BaseInterface, BufferViewImplType, TBuffObjAllocator, TBuffViewObjAllocator >:
Diligent::DeviceObjectBase< BaseInterface, BufferDesc, TBuffObjAllocator > Diligent::ObjectBase< BaseInterface, TBuffObjAllocator > Diligent::RefCountedObject< BaseInterface, TBuffObjAllocator >

Public Member Functions

 BufferBase (TBuffObjAllocator &BuffObjAllocator, TBuffViewObjAllocator &BuffViewObjAllocator, IRenderDevice *pDevice, const BufferDesc &BuffDesc, bool bIsDeviceInternal=false)
 
virtual void UpdateData (IDeviceContext *pContext, Uint32 Offset, Uint32 Size, const PVoid pData) override=0
 Base implementation of IBuffer::UpdateData(); validates input parameters.
 
virtual void CopyData (IDeviceContext *pContext, IBuffer *pSrcBuffer, Uint32 SrcOffset, Uint32 DstOffset, Uint32 Size) override=0
 Base implementation of IBuffer::CopyData(); validates input parameters.
 
virtual void Map (IDeviceContext *pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData) override
 Base implementation of IBuffer::Map(); validates input parameters.
 
virtual void Unmap (IDeviceContext *pContext, MAP_TYPE MapType) override=0
 Base implementation of IBuffer::Unmap()
 
virtual void CreateView (const struct BufferViewDesc &ViewDesc, IBufferView **ppView) override
 Implementation of IBuffer::CreateView(); calls CreateViewInternal() virtual function that creates buffer view for the specific engine implementation.
 
virtual IBufferViewGetDefaultView (BUFFER_VIEW_TYPE ViewType) override
 Implementation of IBuffer::GetDefaultView().
 
void CreateDefaultViews ()
 Creates default buffer views. More...
 
- Public Member Functions inherited from Diligent::DeviceObjectBase< BaseInterface, BufferDesc, TBuffObjAllocator >
 DeviceObjectBase (TBuffObjAllocator &ObjAllocator, class IRenderDevice *pDevice, const BufferDesc &ObjDesc, IObject *pOwner=nullptr, bool bIsDeviceInternal=false)
 
UniqueIdentifier GetUniqueID () const
 Returns unique identifier. More...
 

Protected Member Functions

virtual void CreateViewInternal (const struct BufferViewDesc &ViewDesc, IBufferView **ppView, bool bIsDefaultView)=0
 Pure virtual function that creates buffer view for the specific engine implementation.
 
void CorrectBufferViewDesc (struct BufferViewDesc &ViewDesc)
 Corrects buffer view description and validates view parameters.
 

Protected Attributes

std::unique_ptr< BufferViewImplType, STDDeleter< BufferViewImplType, TBuffViewObjAllocator > > m_pDefaultUAV
 Default UAV addressing the entire buffer.
 
std::unique_ptr< BufferViewImplType, STDDeleter< BufferViewImplType, TBuffViewObjAllocator > > m_pDefaultSRV
 Default SRV addressing the entire buffer.
 
- Protected Attributes inherited from Diligent::DeviceObjectBase< BaseInterface, BufferDesc, TBuffObjAllocator >
const String m_ObjectNameCopy
 Copy of a device object name. More...
 
BufferDesc m_Desc
 Object description.
 

Detailed Description

template<class BaseInterface, class BufferViewImplType, class TBuffObjAllocator, class TBuffViewObjAllocator>
class Diligent::BufferBase< BaseInterface, BufferViewImplType, TBuffObjAllocator, TBuffViewObjAllocator >

Template class implementing base functionality for a buffer object.

Template Parameters
BaseInterface- base interface that this class will inheret (Diligent::IBufferD3D11, Diligent::IBufferD3D12 or Diligent::IBufferGL).
BufferViewImplType- type of the buffer view implementation (Diligent::BufferViewD3D11Impl, Diligent::BufferViewD3D12Impl or Diligent::BufferViewGLImpl)
TBuffObjAllocator- type of the allocator that is used to allocate memory for the buffer object instances
TBuffViewObjAllocator- type of the allocator that is used to allocate memory for the buffer view object instances

Constructor & Destructor Documentation

template<class BaseInterface, class BufferViewImplType, class TBuffObjAllocator, class TBuffViewObjAllocator>
Diligent::BufferBase< BaseInterface, BufferViewImplType, TBuffObjAllocator, TBuffViewObjAllocator >::BufferBase ( TBuffObjAllocator &  BuffObjAllocator,
TBuffViewObjAllocator &  BuffViewObjAllocator,
IRenderDevice pDevice,
const BufferDesc BuffDesc,
bool  bIsDeviceInternal = false 
)
inline
Parameters
BuffObjAllocator- allocator that was used to allocate memory for this instance of the buffer object.
BuffViewObjAllocator- allocator that is used to allocate memory for the buffer view instances. This parameter is only used for debug purposes.
pDevice- pointer to the device.
BuffDesc- buffer description.
bIsDeviceInternal- flag indicating if the buffer is an internal device object and must not keep a strong reference to the device.

Member Function Documentation

template<class BaseInterface , class BufferViewImplType , class TBuffObjAllocator , class TBuffViewObjAllocator >
void Diligent::BufferBase< BaseInterface, BufferViewImplType, TBuffObjAllocator, TBuffViewObjAllocator >::CreateDefaultViews ( )

Creates default buffer views.

The function calls CreateViewInternal().