GLGETPROGRAMRESOURCE(3G)
π NAME π
Okay bestie, welcome to GLGETPROGRAMRESOURCE(3G) β the manual page for glGetProgramResourceIndex, aka the call that asks βhey program, whatβs the index of this named resource in this interface?β π
β¨ C SPECIFICATION β¨
GLuint glGetProgramResourceIndex(GLuint program,
GLenum programInterface,
const char * name);
π PARAMETERS π
programβ the name of a program object whose resources you want to query. Like, which program are we snooping through? πprogramInterfaceβ a token identifying the interface insideprogramthat contains the resource namedname. Itβs giving βwhich lil section are we checking?β energy.nameβ the name of the resource whose index youβre trying to find. Slay, specific. π
π¦ DESCRIPTION π¦
glGetProgramResourceIndex returns the unsigned integer index assigned to a resource named name in the interface type programInterface of program object program. Itβs giving βresource index lookup, but make it OpenGL.β β¨
program must be the name of an existing program object. programInterface is the name of the interface within program which contains the resource named name and must be one of these values β no improvising, 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_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. First stage only, periodt.GL_PROGRAM_OUTPUTβ the query is targeted at the set of active output variables produced by the last shader stage ofprogram. Ifprogramcontains multiple shader stages then output variables from any stage other than the last will not be enumerated. Last stage main character energy only.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. Respectively is doing a lot of work there, but okay π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. Subroutine uniforms, but make it stage-specific. π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. βWould be capturedβ is the key vibe.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.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.
If name exactly matches the name string of one of the active resources for programInterface, the index of the matched resource is returned. Additionally, if name would exactly match the name string of an active resource if "[0]" were appended to name, the index of the matched resource is returned. Otherwise, name is considered not to be the name of an active resource, and GL_INVALID_INDEX is returned. No match, no index, bestie. π
For the interface GL_TRANSFORM_FEEDBACK_VARYING, the value GL_INVALID_INDEX should be returned when querying the index assigned to the special names gl_NextBuffer, gl_SkipComponents1, gl_SkipComponents2, gl_SkipComponents3, or gl_SkipComponents4. Those special names are not getting a cute little index from this call. π
π₯ ERRORS π₯
GL_INVALID_ENUMis generated ifprogramInterfaceis not one of the accepted interface types. Like, if you made up a token? Not iconic.GL_INVALID_ENUMis generated ifprogramInterfaceisGL_ATOMIC_COUNTER_BUFFERorGL_TRANSFORM_FEEDBACK_BUFFER, since active atomic counter and transform feedback buffer resources are not assigned name strings. So donβt come for them with anamelookup, okay?- Although not an error,
GL_INVALID_INDEXis returned ifnameis not the name of a resource within the interface identified byprogramInterface. Itβs not a scream, itβs just a βno index for youβ moment.
π VERSION SUPPORT π
Version support for glGetProgramResourceIndex β the function/feature name in the table β is fully here, just in cute list form: π
- OpenGL
2.0:- - OpenGL
2.1:- - OpenGL
3.0:- - OpenGL
3.1:- - OpenGL
3.2:- - OpenGL
3.3:- - OpenGL
4.0:- - OpenGL
4.1:- - OpenGL
4.2:- - OpenGL
4.3:β - OpenGL
4.4:β - OpenGL
4.5:β
So yeah, itβs a 4.3+ girlie. No cap. π₯
π SEE ALSO π
glGetProgramResourceName()glGetProgramResource()glGetProgramResourceLocation()glGetProgramResourceLocationIndex()
These are the besties to check next. π«Ά
π 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 π
Copyright Β© 2013-2014 Khronos Group
Okay bye bestie! This page came from [FIXME: source], version/date 08/09/2021, and the manual name stamp is GLGETPROGRAMRESOURCE(3G). Stay slaying those resource indexes! π
β¨
π¦ 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