Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8606975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:13:37+00:00 2026-06-12T03:13:37+00:00

I am struggling to understand how exactly VAO is handling buffer mapping. What I’m

  • 0

I am struggling to understand how exactly VAO is handling buffer mapping.
What I’m doing could be described in this pseudocode:

SetUp:
  BindVAO
  BindArrayBuffer
  glBufferData(GL_ARRAY_BUFFER, ExpectedMaxCount, NULL, GL_DYNAMIC_DRAW);//Allocate storage
  glEnableVertexAttribArray
  glVertexAttribPointer

  BindElementBuffer
  Allocate storage (no data yet)

  UnbindVAO
  UnbindArrayBuffer
  UnbindElementBuffer

Draw:
  SubArrayAndElementDataIfNeeded
  BindVAO
  DrawElements
  1. Is this correct that when DrawElements is called OpenGL uses bound VAO to resolve array and element buffer bindings? After a Draw call the bound array buffer is 0, but element buffer is still the one that was used to Draw.

  2. Is it mandatory to allocate buffer memory during VAO setup? Would VAO be invalidated if BufferData was called after setup?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:13:39+00:00Added an answer on June 12, 2026 at 3:13 am

    I am struggling to understand how exactly VAO is handling buffer mapping.

    Be very careful when using the word “mapping” around “buffers”; that has a specific meaning when dealing with buffer objects, one that you probably don’t intend.

    Is this correct that when DrawElements is called OpenGL uses bound VAO to resolve array and element buffer bindings? After a Draw call the bound array buffer is 0, but element buffer is still the one that was used to Draw.

    One has nothing to do with the other. A Vertex Array Object, as the name implies, contains all of the state that is necessary to pull vertex data from arrays. When you bind one, all of that state comes back into the context.

    The reason the “bound array buffer” is 0 after the call is because it was 0 before the call. Draw calls do not change OpenGL state.

    Furthermore, you seem to have fallen for the GL_ARRAY_BUFFER trap. The GL_ARRAY_BUFFER binding only matters to three functions: glVertexAttribPointer, glVertexAttribIPointer, and glVertexAttribLPointer (see a pattern?). These are the only functions that look at that binding. What they do is take the buffer that is bound at the time these functions are called and associates that buffer with the current VAO. GL_ARRAY_BUFFER is not part of the VAO’s state. A buffer object becomes associated with a VAO only when you call one of those three functions. Once you make that call, you can bind whatever you want to GL_ARRAY_BUFFER.

    GL_ELEMENT_ARRAY_BUFFER is part of the VAO’s state.

    Is it mandatory to allocate buffer memory during VAO setup? Would VAO be invalidated if BufferData was called after setup?

    Technically no, but it’s good form to not use a buffer until it has storage. Especially if they’re static buffers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I was looking at this code but I'm struggling to understand what
I am struggling really hard to understand this behavior so maybe someone can shed
I'm struggling to understand the proper way to use noConflict in this context: My
I'm struggling to understand why does this doesn't work. df <- data.frame(a=1:10, b=1:10) foo
Im struggling to understand what this calculation is return base * power(base, exponent -
I have been struggling to understand some pieces of this code. It asks to
I am struggling to understand what I am doing wrong. I have a simple
I am struggling to understand on java threads work so excuse this rather simple
I´m struggling to understand this concept: I have a fixed size definition: (from http://msdn.microsoft.com/pt-br/library/aa931918.aspx
I am struggling to understand this simple regular expression. I have the following attempt:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.