0

Or do I need to calculate this myself? I can't find a reference for built in global variables in HLSL compute shaders.

Jordan
  • 476
  • 7
  • 16

1 Answers1

1

This should be SV_GroupIndex, which, as described in msdn is :

The "flattened" index of a compute shader thread within a thread group, which turns the multi-dimensional SV_GroupThreadID into a 1D value. SV_GroupIndex varies from 0 to (numthreadsX * numthreadsY * numThreadsZ) – 1.

SV_GroupIndex = SV_GroupThreadID.z*dimx*dimy + 
                  SV_GroupThreadID.y*dimx + 
                  SV_GroupThreadID.x

MSDN Documentation Link

mrvux
  • 8,523
  • 1
  • 27
  • 61