Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderLightArray::Resources Struct Reference

#include <ShaderLightArray.h>

Public Attributes

std::array< std::unique_ptr< UploadBuffer >, FrameResourceManager::getFrameResourceCount()> vGpuArrayLightDataResources
 
ShaderLightsInFrustumSingleType lightsInFrustum
 
std::array< std::unordered_set< ShaderLightArraySlot * >, FrameResourceManager::getFrameResourceCount()> vSlotsToBeUpdated
 
std::unordered_set< ShaderLightArraySlot * > activeSlots
 

Detailed Description

Groups used resources.

Member Data Documentation

◆ activeSlots

std::unordered_set<ShaderLightArraySlot*> ne::ShaderLightArray::Resources::activeSlots

All currently active (existing) slots.

◆ lightsInFrustum

ShaderLightsInFrustumSingleType ne::ShaderLightArray::Resources::lightsInFrustum

Stores information about light sources in active camera's frustum.

◆ vGpuArrayLightDataResources

std::array<std::unique_ptr<UploadBuffer>, FrameResourceManager::getFrameResourceCount()> ne::ShaderLightArray::Resources::vGpuArrayLightDataResources

GPU resource per frame "in-flight" that stores array of light data.

Remarks
Resources in this array have equal sizes.
Resources in this array are always valid and always have space for at least one slot (even if there are no slots active) to avoid hitting nullptr or have branching when binding resources (when there are no active slots these resources will not be used since counter for light sources will be zero but we will have a valid binding).
Storing a resource per frame "in-flight" because we should not update a resource that is currently being used by the GPU but we also don't want to stop the rendering when we need an update.

◆ vSlotsToBeUpdated

std::array< std::unordered_set<ShaderLightArraySlot*>, FrameResourceManager::getFrameResourceCount()> ne::ShaderLightArray::Resources::vSlotsToBeUpdated

Slots (elements) in arrays from vGpuArrayLightDataResources that needs to be updated.


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