Files
UnrealEngineUWP/Engine/Shaders/Shared/LightGridDefinitions.h
tiago costa d54697c74a [Light Grid] Refactored handling of limits in LightGrid.
- Log warnings when building grid exceeds the max number of entries/links.
- ensure instead of check that NumLocalLights and NumReflectionCaptures are less than the primitive limit imposed by FCellWriter.
- clamp NumCulledLightLinks when using bThreadGroupPerCell (unlikely since the first 256 in each cell are temporarily stored in LDS instead of linked list).

#rb Ola.Olsson
#jira UE-211955

[CL 37128929 by tiago costa in 5.5 branch]
2024-10-15 13:40:25 -04:00

15 lines
772 B
C

// Copyright Epic Games, Inc. All Rights Reserved.
/*================================================================================================
LightGridDefinitions.h: used in light grid shaders and C++ code to define common constants
=================================================================================================*/
#pragma once
// Must updating packing in FCellWriter when modifying these
#define LIGHT_GRID_CELL_WRITER_MAX_NUM_PRIMITIVES (1 << 24) // must be power to two
#define LIGHT_GRID_CELL_WRITER_MAX_PRIMITIVE_INDEX (LIGHT_GRID_CELL_WRITER_MAX_NUM_PRIMITIVES - 1)
#define LIGHT_GRID_CELL_WRITER_MAX_NUM_LINKS (1 << 24) // must be power to two
#define LIGHT_GRID_CELL_WRITER_MAX_LINK_OFFSET (LIGHT_GRID_CELL_WRITER_MAX_NUM_LINKS - 1)