Since you already define the thread groups to be executed when dispaching a compute shader, what do the numbers inside the shader file signify? example: [numthreads(1, 1, 1)]
Asked
Active
Viewed 703 times
1 Answers
1
Did some more digging, by official definition when dispatching you define thread groups while the numthreads statement defines the threads so basically they can be taken as extra dimensions. For example when i dispatch 2,2,1 to a function with 3,1,1 it spawns
enter code here
0, 0, 0 - 0, 0, 0
0, 0, 0 - 1, 0, 0
0, 0, 0 - 2, 0, 0
1, 0, 0 - 0, 0, 0
1, 0, 0 - 1, 0, 0
1, 0, 0 - 2, 0, 0
0, 1, 0 - 0, 0, 0
0, 1, 0 - 1, 0, 0
0, 1, 0 - 2, 0, 0
1, 1, 0 - 0, 0, 0
1, 1, 0 - 1, 0, 0
1, 1, 0 - 2, 0, 0
so 2*2*1*3*1*1 = 12 threads total

Jake Freelander
- 1,471
- 1
- 19
- 26