opengl - Is ordering between glUniformBlockBinding and glBindBufferBase important? -


when using ubos, bind uniform block binding point. bind ubo same binding point: like:

gluseprogram(programname); gluniformblockbinding(programname, uniformlocation, bindingpoint); glbindbufferbase(gl_uniform_buffer, bindingpoint, bufid); 

i have 2 questions on this:

  1. should specify gluniformblockbinding first or glbindbufferbase or order doesn't matter?
  2. if understanding correct, glbindbufferbase must called after have updated ubo data. if correct answers first question.

gluniformblockbinding sets state in program (which why shouldn't calling every frame). glbindbufferrange sets state in opengl context. neither affects other until render, no, doesn't matter which.

and yes, cannot call glbindbufferrange (or base, defined in terms of range) unless have allocated storage buffer object.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -