Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,15 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
float2 V = abs( float2( dot(fromLight, lightData.lightAxisX.xyz), dot(fromLight, lightData.lightAxisY.xyz) ) );

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

bool isValid = lightData.radiusSq>distSq;
bool validInPixel = lightData.radiusSq>distSq;
#ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS
lightValid = WaveActiveAnyTrue(isValid);
lightValid = WaveActiveAnyTrue(validInPixel);
#else
lightValid = isValid;
lightValid = validInPixel;
#endif
if (isValid)
if (lightValid)
break;
}
}
Expand All @@ -521,13 +521,13 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL

float3 dist = float3( dot(toLight, lightData.lightAxisX), dot(toLight, lightData.lightAxisY), dot(toLight, lightData.lightAxisZ) );
dist = (abs(dist) - lightData.boxInnerDist) * lightData.boxInvRange; // not as efficient as it could be
bool isValid = max(max(dist.x, dist.y), dist.z)<1; // but allows us to not write out OuterDists
bool validInPixel = max(max(dist.x, dist.y), dist.z)<1; // but allows us to not write out OuterDists
#ifdef PLATFORM_SUPPORTS_WAVE_INTRINSICS
lightValid = WaveActiveAnyTrue(isValid);
lightValid = WaveActiveAnyTrue(validInPixel);
#else
lightValid = isValid;
lightValid = validInPixel;
#endif
if (isValid)
if (lightValid)
break;
}
}
Expand Down