Skip to content

Commit 9904c41

Browse files
Cleaning up FPTL early out for ps4 and PC (#6882)
* Changelog Co-authored-by: sebastienlagarde <[email protected]>
1 parent 7d89f1f commit 9904c41

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/lightlistbuild.compute

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,15 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
469469
float2 V = abs( float2( dot(fromLight, lightData.lightAxisX.xyz), dot(fromLight, lightData.lightAxisY.xyz) ) );
470470

471471
float fDist2D = bIsSpotDisc ? length(V) : max(V.x,V.y);
472-
bool isValid = all( float2(lightData.radiusSq, fSclProj) > float2(distSq, fDist2D*lightData.cotan) );
472+
bool validInPixel = all( float2(lightData.radiusSq, fSclProj) > float2(distSq, fDist2D*lightData.cotan) );
473473
#ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS
474474
//a wave is on the same tile, and the loop is uniform for the wave.
475475
// thus we early out if at least 1 thread in the wave passed this light, saving some ALU.
476-
lightValid = WaveActiveAnyTrue(isValid);
476+
lightValid = WaveActiveAnyTrue(validInPixel);
477477
#else
478-
lightValid = isValid;
478+
lightValid = validInPixel;
479479
#endif
480-
if (isValid)
480+
if (lightValid)
481481
break;
482482
}
483483
}
@@ -496,13 +496,13 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
496496
float3 toLight = vLp - vVPos;
497497
float distSq = dot(toLight,toLight);
498498

499-
bool isValid = lightData.radiusSq>distSq;
499+
bool validInPixel = lightData.radiusSq>distSq;
500500
#ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS
501-
lightValid = WaveActiveAnyTrue(isValid);
501+
lightValid = WaveActiveAnyTrue(validInPixel);
502502
#else
503-
lightValid = isValid;
503+
lightValid = validInPixel;
504504
#endif
505-
if (isValid)
505+
if (lightValid)
506506
break;
507507
}
508508
}
@@ -521,13 +521,13 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
521521

522522
float3 dist = float3( dot(toLight, lightData.lightAxisX), dot(toLight, lightData.lightAxisY), dot(toLight, lightData.lightAxisZ) );
523523
dist = (abs(dist) - lightData.boxInnerDist) * lightData.boxInvRange; // not as efficient as it could be
524-
bool isValid = max(max(dist.x, dist.y), dist.z)<1; // but allows us to not write out OuterDists
524+
bool validInPixel = max(max(dist.x, dist.y), dist.z)<1; // but allows us to not write out OuterDists
525525
#ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS
526-
lightValid = WaveActiveAnyTrue(isValid);
526+
lightValid = WaveActiveAnyTrue(validInPixel);
527527
#else
528-
lightValid = isValid;
528+
lightValid = validInPixel;
529529
#endif
530-
if (isValid)
530+
if (lightValid)
531531
break;
532532
}
533533
}

0 commit comments

Comments
 (0)