table of contents
GLGETPROGRAMRESOURCE(3G) | OpenGL Manual | GLGETPROGRAMRESOURCE(3G) |
NAME¶
glGetProgramResourceIndex - query the index of a named resource within a program
C SPECIFICATION¶
GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char * name);
PARAMETERS¶
program
programInterface
name
DESCRIPTION¶
glGetProgramResourceIndex returns the unsigned integer index assigned to a resource named name in the interface type programInterface of program object program.
program must be the name of an existing program object. programInterface is the name of the interface within program which contains the resource named nameand must be one of the following values:
GL_UNIFORM
GL_UNIFORM_BLOCK
GL_PROGRAM_INPUT
GL_PROGRAM_OUTPUT
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 of program, 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 of program, respectively.
GL_TRANSFORM_FEEDBACK_VARYING
GL_BUFFER_VARIABLE
GL_SHADER_STORAGE_BLOCK
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.
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.
ERRORS¶
GL_INVALID_ENUM is generated if programInterface is not one of the accepted interface types.
Although not an error, GL_INVALID_INDEX is returned if name is not the name of a resource within the interface identified by programInterface.
SEE ALSO¶
glGetProgramResourceName(), glGetGetProgramResource(), glGetProgramResourceLocation(), glGetProgramResourceLocationIndex().
COPYRIGHT¶
Copyright © 2012 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/.
AUTHORS¶
opengl.org
05/02/2014 | opengl.org |