Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::IBufferSuballocator Struct Referenceabstract

Buffer suballocator. More...

#include <BufferSuballocator.h>

Inheritance diagram for Diligent::IBufferSuballocator:
Diligent.IObject

Public Member Functions

virtual IBufferUpdate (IRenderDevice *pDevice, IDeviceContext *pContext)=0
 Updates the internal buffer object.
 
virtual IBufferGetBuffer () const =0
 Returns a pointer to the internal buffer object.
 
virtual void Allocate (Uint32 Size, Uint32 Alignment, IBufferSuballocation **ppSuballocation)=0
 Performs suballocation from the buffer.
 
virtual void GetUsageStats (BufferSuballocatorUsageStats &UsageStats)=0
 Returns the suballocator usage stats, see Diligent::BufferSuballocatorUsageStats.
 
virtual Uint32 GetVersion () const =0
 Returns the internal buffer version.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Buffer suballocator.

Member Function Documentation

◆ Allocate()

virtual void Diligent::IBufferSuballocator::Allocate ( Uint32 Size,
Uint32 Alignment,
IBufferSuballocation ** ppSuballocation )
pure virtual

Performs suballocation from the buffer.

Parameters
[in]Size- Suballocation size, in bytes.
[in]Alignment- Required alignment.
[out]ppSuballocation- Memory location where a pointer to the new suballocation will be stored.
Remarks
The method is thread-safe and can be called from multiple threads simultaneously.

◆ GetBuffer()

virtual IBuffer * Diligent::IBufferSuballocator::GetBuffer ( ) const
pure virtual

Returns a pointer to the internal buffer object.

If the buffer has not been created yet, the method returns null.

If the buffer may need to be updated, use the Update() method instead.

◆ GetVersion()

virtual Uint32 Diligent::IBufferSuballocator::GetVersion ( ) const
pure virtual

Returns the internal buffer version.

The version is incremented every time the buffer is expanded.

◆ Update()

virtual IBuffer * Diligent::IBufferSuballocator::Update ( IRenderDevice * pDevice,
IDeviceContext * pContext )
pure virtual

Updates the internal buffer object.

Parameters
[in]pDevice- A pointer to the render device that will be used to create a new internal buffer, if necessary.
[in]pContext- A pointer to the device context that will be used to copy existing contents to the new buffer, if necessary.

If the internal buffer needs to be resized, pDevice and pContext will be used to create a new buffer and copy existing contents to the new buffer. The method is not thread-safe and an application must externally synchronize the access.