Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::BufferBase< EngineImplTraits > Class Template Referenceabstract

Template class implementing base functionality of the buffer object. More...

#include <BufferBase.hpp>

Inheritance diagram for Diligent::BufferBase< EngineImplTraits >:
Diligent::DeviceObjectBase< EngineImplTraits::BufferInterface, EngineImplTraits::RenderDeviceImplType, BufferDesc > Diligent::ObjectBase< EngineImplTraits::BufferInterface > Diligent::RefCountedObject< EngineImplTraits::BufferInterface >

Public Member Functions

 BufferBase (IReferenceCounters *pRefCounters, TBuffViewObjAllocator &BuffViewObjAllocator, RenderDeviceImplType *pDevice, const BufferDesc &BuffDesc, bool bIsDeviceInternal)
 
virtual void DILIGENT_CALL_TYPE CreateView (const struct BufferViewDesc &ViewDesc, IBufferView **ppView) override
 
virtual IBufferView *DILIGENT_CALL_TYPE GetDefaultView (BUFFER_VIEW_TYPE ViewType) override
 Implementation of IBuffer::GetDefaultView().
 
void CreateDefaultViews ()
 Creates default buffer views.
 
- Public Member Functions inherited from Diligent::DeviceObjectBase< EngineImplTraits::BufferInterface, EngineImplTraits::RenderDeviceImplType, BufferDesc >
 DeviceObjectBase (IReferenceCounters *pRefCounters, RenderDeviceImplType *pDevice, const BufferDesc &ObjDesc, bool bIsDeviceInternal=false)
 
virtual Int32 DILIGENT_CALL_TYPE GetUniqueID () const override final
 Returns unique identifier.
 
virtual void DILIGENT_CALL_TYPE SetUserData (IObject *pUserData) override final
 Implementation of IDeviceObject::SetUserData.
 
virtual IObject *DILIGENT_CALL_TYPE GetUserData () const override final
 Implementation of IDeviceObject::GetUserData.
 

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.
 

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< EngineImplTraits::BufferInterface, EngineImplTraits::RenderDeviceImplType, BufferDesc >
RenderDeviceImplType *const m_pDevice
 Pointer to the device.
 
BufferDesc m_Desc
 Object description.
 

Detailed Description

template<typename EngineImplTraits>
class Diligent::BufferBase< EngineImplTraits >

Template class implementing base functionality of the buffer object.

Template Parameters
EngineImplTraits- Engine implementation type traits.

Constructor & Destructor Documentation

◆ BufferBase()

template<typename EngineImplTraits>
Diligent::BufferBase< EngineImplTraits >::BufferBase ( IReferenceCounters * pRefCounters,
TBuffViewObjAllocator & BuffViewObjAllocator,
RenderDeviceImplType * pDevice,
const BufferDesc & BuffDesc,
bool bIsDeviceInternal )
inline
Parameters
pRefCounters- Reference counters object that controls the lifetime of this buffer.
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

◆ CreateDefaultViews()

template<typename EngineImplTraits>
void Diligent::BufferBase< EngineImplTraits >::CreateDefaultViews ( )
inline

Creates default buffer views.

The function calls CreateViewInternal().

◆ CreateView()

template<typename EngineImplTraits>
virtual void DILIGENT_CALL_TYPE Diligent::BufferBase< EngineImplTraits >::CreateView ( const struct BufferViewDesc & ViewDesc,
IBufferView ** ppView )
inlineoverridevirtual

Implementation of IBuffer::CreateView(); calls CreateViewInternal() virtual function that creates buffer view for the specific engine implementation.