Nameless Engine
Loading...
Searching...
No Matches
ne::DynamicCpuWriteShaderResourceArraySlot Class Reference

#include <DynamicCpuWriteShaderResourceArray.h>

Public Member Functions

 DynamicCpuWriteShaderResourceArraySlot (const DynamicCpuWriteShaderResourceArraySlot &)=delete
 
DynamicCpuWriteShaderResourceArraySlotoperator= (const DynamicCpuWriteShaderResourceArraySlot &)=delete
 
void updateDataBecauseGpuUnused (void *pData)
 
unsigned int getIndexIntoArray () const
 

Private Member Functions

 DynamicCpuWriteShaderResourceArraySlot (DynamicCpuWriteShaderResourceArray *pArray, size_t iIndexInArray, ShaderCpuWriteResourceBinding *pShaderResource)
 
void updateIndex (size_t iNewIndex)
 

Private Attributes

DynamicCpuWriteShaderResourceArray *const pArray = nullptr
 
ShaderCpuWriteResourceBinding *const pShaderResource = nullptr
 
unsigned int iIndexInArray = 0
 

Friends

class DynamicCpuWriteShaderResourceArray
 

Detailed Description

Represents a used slot (place) in a shader resource array.

Remarks
Automatically notifies the array to free the slot (mark as unused) in destructor.

Constructor & Destructor Documentation

◆ DynamicCpuWriteShaderResourceArraySlot()

ne::DynamicCpuWriteShaderResourceArraySlot::DynamicCpuWriteShaderResourceArraySlot ( DynamicCpuWriteShaderResourceArray pArray,
size_t  iIndexInArray,
ShaderCpuWriteResourceBinding pShaderResource 
)
private

Initializes the slot.

Parameters
pArrayArray in which the slot resides.
iIndexInArrayInto into the array to access the slot's data.
pShaderResourceShader resource that uses this slot.

Member Function Documentation

◆ getIndexIntoArray()

unsigned int ne::DynamicCpuWriteShaderResourceArraySlot::getIndexIntoArray ( ) const
inline

Returns index into the array (that owns this slot) to access the slot's data.

Returns
Index into the array.

◆ updateDataBecauseGpuUnused()

void ne::DynamicCpuWriteShaderResourceArraySlot::updateDataBecauseGpuUnused ( void *  pData)

Copies the specified data to slot's memory.

Warning
Should only be called when shader resource manager tells that it's the time to update shader resource data.
Can only be used when the GPU is not using (processing) this data.
Parameters
pDataData to copy.

◆ updateIndex()

void ne::DynamicCpuWriteShaderResourceArraySlot::updateIndex ( size_t  iNewIndex)
inlineprivate

Should be called by array to update the index.

Parameters
iNewIndexNew index.

Member Data Documentation

◆ iIndexInArray

unsigned int ne::DynamicCpuWriteShaderResourceArraySlot::iIndexInArray = 0
private

Index into pArray to access the slot's data.

Remarks
Updated by array when it's resizing (use updateIndex).
Using unsigned int because it will be copied to root/push constants which store uints.

◆ pArray

DynamicCpuWriteShaderResourceArray* const ne::DynamicCpuWriteShaderResourceArraySlot::pArray = nullptr
private

Array in which the slot resides.

◆ pShaderResource

ShaderCpuWriteResourceBinding* const ne::DynamicCpuWriteShaderResourceArraySlot::pShaderResource = nullptr
private

Shader resource that uses this slot.


The documentation for this class was generated from the following files: