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

Vertex pool interface. More...

#include <VertexPool.h>

Inheritance diagram for Diligent::IVertexPool:
Diligent.IObject

Public Member Functions

virtual IBufferUpdate (Uint32 Index, IRenderDevice *pDevice, IDeviceContext *pContext)=0
 Updates the internal buffer object at the given index.
 
virtual void UpdateAll (IRenderDevice *pDevice, IDeviceContext *pContext)=0
 
virtual IBufferGetBuffer (Uint32 Index) const =0
 
virtual void Allocate (Uint32 NumVertices, IVertexPoolAllocation **ppAllocation)=0
 Allocates vertices from the pool.
 
virtual void GetUsageStats (VertexPoolUsageStats &UsageStats)=0
 Returns the usage stats, see Diligent::VertexPoolUsageStats.
 
virtual Uint32 GetVersion () const =0
 
virtual const VertexPoolDescGetDesc () const =0
 Returns the pool description.
 
- 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

Vertex pool interface.

The vertex pool is a collection of dynamic buffers that can be used to store vertex data.

Member Function Documentation

◆ Allocate()

virtual void Diligent::IVertexPool::Allocate ( Uint32 NumVertices,
IVertexPoolAllocation ** ppAllocation )
pure virtual

Allocates vertices from the pool.

Parameters
[in]NumVertices- The number of vertices to allocate.
[out]ppAllocation- Memory location where pointer to the new allocation will be stored.
Remarks
The method is thread-safe and can be called from multiple threads simultaneously.

◆ GetBuffer()

virtual IBuffer * Diligent::IVertexPool::GetBuffer ( Uint32 Index) const
pure virtual

Returns a pointer to the internal buffer at the given index.

If the internal buffer has not been initialized yet, the method will return null. If the buffer may need to be updated (resized or initialized), use the Update() method.

◆ GetVersion()

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

Returns the internal buffer version. The version is incremented every time any internal buffer is recreated.

◆ Update()

virtual IBuffer * Diligent::IVertexPool::Update ( Uint32 Index,
IRenderDevice * pDevice,
IDeviceContext * pContext )
pure virtual

Updates the internal buffer object at the given index.

Parameters
[in]Index- The vertex buffer index. Must be in range [0, Desc.NumElements-1].
[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.
Returns
A pointer to the internal buffer object.

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.

◆ UpdateAll()

virtual void Diligent::IVertexPool::UpdateAll ( IRenderDevice * pDevice,
IDeviceContext * pContext )
pure virtual

Updates all internal buffers.

Remarks
This method is equivalent to calling Update() for each internal buffer.