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.
that shuld help u
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.
could you provide a small example patch?
here is an example patch that depicts the problem.
essentially it is the indirectlookup patch contained in the dx11 girlpower package.
indirectlookup.zip (6.5 kB)
well i just got a driver crash when i run it
hm and can you open
or is this also crashing?
and is this crashing?
indirectlookup.zip (6.4 kB)
ok then i don’t know whats wrong with it.
can you (or anyone here) provide a working example where a compute shader accesses all elements that got appended in a previous compute shader?
i don’t think that GetDimensions is a solution for this problem.
would like to know this too
Dispatch indirect girlpower example in github now, will be available for next release, planned rather soon.