template<typename EngineImplTraits>
Diligent::BufferBase class

Template class implementing base functionality of the buffer object.

Template parameters
EngineImplTraits - Engine implementation type traits.

Base classes

template<class BaseInterface, typename RenderDeviceImplType, typename ObjectDescType>
class DeviceObjectBase<EngineImplTraits::BufferInterface, EngineImplTraits::RenderDeviceImplType, BufferDesc>
Template class implementing base functionality of the device object.

Constructors, destructors, conversion operators

BufferBase(IReferenceCounters* pRefCounters, TBuffViewObjAllocator& BuffViewObjAllocator, RenderDeviceImplType* pDevice, const BufferDesc& BuffDesc, bool bIsDeviceInternal)

Public functions

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.
auto GetDefaultView(BUFFER_VIEW_TYPE ViewType) -> IBufferView* override
Implementation of IBuffer::GetDefaultView().
void CreateDefaultViews()
Creates default buffer views.

Protected functions

void CreateViewInternal(const struct BufferViewDesc& ViewDesc, IBufferView** ppView, bool bIsDefaultView) pure virtual
Pure virtual function that creates buffer view for the specific engine implementation.

Protected variables

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.

Function documentation

template<typename EngineImplTraits>
Diligent::BufferBase<EngineImplTraits>::BufferBase(IReferenceCounters* pRefCounters, TBuffViewObjAllocator& BuffViewObjAllocator, RenderDeviceImplType* pDevice, const BufferDesc& BuffDesc, bool bIsDeviceInternal)

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.

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

Creates default buffer views.

The function calls CreateViewInternal().