Skip to content

Commit

Permalink
[2023.2] Fix shader warning
Browse files Browse the repository at this point in the history
Fixing HDRP shader compilation warning on Fine light tile pruning compute shader: for loop that is of length 1 requiring force unroll.
  • Loading branch information
adrien-de-tocqueville authored and Evergreen committed Mar 8, 2024
1 parent da0243d commit df602a8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL
// reflection lights are kept in separate regions.

{
for (uint it = 0; it < ((SHADEROPTIONS_FPTLMAX_LIGHT_COUNT+1) + NR_THREADS - 1)/NR_THREADS; ++it)
#define MAX_FINE_PRUNE_LOOP_CNT (((SHADEROPTIONS_FPTLMAX_LIGHT_COUNT+1) + NR_THREADS - 1)/NR_THREADS)
[unroll(MAX_FINE_PRUNE_LOOP_CNT)]
for (uint it = 0; it < MAX_FINE_PRUNE_LOOP_CNT; ++it)
{
uint i = t + it * NR_THREADS;
if (i < (uint)iNrCoarseLights)
Expand Down Expand Up @@ -567,7 +569,9 @@ void FinePruneLights(uint threadID, int iNrCoarseLights, uint2 viTilLL, float vL

if (t == 0) ldsNrLightsFinal = localCount;

for (uint it = 0; it < ((SHADEROPTIONS_FPTLMAX_LIGHT_COUNT+1) + NR_THREADS - 1)/NR_THREADS; ++it)
#define MAX_LIGHT_WRITE_LOOP_CNT (((SHADEROPTIONS_FPTLMAX_LIGHT_COUNT+1) + NR_THREADS - 1)/NR_THREADS)
[unroll(MAX_LIGHT_WRITE_LOOP_CNT)]
for (uint it = 0; it < MAX_LIGHT_WRITE_LOOP_CNT; ++it)
{
uint i = t + it * NR_THREADS;
uint lightsMask = ldsDoesLightIntersect[i >> 5];
Expand Down

0 comments on commit df602a8

Please sign in to comment.