GLGETPROGRAMRESOURCE(3G)

    .SH "NAME" glGetProgramResourceName - query the name of an indexed resource within a program
    .SH "C SPECIFICATION"

            .HP u void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, 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 indexed resource.

                .RE
                .PP index

                            The index of the resource within programInterface of program.

                    .RE
                    .PP bufSize

                                The size of the character array whose address is given by name.

                        .RE
                        .PP length

                                    The address of a variable which will receive the length of the resource name.

                            .RE
                            .PP name

                                        The address of a character array into which will be written the name of the resource.

                                .RE

                            .SH "DESCRIPTION"
                                .PP 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.
                                .PP 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 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 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 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.

                                                        .SH "ERRORS"
                                                            .PP GL_INVALID_ENUM is generated if programInterface is not one of the accepted interface types.
                                                            .PP GL_INVALID_VALUE is generated if progam is not the name of an existing program.
                                                            .PP GL_INVALID_VALUE is generated if index is greater than or equal to the number of entries in the active resource list for programInterface.
                                                            .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.

                                                        .SH "API VERSION SUPPORT"

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

                                                        .SH "SEE ALSO"
                                                            .PP glGetProgramResourceIndex(), glGetGetProgramResource(), glGetProgramResourceLocation(), glGetProgramResourceLocationIndex().

                                                        .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