0
\$\begingroup\$

Newbie question, and sorry for my English. Suppose that we create a lot of GL_ARRAY_BUFFER buffers, fill them with some data. But only few of them we link with shader variables. During glDraw..., what happens with other non-linked buffers? Do they go to the pipeline as well as linked buffers?

I hear but can misunderstood, that all buffers linked to the current VAO will go to the pipeline in any case, if they are involved in the shader or not. I hope this is wrong.

\$\endgroup\$
  • \$\begingroup\$ Why would you create a array buffer, link it to the vbo and but not link it to a shader input in the first place? AFAIK all is bound to the shader nonetheless. If you don't explicitly point the shader variable name, then it will link by order of declaring (1st var, 2nd var, 3rd var...) \$\endgroup\$ – Gustavo Maciel Jun 3 '15 at 12:00
  • \$\begingroup\$ What do you mean by "go into the pipeline"? \$\endgroup\$ – user253751 Jun 3 '15 at 22:13
0
\$\begingroup\$

The reason for using VBOs (Vertex Buffer Objects) is to keep vertex data in graphics memory and not to have to keep uploading it each time it is used. If you have a lot of vertex data and do not use VBOs your game may become bandwidth limited. You will only need to bind and attach the VBOs that you wish to use in the next draw call.
All other VBOs will be ignored by the pipeline until you bind and attach then.

VAOs hold the extra state that is needed to use VBOs without making unnecessary calls. The same principles apply to VAOs, if you have VAOs that are not bound then they are simply ignored by the pipeline until you bind them.

\$\endgroup\$
  • \$\begingroup\$ If you are happy that this is the answer then please mark it “accepted” (you get points). You do not have to mark answers “accepted”. stackoverflow.com/help/someone-answers \$\endgroup\$ – OFE Jun 7 '15 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.