Nameless Engine
|
#include <DynamicCpuWriteShaderResourceArray.h>
Public Attributes | |
std::unique_ptr< UploadBuffer > | pUploadBuffer = nullptr |
size_t | iCapacity = 0 |
size_t | iNextFreeArrayIndex = 0 |
std::queue< size_t > | noLongerUsedArrayIndices |
std::unordered_set< DynamicCpuWriteShaderResourceArraySlot * > | activeSlots |
Groups mutex-guarded internal resources.
std::unordered_set<DynamicCpuWriteShaderResourceArraySlot*> ne::DynamicCpuWriteShaderResourceArray::InternalResources::activeSlots |
Set of slots that were inserted (size of this set is the actual number of elements in the array (smaller or equal to iCapacity)).
Storing a raw pointer here is safe because it's only used to update slot's index if the array was resized. Before the slot is destroyed it will be automatically removed from this set (see slot's destructor).
size_t ne::DynamicCpuWriteShaderResourceArray::InternalResources::iCapacity = 0 |
The maximum number of elements that could be added to the array without expanding (recreating with a bigger size) the GPU buffer.
size_t ne::DynamicCpuWriteShaderResourceArray::InternalResources::iNextFreeArrayIndex = 0 |
Index of the next free place in the array. Each new element inserted in the array will fetch this value (to be used) and increment it. Once this value is equal to iCapacity we will use noLongerUsedArrayIndices to see if any old indices are no longer being used.
std::queue<size_t> ne::DynamicCpuWriteShaderResourceArray::InternalResources::noLongerUsedArrayIndices |
Indices in the array that were previously used but now unused.
std::unique_ptr<UploadBuffer> ne::DynamicCpuWriteShaderResourceArray::InternalResources::pUploadBuffer = nullptr |
CPU visible GPU buffer that stores all elements.