Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glBindBufferRange for (Vertex) Array buffers of VAOs?

  1. #1
    Intern Newbie
    Join Date
    Oct 2016
    Posts
    46

    glBindBufferRange for (Vertex) Array buffers of VAOs?

    With glBindBufferRange I can bind a range of a buffer object to a target binding point (one of the bindings of GL_UNIFORM_BUFFER in most of my cases). But how can I bind a range of a buffer object to a GL_ARRAY_BUFFER binding point of a VAO?
    Do I have to use the offset in glVertexArrayVertexBuffer?

    I want to stream to a VAO array buffer and since I advance into the buffer with every upload I somehow have to tell the shader the range it is supposed to use each frame. The shader is accessing the buffer through vertex attributes.
    Last edited by stimulate; 08-21-2017 at 05:14 AM.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    5,907
    VAOs do not have a "GL_ARRAY_BUFFER binding point". That is a context bind point, which is not associated with the VAO itself.

    I want to stream to a VAO array buffer and since I advance into the buffer with every upload I somehow have to tell the shader the range it is supposed to use each frame.
    No, you don't. The "range" of data used by a rendering command is implicit, based on the vertex data actually used by that rendering command. Indices could cause fetches from anywhere in the buffer. Or at least, anywhere after the base offset.

    You can adjust the offset in `glVertexArrayVertexBuffer` of course, but that defines the location of the 0 index in the array. There is nothing to explicitly tell OpenGL the maximum distance of the bytes you may read.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •