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 6 of 6

Thread: Element buffer binding is VAO or context state?

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941

    Element buffer binding is VAO or context state?

    Hi,

    I'm getting pretty confused about what state is really element buffer binding.
    According to my experience it is VAO state thus switching VAOs also switches element array buffer binding.
    However, I'm now confused because AFAIK the GL spec language does not state this anywhere.
    It says the following about what VAOs encapsulate:

    The currently bound vertex array object is used for all commands which modify
    vertex array state, such as VertexAttribPointer and EnableVertexAttribArray;
    all commands which draw from vertex arrays, such as DrawArrays and DrawEle-
    ments; and all queries of vertex array state (see chapter 6).
    Also, I did not found in the GL core spec 4.1 any binding like ELEMENT_ARRAY_BUFFER_BINDING for them as it was ELEMENT_ARRAY_BUFFER_BINDING_ARB in the GL_ARB_vertex_buffer_object.

    Can anybody clarify this to me?
    Why there is no explicit wording about it in the spec?
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,715

    Re: Element buffer binding is VAO or context state?

    Did you look at the state tables titled "Vertex Array Object state?"

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2010
    Posts
    22

    Re: Element buffer binding is VAO or context state?

    // init
    compile vao

    // render
    bind vao
    bind array element
    draw

    And there are pretty good reasons for that.
    You often want to use same vertex arrays with different indexes, topologies, offsets or primitive count.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941

    Re: Element buffer binding is VAO or context state?

    Quote Originally Posted by Alfonse Reinheart
    Did you look at the state tables titled "Vertex Array Object state?"
    Thanks Alfonse. I was pretty sure this is the case but I was frustrated that I didn't find the ELEMENT_ARRAY_BUFFER_BINDING in the spec. Maybe PDF search bug
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,715

    Re: Element buffer binding is VAO or context state?

    As a general rule when searching the spec PDFs: if you're looking for a Get field, search won't find it. For some reason, it can't search the stuff in the state tables. Which means if the Get field isn't mentioned in the text, the search can't find it.

    So if you're looking for a Get, it's best to just go straight to the source.

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941

    Re: Element buffer binding is VAO or context state?

    Thanks for the tip, didn't realize this problem earlier.
    Anyway, that means one more feature that's missing from GL_EXT_direct_state_access
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

Posting Permissions

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