Or do I need to calculate this myself? I can't find a reference for built in global variables in HLSL compute shaders.
Asked
Active
Viewed 587 times
1 Answers
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

mrvux
- 8,523
- 1
- 27
- 61