Optimize probes count multiplication in DDGI shader

This commit is contained in:
Wojtek Figat
2024-07-03 08:51:58 +02:00
parent 6fbf4a6aac
commit 00a9c48fec
2 changed files with 6 additions and 5 deletions

View File

@@ -30,7 +30,8 @@ DDGIData DDGI;
GlobalSDFData GlobalSDF;
GlobalSurfaceAtlasData GlobalSurfaceAtlas;
GBufferData GBuffer;
float2 Padding0;
float Padding0;
uint ProbesCount;
float ResetBlend;
float TemporalTime;
int4 ProbeScrollClears[4];
@@ -86,8 +87,7 @@ META_CS(true, FEATURE_LEVEL_SM5)
void CS_Classify(uint3 DispatchThreadId : SV_DispatchThreadID)
{
uint probeIndex = DispatchThreadId.x;
uint probesCount = DDGI.ProbesCounts.x * DDGI.ProbesCounts.y * DDGI.ProbesCounts.z;
if (probeIndex >= probesCount)
if (probeIndex >= ProbesCount)
return;
uint3 probeCoords = GetDDGIProbeCoords(DDGI, probeIndex);
probeIndex = GetDDGIScrollingProbeIndex(DDGI, CascadeIndex, probeCoords);
@@ -271,7 +271,6 @@ META_CS(true, FEATURE_LEVEL_SM5)
[numthreads(1, 1, 1)]
void CS_UpdateProbesInitArgs()
{
uint probesCount = DDGI.ProbesCounts.x * DDGI.ProbesCounts.y * DDGI.ProbesCounts.z;
uint activeProbesCount = ActiveProbes.Load(0);
uint arg = 0;
for (uint probesOffset = 0; probesOffset < activeProbesCount; probesOffset += DDGI_TRACE_RAYS_PROBES_COUNT_LIMIT)