Compute Shader Dispatch Question, Beginner

Hey Guys,
I started with compute shaders (watched vux’ workshop on youtube) but still struggle with it in practice.

I dispatched a shader with X1, Y1, Z1 and within the Shader set Numthreads[32,8,1]. My understanding is now that something like

OutputBuffer[tid.x * tid.y] = tid.x * tid.y;

Would result in an Int-Array with 256 entries, with every entry having its number inside it. It starts out well but then there are a lot of random looking zeroes inside the array. The go away when I increase Y in the dispatcher but I don’t understand why.

Help?

This is probably not the calculation you want for the buffer index, tid.x + tid.y * xCount will give you the linear index.

Of course that works. Thanks a lot. Stupid me -.-

Thanks for the quick reply! You all here are really great and very much hooked me into sinking my time into VVVV.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.