Nameless Engine
|
#include <ShaderLightArray.h>
Public Member Functions | |
ShaderLightArraySlot (const ShaderLightArraySlot &)=delete | |
ShaderLightArraySlot & | operator= (const ShaderLightArraySlot &)=delete |
void | markAsNeedsUpdate () |
size_t | getCurrentIndexIntoArray () const |
Private Member Functions | |
ShaderLightArraySlot (ShaderLightArray *pArray, Node *pSpawnedOwnerLightNode, size_t iIndexIntoArray, const std::function< void *()> &startUpdateCallback, const std::function< void()> &finishUpdateCallback) | |
Private Attributes | |
ShaderLightArray * | pArray = nullptr |
Node *const | pSpawnedOwnerLightNode = nullptr |
const std::function< void *()> | startUpdateCallback |
const std::function< void()> | finishUpdateCallback |
size_t | iIndexIntoArray = 0 |
Friends | |
class | ShaderLightArray |
RAII-like object that frees the slot (marks it as unused) in its destructor and stores all information needed to update the slot's data.
|
private |
Creates a new slot.
pArray | Array that allocated space for this slot. |
pSpawnedOwnerLightNode | Spawned light node that requested the slot. |
iIndexIntoArray | Index into array. |
startUpdateCallback | Callback that will be called by array to start copying new data to the GPU. |
finishUpdateCallback | Callback that will be called by array to finish copying new data to the GPU. |
|
inline |
Returns the current index (because it may change later) into the array.
void ne::ShaderLightArraySlot::markAsNeedsUpdate | ( | ) |
Marks resources as "needs update", the resource will not be updated immediately but only when it will be safe to modify the underlying GPU resource of the array that this slot is referencing.
|
private |
Callback that will be called by array to finish copying new data to the GPU.
|
private |
Index into pArray.
|
private |
Array that allocated space for this slot.
|
private |
Spawned light node (point/spot/directional/etc) that requested this slot.
|
private |
Callback that will be called by array to start copying new data to the GPU.