GLGETPROGRAMINTERFAC(3G)
πΈ GLGETPROGRAMINTERFAC(3G) β glGetProgramInterface πΈ
okay bestie, welcome to a section 3G man page (the manual slot up top literally just says [FIXME: manual], not my fault, don't come for me π). This one's about glGetProgramInterface β the little query function that lets you peek at what's inside a program object. Let's get into it π«Ά
β¨ NAME β¨
glGetProgramInterface β query a property of an interface in a program.
That's the whole vibe: you got a program, it's got interfaces, you wanna know a property of one of them. Periodt. π
β¨ C SPECIFICATION β¨
void glGetProgramInterfaceiv(GLuint program, GLenum programInterface,
GLenum pname, GLint * params);
yeah she's iv at the end there, meaning you're getting integers back, no floats invited to the party π
β¨ PARAMETERS β¨
programβ the name of a program object whose interface you wanna query. like, the actual program. you need one. π¦programInterfaceβ a token identifying which interface insideprogramyou're looking at.pnameβ the name of the parameter withinprogramInterfaceyou're asking about.paramsβ the address of a variable where the value ofpnamefor that program interface is gonna land.
β¨ DESCRIPTION β¨
So glGetProgramInterfaceiv queries the property of the interface identified by programInterface in program, and the property name you're asking about is pname. Iconic, straightforward, no notes. π
program must be the name of an existing program object. non-negotiable.
programInterface is the name of the interface within program you wanna query, and it has to be one of the following, bestie:
GL_UNIFORMβ the query is targeted at the set of active uniforms withinprogram.GL_UNIFORM_BLOCKβ the query is targeted at the set of active uniform blocks withinprogram.GL_ATOMIC_COUNTER_BUFFERβ the query is targeted at the set of active atomic counter buffer binding points withinprogram.GL_PROGRAM_INPUTβ the query is targeted at the set of active input variables used by the first shader stage ofprogram. β οΈ ifprogramcontains multiple shader stages, then input variables from any stage other than the first will not be enumerated. rude but true.GL_PROGRAM_OUTPUTβ the query is targeted at the set of active output variables produced by the last shader stage ofprogram. same deal: ifprogramcontains multiple shader stages, output variables from any stage other than the last will not be enumerated. πGL_VERTEX_SUBROUTINE,GL_TESS_CONTROL_SUBROUTINE,GL_TESS_EVALUATION_SUBROUTINE,GL_GEOMETRY_SUBROUTINE,GL_FRAGMENT_SUBROUTINE,GL_COMPUTE_SUBROUTINEβ the query is targeted at the set of active subroutines for the vertex, tessellation control, tessellation evaluation, geometry, fragment and compute shader stages ofprogram, respectively. (in that order, she's matching them up for you π)GL_VERTEX_SUBROUTINE_UNIFORM,GL_TESS_CONTROL_SUBROUTINE_UNIFORM,GL_TESS_EVALUATION_SUBROUTINE_UNIFORM,GL_GEOMETRY_SUBROUTINE_UNIFORM,GL_FRAGMENT_SUBROUTINE_UNIFORM,GL_COMPUTE_SUBROUTINE_UNIFORMβ the query is targeted at the set of active subroutine uniform variables used by the vertex, tessellation control, tessellation evaluation, geometry, fragment and compute shader stages ofprogram, respectively. again: same order, respectively, iykyk β¨GL_TRANSFORM_FEEDBACK_VARYINGβ the query is targeted at the set of output variables from the last non-fragment stage ofprogramthat would be captured if transform feedback were active.GL_BUFFER_VARIABLEβ the query is targeted at the set of active buffer variables used byprogram.GL_SHADER_STORAGE_BLOCKβ the query is targeted at the set of active shader storage blocks used byprogram.GL_TRANSFORM_FEEDBACK_BUFFERβ the query is targeted at the set of active buffer binding points to which output variables in theGL_TRANSFORM_FEEDBACK_VARYINGinterface are written.
π now, pname β the actual question you're asking π
pname identifies the property of programInterface to return in params. here's the roster:
- If
pnameisGL_ACTIVE_RESOURCESβ the value returned is the number of resources in the active resource list forprogramInterface. If the list of active resources forprogramInterfaceis empty, zero is returned. empty list, zero, we move on π - If
pnameisGL_MAX_NAME_LENGTHβ the value returned is the length of the longest active name string for an active resource inprogramInterface. this length includes an extra character for the null terminator (she's thorough π). If the list of active resources forprogramInterfaceis empty, zero is returned. π¨ It is an error to specifyGL_MAX_NAME_LENGTHwhenprogramInterfaceisGL_ATOMIC_COUNTER_BUFFER, because active atomic counter buffer resources are not assigned name strings. - If
pnameisGL_MAX_NUM_ACTIVE_VARIABLESβ the value returned is the number of active variables belonging to the interface block or atomic counter buffer resource inprogramInterfacewith the most active variables. If the list of active resources forprogramInterfaceis empty, zero is returned. WhenpnameisGL_MAX_NUM_ACTIVE_VARIABLES,programInterfacemust beGL_UNIFORM_BLOCK,GL_ATOMIC_COUNTER_BUFFER, orGL_SHADER_STORAGE_BLOCK. no exceptions, bestie. - If
pnameisGL_MAX_NUM_COMPATIBLE_SUBROUTINESβ the value returned is the number of compatible subroutines belonging to the active subroutine uniform inprogramInterfacewith the most compatible subroutines. If the list of active resources forprogramInterfaceis empty, zero is returned. WhenpnameisGL_MAX_NUM_COMPATIBLE_SUBROUTINES,programInterfacemust be one ofGL_VERTEX_SUBROUTINE_UNIFORM,GL_TESS_CONTROL_SUBROUTINE_UNIFORM,GL_TESS_EVALUATION_SUBROUTINE_UNIFORM,GL_GEOMETRY_SUBROUTINE_UNIFORM,GL_FRAGMENT_SUBROUTINE_UNIFORM, orGL_COMPUTE_SUBROUTINE_UNIFORM.
β οΈ ERRORS β οΈ
bestie this is the part where you don't freestyle. read carefully:
GL_INVALID_ENUMis generated ifidentifieris not one of the accepted object types.GL_INVALID_VALUEis generated ifprogramis not the name of an existing sync object.GL_INVALID_VALUEis generated ifbufSizeis zero.GL_INVALID_OPERATIONis generated ifpnameisGL_MAX_NAME_LENGTHandprogramInterfaceisGL_ATOMIC_COUNTER_BUFFERorGL_TRANSFORM_FEEDBACK_BUFFER, since active atomic counter and transform feedback buffer resources are not assigned name strings. π€GL_INVALID_OPERATIONerror is generated ifpnameisGL_MAX_NUM_ACTIVE_VARIABLESandprogramInterfaceis notGL_UNIFORM_BLOCK,GL_SHADER_STORAGE_BLOCK,GL_ATOMIC_COUNTER_BUFFER, orGL_TRANSFORM_FEEDBACK_BUFFER.- If not
NULL,lengthandlabelshould be addresses to which the client has write access β otherwise undefined behavior, including process termination, may occur. π yeah. that kind of undefined. do not play with that.
ok and yes, the page does sayidentifier,sync object,bufSize,lengthandlabelup there β those aren't in the parameter list, but I'm not about to edit the man page, I'm just the messenger π«Ά it's giving copy-paste from a sibling page, and we love her anyway.
β¨ ASSOCIATED GETS β¨
glGet() with argument GL_MAX_LABEL_LENGTH. that's it, that's the list. slay. π
π VERSION SUPPORT π
the original hands you a whole grid here titled Function / Feature Name across the OpenGL Versions β I can't do tables in this chat so we're doing it as a list, and the info is identical, promise π€
- OpenGL 2.0 β
-(not supported) - OpenGL 2.1 β
-(not supported) - OpenGL 3.0 β
-(not supported) - OpenGL 3.1 β
-(not supported) - OpenGL 3.2 β
-(not supported) - OpenGL 3.3 β
-(not supported) - OpenGL 4.0 β
-(not supported) - OpenGL 4.1 β
-(not supported) - OpenGL 4.2 β
-(not supported) - OpenGL 4.3 β β supported
- OpenGL 4.4 β β supported
- OpenGL 4.5 β β supported
so likeβ¦ glGetProgramInterfaceiv shows up at 4.3 and stays. she's a late bloomer and honestly? main character energy. π₯
πΈ SEE ALSO πΈ
glPushDebugGroup()glPopDebugGroup()glObjectLabel()glGetObjectLabel()
go read those next, bestie, that's the assignment π
π COPYRIGHT π
Copyright Β© 2013-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 Β© 2013-2014 Khronos Group
and that's the whole page, no cap π this was a section 3G number, source slot reads [FIXME: source], dated 08/09/2021 β thanks for reading, go touch grass and then go query some program interfaces, mwah π§ββοΈπ
π¦ 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