You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fastPath = IsFastPath(lightStart, lightStartLane0); // True if all pixels belong to the same tile (or cluster)
655
+
656
+
if (fastPath)
657
+
{
658
+
lightStart = lightStartLane0;
659
+
}
660
+
#endif
661
+
662
+
// Scalarized loop. All lights that are in a tile/cluster touched by any pixel in the wave are loaded (scalar load), only the one relevant to current thread/pixel are processed.
663
+
// For clarity, the following code will follow the convention: variables starting with s_ are meant to be wave uniform (meant for scalar register),
664
+
// v_ are variables that might have different value for each thread in the wave (meant for vector registers).
665
+
// This will perform more loads than it is supposed to, however, the benefits should offset the downside, especially given that light data accessed should be largely coherent.
666
+
// Note that the above is valid only if wave intriniscs are supported.
667
+
uint v_lightListOffset = 0;
668
+
uint v_lightIdx = lightStart;
669
+
670
+
#if NEED_TO_CHECK_HELPER_LANE
671
+
// On some platform helper lanes don't behave as we'd expect, therefore we prevent them from entering the loop altogether.
672
+
// IMPORTANT! This has implications if ddx/ddy is used on results derived from lighting, however given Lightloop is called in compute we should be
673
+
// sure it will not happen.
674
+
bool isHelperLane = WaveIsHelperLane();
675
+
while (!isHelperLane && v_lightListOffset < lightCount)
0 commit comments