GLGETPROGRAMRESOURCE(3G)
β¨ NAME β¨
Hiii bestie π you're on the GLGETPROGRAMRESOURCE(3G) page from the [FIXME: manual] manual, and we are absolutely getting into it. The function is glGetProgramResourceName β query the name of an indexed resource within a program. That's the whole vibe. β¨
π C SPECIFICATION π
void glGetProgramResourceName(GLuint program, GLenum programInterface,
GLuint index, GLsizei bufSize,
GLsizei * length, char * name);
π PARAMETERS π
programβ the name of a program object whose resources you're trying to query. It's the main character here.programInterfaceβ a token identifying the interface withinprogramthat contains the indexed resource.indexβ the index of the resource withinprogramInterfaceofprogram.bufSizeβ the size of the character array whose address is given byname.lengthβ the address of a variable that will receive the length of the resource name.nameβ the address of a character array into which the name of the resource will be written.
π¦ DESCRIPTION π¦
glGetProgramResourceName retrieves the name string assigned to the single active resource with an index of index in the interface programInterface of program object program. index must be less than the number of entries in the active resource list for programInterface.
program must be the name of an existing program object. programInterface is the name of the interface within program which contains the resource and must be one of these iconic values:
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.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.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.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.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.
The name string assigned to the active resource identified by index is returned as a null-terminated string in the character array whose address is given in name. The actual number of characters written into name, excluding the null terminator, is returned in length. If length is NULL, no length is returned. The maximum number of characters that may be written into name, including the null terminator, is specified by bufSize. If the length of the name string including the null terminator is greater than bufSize, the first bufSize-1 characters of the name string will be written to name, followed by a null terminator. If bufSize is zero, no error will be generated but no characters will be written to name. The length of the longest name string for programInterface>, including a null terminator, can be queried by calling glGetProgramInterface() with a pname of GL_MAX_NAME_LENGTH. π
π ERRORS π
Bestie, these are the red flags:
GL_INVALID_ENUMis generated ifprogramInterfaceis not one of the accepted interface types.GL_INVALID_VALUEis generated ifprogamis not the name of an existing program.GL_INVALID_VALUEis generated ifindexis greater than or equal to the number of entries in the active resource list forprogramInterface.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.
π VERSION SUPPORT π
Here's the OpenGL Version vibe check for the Function / Feature Name glGetProgramResourceName, literally exactly like the table says:
2.0:-2.1:-3.0:-3.1:-3.2:-3.3:-4.0:-4.1:-4.2:-4.3:β4.4:β4.5:β
π SEE ALSO π
Don't sleep on these besties:
glGetProgramResourceIndex()glGetProgramResource()glGetProgramResourceLocation()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/.
π COPYRIGHT π
Copyright Β© 2013-2014 Khronos Group
This page came from [FIXME: source], dated 08/09/2021, and it's the GLGETPROGRAMRESOURCE(3G) manual page. Bye bestie, go name those resources π
β¨π«Ά
π¦ 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