Closed PrzemyslawSagalo closed 2 years ago
There is no bugs.
gl_WorkGroupSize.x = 1024
NUM_ELEMENTS = 2048
We can simplify it to this (like the book Figure 10.5):
gl_WorkGroupSize.x = 8
NUM_ELEMENTS = 16
const uint steps = uint(log2(gl_WorkGroupSize.x)) + 1; ==> steps = uint(log2(8)) + 1 = 3 + 1 = 4
So you need 4 steps, like what Figure 10.5 say. You will loop 5 times if you change to <=.
Hi!
Could you check prefixsum.cs.glsl shader. There could be a bug in the line 32. There is
step < steps
and I think it should bestep <= steps
, because in the first version it doesn't calculate the last step.