Good work But you have an issue there :s That static fuzz means you're not rendering all pixels :s To fix: CS/C#: computershader.dispatch(kernal, 8,1,1); in compute: numthreads[64,1,1] suppose you have 512 floats to be process. 512/64 = 8 , gives the number of floats per thread group. Hope that helps!
+jamie shelley Thank you for your reply. But I cannot understand your point. There are 100,000 points and since I want to run it with 300 loops, I've calculate 333 points per each loop that means dispatch with 333-length data buffer(Vector3 struct) for each loop. in compute shader, I did not changed the number of thread per each group from "without looping test" so [numthreads(1024,1,1)] is what I defined. So in CS/C#, computershader.dispatch(kernal, 1,1,1); is what I called. And yes I should have write implementation details on my blog...Maybe you can see my question in here "answers.unity3d.com/questions/1105313/performance-of-looping-compute-shader-in-update.html" So are you suggesting to change the number of threads per group?
Sorry I didn't get a chance to reply until now. in your case the numgroup = (100000/1024) = (int)97.65625 = 98 for each dispatch. Another issue with dispatching inside a loop is that the threads are not synced. Which is why I use ' yield return new WaitForEndOfFrame();' I can help more after work if you're still having problems :)
Good work But you have an issue there :s
That static fuzz means you're not rendering all pixels :s
To fix:
CS/C#:
computershader.dispatch(kernal, 8,1,1);
in compute:
numthreads[64,1,1]
suppose you have 512 floats to be process.
512/64 = 8 , gives the number of floats per thread group.
Hope that helps!
+jamie shelley Thank you for your reply. But I cannot understand your point. There are 100,000 points and since I want to run it with 300 loops, I've calculate 333 points per each loop that means dispatch with 333-length data buffer(Vector3 struct) for each loop.
in compute shader, I did not changed the number of thread per each group from "without looping test" so [numthreads(1024,1,1)] is what I defined.
So in CS/C#, computershader.dispatch(kernal, 1,1,1); is what I called.
And yes I should have write implementation details on my blog...Maybe you can see my question in here "answers.unity3d.com/questions/1105313/performance-of-looping-compute-shader-in-update.html"
So are you suggesting to change the number of threads per group?
Sorry I didn't get a chance to reply until now.
in your case the numgroup = (100000/1024) = (int)97.65625 = 98 for each dispatch.
Another issue with dispatching inside a loop is that the threads are not synced.
Which is why I use ' yield return new WaitForEndOfFrame();'
I can help more after work if you're still having problems :)