Hi, I am new to these forums and I have a question for you advanced OpenGL coders
I want a Compute Shader to write the indices of my mesh. So, I need to create an index buffer (GL_ELEMENT_ARRAY_BUFFER) which should also be randomly writable from my Compute Shader (so I need it to be a GL_SHADER_STORAGE_BUFFER).
Speaking in D3D11 terms, I want to mimic this functionality from D3D11 which is able to create one single buffer that can be used in both ways as follows:
bufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER | D3D11_BIND_UNORDERED_ACCESS;
The problem is: I don’t know if that’s possible with OpenGL and how to do that.
I think I could create 1 buffer name with glGenBuffers() and then bind the two different targets to it, but I couldn’t find any example or hint anywhere that this could be possible
I know this could be done by writing my indices into a GL_SHADER_STORAGE_BUFFER object and then copying it to a GL_ELEMENT_ARRAY_BUFFER, but I want to avoid copeis as much as possible.
Thanks for your time.