Skip to content

Commit 3cbbde1

Browse files
alelievrEvergreen
authored andcommitted
1 parent a60833b commit 3cbbde1

File tree

1 file changed

+2
-2
lines changed
  • Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop

1 file changed

+2
-2
lines changed

Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ void InitializeLightLoop(IBLFilterBSDF[] iBLFilterBSDFArray)
728728
// All the allocation of the compute buffers need to happened after the kernel finding in order to avoid the leak loop when a shader does not compile or is not available
729729
m_LightLoopLightData.Initialize(m_MaxDirectionalLightsOnScreen, m_MaxPunctualLightsOnScreen, m_MaxAreaLightsOnScreen, m_MaxEnvLightsOnScreen, m_MaxDecalsOnScreen);
730730

731-
m_TileAndClusterData.Initialize(allocateTileBuffers: true, clusterNeedsDepth: k_UseDepthBuffer, maxLightCount: m_MaxLightsOnScreen);
731+
m_TileAndClusterData.Initialize(allocateTileBuffers: true, clusterNeedsDepth: k_UseDepthBuffer, maxLightCount: m_MaxLightsOnScreen + m_MaxDecalsOnScreen); // both light and decals are stored in the cluster
732732

733733
// Setup shadow algorithms
734734
var shadowParams = asset.currentPlatformRenderPipelineSettings.hdShadowInitParams;
@@ -863,7 +863,7 @@ static int NumLightIndicesPerClusteredTile()
863863

864864
void LightLoopAllocResolutionDependentBuffers(HDCamera hdCamera, int width, int height)
865865
{
866-
m_TileAndClusterData.AllocateResolutionDependentBuffers(hdCamera, width, height, m_MaxViewCount, m_MaxLightsOnScreen);
866+
m_TileAndClusterData.AllocateResolutionDependentBuffers(hdCamera, width, height, m_MaxViewCount, m_MaxLightsOnScreen + m_MaxDecalsOnScreen);
867867
}
868868

869869
void LightLoopReleaseResolutionDependentBuffers()

0 commit comments

Comments
 (0)