PDA

View Full Version : OpenGL with descriptors?



acterhd
12-02-2016, 12:33 PM
Hello. I suggest to add OpenGL descriptor layouts for SSBO, Uniform or Atomics.

GLuint layout;
glCreateLayouts(1, &layout);
glLayoutBinding(GLuint layout, GLuint realUnit, GLuint bufferTarget);
glLayoutBindingRange(GLuint layout, GLuint realUnit, GLuint bufferTarget, GLsizei offset, GLsizei size);
glLayoutBindingDisable(GLuint layout, GLuint realUnit);

After, you can bind this buffer:
glBindBufferLayout(GLuint buffer, GLuint layout);

Dark Photon
12-02-2016, 06:46 PM
Is this a "Suggestion for the next release of OpenGL (https://www.opengl.org/discussion_boards/forumdisplay.php/11-Suggestions-for-the-next-release-of-OpenGL)"? If so, you should move your thread to that forum.

(If you can't, let us know and we'll do it.)

acterhd
12-03-2016, 12:34 AM
No I can't send suggestion
But would be cool If I can bind single buffer to multiple binding with one commands. This really need for my C++ wrapper.
Corrected suggestion.

GClements
12-03-2016, 05:53 AM
But would be cool If I can bind single buffer to multiple binding with one commands.

The closest is glBindBuffersBase() and glBindBuffersRange(), which can bind to a contiguous sequence of binding points for a single target (uniform, shader storage, atomic counter or transform feedback). If you have several different targets or the binding points aren't contiguous, then you'll need multiple calls.

Buffers for attribute arrays are stored in the VAO and bound with glBindVertexBuffers() or glVertexArrayVertexBuffers().

It might be useful to have a container (similar to VAOs) for buffer state, but currently no such thing exists.