In what scope do OpenGL binding points exist?

  Kiến thức lập trình

OpenGL allows for the creation of Uniform Buffer Objects. Each UBO lives at a certain binding point (index) from which it can be picked up by a shader (associating a binding point with a block index). But I was wondering, at what scope does this index matter? Does each renderpass have its own set of binding point indices? Or does the whole application have one global list of binding points, shared by all UBOs?

If some why isn’t there some glGenBindingPoint like there is for texture and vbo ids?

And how do I dynamically allocate binding points if I delete a UBO? Do I just pick the next available binding point index or do I not reuse indices?

LEAVE A COMMENT