GLGETPROGRAMRESOURCE(3G)

    .SH "NAME" glGetProgramResourceIndex - query the index of a named resource within a program
    .SH "C SPECIFICATION"

            .HP u GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char * name);

    .SH "PARAMETERS"

        .PP program

                    The name of a program object whose resources to query.

            .RE
            .PP programInterface

                        A token identifying the interface within program containing the resource named name.

                .RE
                .PP name

                            The name of the resource to query the index of.

                    .RE

                .SH "DESCRIPTION"
                    .PP glGetProgramResourceIndex returns the unsigned integer index assigned to a resource named name in the interface type programInterface of program object program.
                    .PP 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 the following values:

                        .PP GL_UNIFORM

                                    The query is targeted at the set of active uniforms within program.

                            .RE
                            .PP GL_UNIFORM_BLOCK

                                        The query is targeted at the set of active uniform blocks within program.

                                .RE
                                .PP GL_PROGRAM_INPUT

                                            The query is targeted at the set of active input variables used by the first shader stage of program. If program contains multiple shader stages then input variables from any stage other than the first will not be enumerated.

                                    .RE
                                    .PP GL_PROGRAM_OUTPUT

                                                The query is targeted at the set of active output variables produced by the last shader stage of program. If program contains multiple shader stages then output variables from any stage other than the last will not be enumerated.

                                        .RE
                                        .PP GL_TRANSFORM_FEEDBACK_VARYING

                                                    The query is targeted at the set of output variables from the vertex stage of program that would be captured if transform feedback were active.

                                            .RE
                                            .PP GL_BUFFER_VARIABLE

                                                        The query is targeted at the set of active buffer variables used by program.

                                                .RE
                                                .PP GL_SHADER_STORAGE_BLOCK

                                                            The query is targeted at the set of active shader storage blocks used by program.

                                                    .RE

                                                .PP 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.

                                            .SH "ERRORS"
                                                .PP GL_INVALID_ENUM is generated if programInterface is not one of the accepted interface types.
                                                .PP GL_INVALID_ENUM is generated if programInterface is GL_ATOMIC_COUNTER_BUFFER or GL_TRANSFORM_FEEDBACK_BUFFER, since active atomic counter and transform feedback buffer resources are not assigned name strings.
                                                .PP Although not an error, GL_INVALID_INDEX is returned if name is not the name of a resource within the interface identified by programInterface.

                                            .SH "API VERSION SUPPORT"

                                                .TS allbox tab(:); l l l l l. T{ glGetProgramResourceIndex T}:T{ T}:T{ T}:T{ T}:T{ T}

                                            .SH "SEE ALSO"
                                                .PP glGetProgramResourceName(), glGetGetProgramResource(), glGetProgramResourceLocation(),

                                            .SH "COPYRIGHT"
                                                .PP Copyright © 2012-2015 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 © 2012-2015 Khronos Group