8#include <unordered_set>
15#include "render/general/resource/UploadBuffer.h"
16#include "misc/Error.h"
19 class GpuResourceManager;
20 class ShaderCpuWriteResourceBinding;
81 "update cast and type limit check below");
84 if (iNewIndex > UINT_MAX) [[unlikely]] {
85 Error error(std::format(
"received slot index {} exceeds type limit", iNewIndex));
156 std::unordered_set<DynamicCpuWriteShaderResourceArraySlot*>
activeSlots;
231 static std::variant<std::unique_ptr<DynamicCpuWriteShaderResourceArray>,
Error>
create(
286 std::variant<std::unique_ptr<DynamicCpuWriteShaderResourceArraySlot>,
Error>
317 [[nodiscard]] std::optional<Error>
createArray(
size_t iCapacity);
Definition: DynamicCpuWriteShaderResourceArrayManager.h:27
Definition: DynamicCpuWriteShaderResourceArray.h:29
unsigned int getIndexIntoArray() const
Definition: DynamicCpuWriteShaderResourceArray.h:57
DynamicCpuWriteShaderResourceArray *const pArray
Definition: DynamicCpuWriteShaderResourceArray.h:94
unsigned int iIndexInArray
Definition: DynamicCpuWriteShaderResourceArray.h:106
void updateData(void *pData)
Definition: DynamicCpuWriteShaderResourceArray.cpp:43
void updateIndex(size_t iNewIndex)
Definition: DynamicCpuWriteShaderResourceArray.h:77
ShaderCpuWriteResourceBinding *const pShaderResource
Definition: DynamicCpuWriteShaderResourceArray.h:97
Definition: DynamicCpuWriteShaderResourceArray.h:116
void updateSlotData(DynamicCpuWriteShaderResourceArraySlot *pSlot, void *pData)
Definition: DynamicCpuWriteShaderResourceArray.cpp:169
size_t getCapacityStepSize() const
Definition: DynamicCpuWriteShaderResourceArray.cpp:458
size_t getSizeInBytes()
Definition: DynamicCpuWriteShaderResourceArray.cpp:451
std::variant< std::unique_ptr< DynamicCpuWriteShaderResourceArraySlot >, Error > insert(ShaderCpuWriteResourceBinding *pShaderResource)
Definition: DynamicCpuWriteShaderResourceArray.cpp:378
const std::string sHandledShaderResourceName
Definition: DynamicCpuWriteShaderResourceArray.h:352
size_t getElementSize() const
Definition: DynamicCpuWriteShaderResourceArray.cpp:456
std::string_view getHandledShaderResourceName() const
Definition: DynamicCpuWriteShaderResourceArray.cpp:47
std::pair< std::recursive_mutex, InternalResources > * getInternalResources()
Definition: DynamicCpuWriteShaderResourceArray.cpp:52
std::pair< std::recursive_mutex, InternalResources > mtxInternalResources
Definition: DynamicCpuWriteShaderResourceArray.h:338
const size_t iCapacityStepSize
Definition: DynamicCpuWriteShaderResourceArray.h:349
static std::variant< size_t, Error > calculateCapacityStepSize(size_t iElementSizeInBytes)
Definition: DynamicCpuWriteShaderResourceArray.cpp:95
size_t getSize()
Definition: DynamicCpuWriteShaderResourceArray.cpp:441
static std::string formatBytesToKilobytes(size_t iSizeInBytes)
Definition: DynamicCpuWriteShaderResourceArray.cpp:88
static std::variant< std::unique_ptr< DynamicCpuWriteShaderResourceArray >, Error > create(GpuResourceManager *pResourceManager, const std::string &sHandledShaderResourceName, size_t iElementSizeInBytes)
Definition: DynamicCpuWriteShaderResourceArray.cpp:57
std::optional< Error > createArray(size_t iCapacity)
Definition: DynamicCpuWriteShaderResourceArray.cpp:182
std::optional< Error > shrinkArray()
Definition: DynamicCpuWriteShaderResourceArray.cpp:326
GpuResourceManager *const pResourceManager
Definition: DynamicCpuWriteShaderResourceArray.h:341
void markSlotAsNoLongerBeingUsed(DynamicCpuWriteShaderResourceArraySlot *pSlot)
Definition: DynamicCpuWriteShaderResourceArray.cpp:130
std::optional< Error > expandArray()
Definition: DynamicCpuWriteShaderResourceArray.cpp:273
const size_t iElementSizeInBytes
Definition: DynamicCpuWriteShaderResourceArray.h:355
size_t getCapacity()
Definition: DynamicCpuWriteShaderResourceArray.cpp:446
std::string getFullErrorMessage() const
Definition: Error.cpp:84
void showError() const
Definition: Error.cpp:102
Definition: GpuResourceManager.h:43
Definition: ShaderCpuWriteResourceBinding.h:25
Definition: DynamicCpuWriteShaderResourceArray.h:125
size_t iNextFreeArrayIndex
Definition: DynamicCpuWriteShaderResourceArray.h:143
std::queue< size_t > noLongerUsedArrayIndices
Definition: DynamicCpuWriteShaderResourceArray.h:146
std::unique_ptr< UploadBuffer > pUploadBuffer
Definition: DynamicCpuWriteShaderResourceArray.h:129
size_t iCapacity
Definition: DynamicCpuWriteShaderResourceArray.h:135
std::unordered_set< DynamicCpuWriteShaderResourceArraySlot * > activeSlots
Definition: DynamicCpuWriteShaderResourceArray.h:156