Nameless Engine
Loading...
Searching...
No Matches
ne::DynamicCpuWriteShaderResourceArray::InternalResources Struct Reference

#include <DynamicCpuWriteShaderResourceArray.h>

Public Attributes

std::unique_ptr< UploadBufferpUploadBuffer = nullptr
 
size_t iCapacity = 0
 
size_t iNextFreeArrayIndex = 0
 
std::queue< size_t > noLongerUsedArrayIndices
 
std::unordered_set< DynamicCpuWriteShaderResourceArraySlot * > activeSlots
 

Detailed Description

Groups mutex-guarded internal resources.

Member Data Documentation

◆ activeSlots

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).

◆ iCapacity

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.

◆ iNextFreeArrayIndex

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.

◆ noLongerUsedArrayIndices

std::queue<size_t> ne::DynamicCpuWriteShaderResourceArray::InternalResources::noLongerUsedArrayIndices

Indices in the array that were previously used but now unused.

◆ pUploadBuffer

std::unique_ptr<UploadBuffer> ne::DynamicCpuWriteShaderResourceArray::InternalResources::pUploadBuffer = nullptr

CPU visible GPU buffer that stores all elements.


The documentation for this struct was generated from the following file: