I am writing some indices within a compute shader into an AppendStructuredBuffer. (these indices are used to access another buffer and serve as a filter)
Now I want to access these indices in a further computeshader. The problem is that I dont know how many indices are written into the appendbuffer every frame. At the moment I am using the copycounter/readback nodes to get the count of appended indices and set the Dispatcher for the next compute shader accordingly.
Unfortunately this is very unperformant because of the readback.
Is there a way to access the current data in the AppendStructuredBuffer without dynamically setting the Dispatcher Threads? Do I have to utilize DispatchIndirect? And if yes - how?
i don’t think setting dynamically dispatch threads is a good idea, i think it should be set to maximum expected count in the begining.
i think u have something called resource info or something like that, that gives u count.
unfortunately this doesn’t work.
GetDimensions on the AppendSB always outputs the maximum count I used to setup the dispatcher, also if the number of appended data per frame is much lower.