GPU Write to GL_DRAW_INDIRECT_BUFFER

Hi, I want to setup an indirect draw command via compute shader.

basically Copy an existing buffer to a temporary and then use the temporary for drawing.

According to my naive understanding, I bind both via bindbufferbase(GL_DRAW_INDIRECT_BUFFER,…).

That does not work, obviously.

Question is: How can I write to GL_DRAW_INDIRECT_BUFFER from GPU?

Best Regards

5 Minutes later I tried binding it as GL_SHADER_STORAGE_BUFFER and it works.

Awesome!

Don’t forget glMemoryBarrier(GL_COMMAND_BARRIER_BIT) before using the buffer for indirect commands.