![]() |
XII Release 0.1.0
|
Copyright (c) Theophilus Eriata. All Rights Reserved. More...
#include <VertexBufferPool.h>
Classes | |
| struct | AllocationHandle |
| A handle for a vertex allocation. More... | |
| struct | UsageStatistics |
| Aggregated usage statistics for the pool. More... | |
Public Member Functions | |
| xiiGALVertexBufferPool (xiiSharedPtr< xiiGALDevice > pDevice, xiiStringView sName={}, xiiAllocator *pAllocator=AllocatorWrapper::GetAllocator(), xiiUInt32 uiInitialChunkSize=1024, xiiUInt32 uiExpansionFactor=2U) | |
| Copyright (c) Theophilus Eriata. All Rights Reserved. | |
| AllocationHandle | Allocate (xiiUInt32 uiCount) |
| void | Update (const AllocationHandle &handle, xiiArrayPtr< const VertexType > pData, xiiSharedPtr< xiiGALCommandList > pCommandList) |
| xiiArrayPtr< const VertexType > | GetAllocationPointer (const AllocationHandle &handle) const |
| xiiSharedPtr< xiiGALBuffer > | GetGPUBuffer (const AllocationHandle &handle) const |
| void | Reset () |
| xiiGALVertexBufferPool::UsageStatistics | GetUsageStatistics () const |
Copyright (c) Theophilus Eriata. All Rights Reserved.
A templated vertex buffer pool that manages dynamic vertex allocations. This divides its memory into one or more chunks to minimize reallocation and supports thread-safe allocation, update, and tracking of vertex usage.
| XII_ALWAYS_INLINE xiiGALVertexBufferPool< VertexType, MutexType, AllocatorWrapper >::xiiGALVertexBufferPool | ( | xiiSharedPtr< xiiGALDevice > | pDevice, |
| xiiStringView | sName = {}, | ||
| xiiAllocator * | pAllocator = AllocatorWrapper::GetAllocator(), | ||
| xiiUInt32 | uiInitialChunkSize = 1024, | ||
| xiiUInt32 | uiExpansionFactor = 2U ) |
Copyright (c) Theophilus Eriata. All Rights Reserved.
Constructs the vertex buffer pool.
| uiInitialChunkSize | - The number of vertices in the first (and minimum) chunk. |
| uiExpansionFactor | - Determines the size of new chunks (e.g. 2 means double the previous chunk). |
| XII_ALWAYS_INLINE xiiGALVertexBufferPool< VertexType, MutexType, AllocatorWrapper >::AllocationHandle xiiGALVertexBufferPool< VertexType, MutexType, AllocatorWrapper >::Allocate | ( | xiiUInt32 | uiCount | ) |
Allocates a block of vertices from the pool.
| uiCount | - The number of vertices requested. |
| XII_ALWAYS_INLINE xiiArrayPtr< const VertexType > xiiGALVertexBufferPool< VertexType, MutexType, AllocatorWrapper >::GetAllocationPointer | ( | const AllocationHandle & | handle | ) | const |
Returns a read-only pointer to the allocated vertex data.
| XII_ALWAYS_INLINE void xiiGALVertexBufferPool< VertexType, MutexType, AllocatorWrapper >::Update | ( | const AllocationHandle & | handle, |
| xiiArrayPtr< const VertexType > | pData, | ||
| xiiSharedPtr< xiiGALCommandList > | pCommandList ) |
Updates the data stored in a given allocation.
| handle | - The allocation handle previously returned by Allocate(). |
| pData | - An array containing the new vertex data. |