Altering DISPATCH_INDIRECT_BUFFER from within the shader

Let’s create a buffer object, fill it with three reasonable uints and bind it to two targets: to DISPATCH_INDIRECT_BUFFER and as SSBO to some binding point.
Then call DispatchComputeIndirect with a shader which references that SSBO in writeable fashion and writes new values there.

Is it a feedback loop or incoherent access?

If no, is it safe to do in practice, assuming the program may run with old and problematic drivers?

There’s no feedback loop, as none of the writes can happen before the read of the dispatch operation’s parameters.

Of course, any subsequent dispatch over the same data requires a barrier due to the incoherent write to the SSBO.

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