GLUNIFORMBLOCKBINDIN(3G)
π glUniformBlockBinding (3G) β¨
okay so bestie, welcome to the OpenGL corner of the manual pages β section 3G, the GL function pages, and today's main character is glUniformBlockBinding. she's the one who tells a uniform block exactly which binding point it's gonna live at. no cap. π
πΈ NAME πΈ
glUniformBlockBinding β assign a binding point to an active uniform block π«Ά
β¨ C SPECIFICATION β¨
void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex,
GLuint uniformBlockBinding);
literally copy that signature exactly, bestie. three GLuints, no vibes-based improvising. π
π¦ PARAMETERS π¦
programβ the name of a program object that contains the active uniform block whose binding you're assigning. like, the program holding the block. πuniformBlockIndexβ the index of the active uniform block withinprogramwhose binding you're assigning. yep, it's an index, not a name. iykyk. β¨uniformBlockBindingβ the actual binding point you want to bind the uniform block with indexuniformBlockIndexwithinprogramto. this is the destination, queen. π
π DESCRIPTION π
so binding points for active uniform blocks get assigned with glUniformBlockBinding. every active uniform block in a program has a matching uniform buffer binding point β think of it as her designated seat. πΊ
program is the name of a program object for which the command glLinkProgram() has been issued in the past. past tense, bestie β she has to have been linked already. π
if everything goes well, glUniformBlockBinding specifies that program will use the data store of the buffer object bound to the binding point uniformBlockBinding to extract the values of the uniforms in the uniform block identified by uniformBlockIndex. so: buffer object at that binding point β data store β pull the uniform values out of it. that's the whole pipeline. ate. π
π¨ real talk though: when a program object is linked or re-linked, the uniform buffer object binding point assigned to each of its active uniform blocks is reset to zero. every single one. so don't be out here thinking your bindings survived a re-link, because they did not. π
π ERRORS π
GL_INVALID_VALUEis generated ifuniformBlockIndexis not an active uniform block index ofprogram. that index isn't hers. πGL_INVALID_VALUEis generated ifuniformBlockBindingis greater than or equal to the value ofGL_MAX_UNIFORM_BUFFER_BINDINGS. out of range, babe. πGL_INVALID_VALUEis generated ifprogramis not the name of a program object generated by the GL. not a real program, not a real problem-solver. β
π NOTES π
glUniformBlockBinding is available only if the GL version is 3.1 or greater. so check your version first, bestie, or this whole thing is giving nothing. π§
π ASSOCIATED GETS π
glGetActiveUniformBlock()with argumentGL_UNIFORM_BLOCK_BINDINGβ this is how you peek at the current binding. lowkey useful. β
π VERSION SUPPORT π
the original ships this as a big grid, but we're doing it as a list because tables are not it. the columns were OpenGL versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, and the row was glUniformBlockBinding:
2.0β β (-)2.1β β (-)3.0β β (-)3.1β β3.2β β3.3β β4.0β β4.1β β4.2β β4.3β β4.4β β4.5β β
so like β she shows up at 3.1 and then never leaves. loyal. π«Ά
πΈ SEE ALSO πΈ
glLinkProgram()glBindBufferBase()glBindBufferRange()glGetActiveUniformBlock()
go read those too, bestie, they're all in the same friend group. π
π COPYRIGHT π
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2010-2014 Khronos Group
k that's the whole page!! π the source line is[FIXME: source], it was dated08/09/2021, and the page goes byGLUNIFORMBLOCKBINDIN(3G)up top and down at the bottom. slay, go bind some uniform blocks responsibly. β¨π¦π
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms