GLGETPROGRAMRESOURCE(3G)
β¨ GLGETPROGRAMRESOURCE(3G) β¨
okay bestie, welcome to the 3G manual page for glGetProgramResourceLocation β yes the whole title is a mouthful, we're gonna get through it together π
πΈ NAME πΈ
glGetProgramResourceLocation β query the location of a named resource within a program. that's it, that's the vibe check π
π C SPECIFICATION π
GLint glGetProgramResourceLocation(GLuint program,
GLenum programInterface,
const char * name);
look at her. three args, one GLint coming back. iconic. π
π¦ PARAMETERS π¦
programβ the name of a program object whose resources you wanna query. like, which program are we snooping in, bestie? πprogramInterfaceβ a token identifying the interface withinprogramthat contains the resource namedname. it's giving "which section of the program" energy.nameβ the name of the resource to query the location of. literally just tell it what you're looking for fr fr.
π DESCRIPTION π
so glGetProgramResourceLocation returns the location assigned to the variable named name in interface programInterface of program object program. got it? good. π
program must be the name of a program that has been linked successfully. no half-baked programs, we don't do that here π
and programInterface has to be one of these ten tokens, no substitutions:
GL_UNIFORMGL_PROGRAM_INPUTGL_PROGRAM_OUTPUTGL_VERTEX_SUBROUTINE_UNIFORMGL_TESS_CONTROL_SUBROUTINE_UNIFORMGL_TESS_EVALUATION_SUBROUTINE_UNIFORMGL_GEOMETRY_SUBROUTINE_UNIFORMGL_FRAGMENT_SUBROUTINE_UNIFORMGL_COMPUTE_SUBROUTINE_UNIFORMGL_TRANSFORM_FEEDBACK_BUFFER
slay. periodt. β¨
the value -1 will be returned if an error occurs, if name does not identify an active variable on programInterface, or if name identifies an active variable that does not have a valid location assigned, as described above. so -1 is basically the "nope, not found, not valid, or something went wrong" of return values π
the locations returned by these commands are the same locations returned when querying the GL_LOCATION and GL_LOCATION_INDEX resource properties. same numbers, different door πͺ
π§ when does a string actually match an active variable?
a string you hand to glGetProgramResourceLocation is considered to match an active variable if:
- the string exactly matches the name of the active variable π―
- if the string identifies the base name of an active array, where the string would exactly match the name of the variable if the suffix
"[0]"were appended to the string π― - if the string identifies an active element of the array, where the string ends with the concatenation of the
"["character, an integer with no"+"sign, extra leading zeroes, or whitespace identifying an array element, and the"]"character, the integer is less than the number of active elements of the array variable, and where the string would exactly match the enumerated name of the array if the decimal integer were replaced with zero. yes that's a whole sentence, read it twice, it's fine, i believe in you π«Ά
any other string is considered not to identify an active variable. sorry babe. π
if the string specifies an element of an array variable, glGetProgramResourceLocation returns the location assigned to that element. and if it specifies the base name of an array, it identifies the resources associated with the first element of the array. first one gets the crown π
π ERRORS π
GL_INVALID_VALUEis generated ifprogramis not the name of an existing program object. like, that program does not exist, bestie πGL_INVALID_ENUMis generated ifprogramInterfaceis not one of the accepted interface types. read the list again, it's up there β¬οΈGL_INVALID_OPERATIONis generated ifprogramhas not been linked successfully. link it first omg π₯
β VERSION SUPPORT β
the function in question is glGetProgramResourceLocation, and the feature-name column situation is: just her πββοΈ
here's the OpenGL version tea π΅:
- 2.0 β
-(nope) - 2.1 β
-(still nope) - 3.0 β
-(nope) - 3.1 β
-(nope) - 3.2 β
-(nope) - 3.3 β
-(nope) - 4.0 β
-(nope) - 4.1 β
-(nope) - 4.2 β
-(nope) - 4.3 β
β(oh she's here!!) π - 4.4 β
β(yes) - 4.5 β
β(yes)
so she showed up in 4.3 and stayed. main character energy from 4.3 onward ππ
πΈ SEE ALSO πΈ
go read these too, they're all in the family:
glGetProgramResourceName()glGetProgramResourceIndex()glGetProgramResource()glGetProgramResourceLocationIndex()
π«Ά 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/.
and again, because she said it twice and we respect the repetition:
Copyright Β© 2013-2014 Khronos Group
okay that's the whole page bestie, you ate that πβ¨ one lil sign-off before you go: this was pulled from [FIXME: source] (yes, the source field is literally still a FIXME and honestly? relatable), dated 08/09/2021, and it lives under the GLGETPROGRAMRESOURCE(3G) header. now go query some resource locations, i'm obsessed with you ππ
π¦ 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