Ensure probe count is never out of bounds

#3963
This commit is contained in:
Wojtek Figat
2026-03-12 08:41:06 +01:00
parent 14e59281e4
commit e736048fab
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@@ -351,6 +351,7 @@ META_CS(true, FEATURE_LEVEL_SM5)
void CS_UpdateProbesInitArgs()
{
uint activeProbesCount = ActiveProbes.Load(0); // Counter at 0
activeProbesCount = min(activeProbesCount, ProbesCount);
uint arg = 0;
for (uint probesOffset = 0; probesOffset < activeProbesCount; probesOffset += DDGI_TRACE_RAYS_PROBES_COUNT_LIMIT)
{