I have looked everywhere but couldn’t find one that used DSA. I need a SSBO with dynamic size so that I can update my instances WITHOUT having a limit like MAX_INSTANCE_COUNT.
At the moment what I do is:
unsigned int id = 0;
glCreateBuffers(1, &id);
glNamedBufferStorage(id, datasize, data, GL_DYNAMIC_STORAGE_BIT);
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, index, id, 0, datasize);
Then in the loop what I do is:
glNamedBufferData(id, (GLsizeiptr)datasize, data, GL_STREAM_DRAW);
I did use “glNamedBufferSubData” but that doesn’t really let me go above the datasize.
If you could explain step by step how I could do this, I’d really appreciate it.