table of contents
GLGETPROGRAMRESOURCE(3G) | [FIXME: manual] | GLGETPROGRAMRESOURCE(3G) |
NAME¶
glGetProgramResourceLocation - query the location of a named resource within a program
C SPECIFICATION¶
GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char * name);
PARAMETERS¶
program
programInterface
name
DESCRIPTION¶
glGetProgramResourceLocation returns the location assigned to the variable named name in interface programInterface of program object program. program must be the name of a program that has been linked successfully. programInterface must be one of GL_UNIFORM, GL_PROGRAM_INPUT, GL_PROGRAM_OUTPUT, 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, or GL_TRANSFORM_FEEDBACK_BUFFER.
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. The locations returned by these commands are the same locations returned when querying the GL_LOCATION and GL_LOCATION_INDEX resource properties.
A string provided to glGetProgramResourceLocation is considered to match an active variable if:
Any other string is considered not to identify an active variable. If the string specifies an element of an array variable, glGetProgramResourceLocation returns the location assigned to that element. If it specifies the base name of an array, it identifies the resources associated with the first element of the array.
ERRORS¶
GL_INVALID_VALUE is generated if program is not the name of an existing program object.
GL_INVALID_ENUM is generated if programInterface is not one of the accepted interface types.
GL_INVALID_OPERATION is generated if program has not been linked successfully.
VERSION SUPPORT¶
OpenGL Version | ||||||||||||
Function / Feature Name | 2.0 | 2.1 | 3.0 | 3.1 | 3.2 | 3.3 | 4.0 | 4.1 | 4.2 | 4.3 | 4.4 | 4.5 |
glGetProgramResourceLocation | - | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔ |
SEE ALSO¶
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/.
COPYRIGHT¶
Copyright © 2013-2014 Khronos Group
08/09/2021 | [FIXME: source] |