Hi, how can I know for sure that from the moment I call:
shader.Dispatch(kernelHandle, x, y, z);
the next line the compute shader is done with the calculations? I mean, lets say I want to calculate some data and send a compute buffer, how can I know for sure that right after I called Dispatch, the data from the compute buffer is ready so I can get it again? I’ve seen a lot of examples and all of them shows something like:
shader.SetBuffer(kernelHandle, "TestBuffer", buffer);
shader.Dispatch(kernelHandle, 8, 8, 1);
Test[] testBack = new Test[2];
buffer.GetData(testBack);
I mean how the application knows that after dispatch you can already get the data? Or the calculation is so fast that the calculation time is smaller than going from one line of code to another?