This extension provides a single unified set of query commands that can be used by applications to determine properties of various interfaces and resources used by program objects to communicate with application code, fixed-function OpenGL pipeline stages, and other programs. In unextended OpenGL 4.2, there is a separate set of query commands for each different type of interface or resource used by the program. These different sets of queries are structured nearly identically, but the queries for some interfaces have limited capability (e.g., there is no ability to enumerate fragment shader outputs).
With the single set of query commands provided by this extension, a consistent set of queries is available for all interfaces, and a new interface can be added without having to introduce a completely new set of query commands. These queries are intended to provide a superset of the capabilities provided by similar queries in OpenGL 4.2, and should allow for the deprecation of the existing queries.
This extension defines two terms: interfaces and active resources. Each interface of a program object provides a way for the program to communicate with application code, fixed-function OpenGL pipeline stages, and other programs. Examples of interfaces for a program object include inputs (receiving values from vertex attributes or outputs of other programs), outputs (sending values to other programs or per-fragment operations), uniforms (receiving values from API calls), uniform blocks (receiving values from bound buffer objects), subroutines and subroutine uniforms (receiving API calls to indicate functions to call during program execution), and atomic counter buffers (holding values to be manipulated by atomic counter shader functions). Each interface of a program has a set of active resources used by the program. For example, the resources of a program's input interface includes all active input variables used by the first stage of the program. The resources of a program's uniform block interface consists of the set of uniform blocks with at least one member used by any shader in the program.
Requires OpenGL 2.. Promoted to core in OpenGL 4..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_ACTIVE_RESOURCES
Accepted by the |
| public static final int | GL_ACTIVE_VARIABLES
Accepted in the |
| public static final int | GL_ARRAY_SIZE
Accepted in the |
| public static final int | GL_ARRAY_STRIDE
Accepted in the |
| public static final int | GL_ATOMIC_COUNTER_BUFFER_INDEX
Accepted in the |
| public static final int | GL_BLOCK_INDEX
Accepted in the |
| public static final int | GL_BUFFER_BINDING
Accepted in the |
| public static final int | GL_BUFFER_DATA_SIZE
Accepted in the |
| public static final int | GL_BUFFER_VARIABLE
Accepted by the |
| public static final int | GL_COMPUTE_SUBROUTINE
Accepted by the |
| public static final int | GL_COMPUTE_SUBROUTINE_UNIFORM
Accepted by the |
| public static final int | GL_FRAGMENT_SUBROUTINE
Accepted by the |
| public static final int | GL_FRAGMENT_SUBROUTINE_UNIFORM
Accepted by the |
| public static final int | GL_GEOMETRY_SUBROUTINE
Accepted by the |
| public static final int | GL_GEOMETRY_SUBROUTINE_UNIFORM
Accepted by the |
| public static final int | GL_IS_PER_PATCH
Accepted in the |
| public static final int | GL_IS_ROW_MAJOR
Accepted in the |
| public static final int | GL_LOCATION
Accepted in the |
| public static final int | GL_LOCATION_INDEX
Accepted in the |
| public static final int | GL_MATRIX_STRIDE
Accepted in the |
| public static final int | GL_MAX_NAME_LENGTH
Accepted by the |
| public static final int | GL_MAX_NUM_ACTIVE_VARIABLES
Accepted by the |
| public static final int | GL_MAX_NUM_COMPATIBLE_SUBROUTINES
Accepted by the |
| public static final int | GL_NAME_LENGTH
Accepted in the |
| public static final int | GL_NUM_ACTIVE_VARIABLES
Accepted in the |
| public static final int | GL_OFFSET
Accepted in the |
| public static final int | GL_PROGRAM_INPUT
Accepted by the |
| public static final int | GL_PROGRAM_OUTPUT
Accepted by the |
| public static final int | GL_REFERENCED_BY_COMPUTE_SHADER
Accepted in the |
| public static final int | GL_REFERENCED_BY_FRAGMENT_SHADER
Accepted in the |
| public static final int | GL_REFERENCED_BY_GEOMETRY_SHADER
Accepted in the |
| public static final int | GL_REFERENCED_BY_TESS_CONTROL_SHADER
Accepted in the |
| public static final int | GL_REFERENCED_BY_TESS_EVALUATION_SHADER
Accepted in the |
| public static final int | GL_REFERENCED_BY_VERTEX_SHADER
Accepted in the |
| public static final int | GL_SHADER_STORAGE_BLOCK
Accepted by the |
| public static final int | GL_TESS_CONTROL_SUBROUTINE
Accepted by the |
| public static final int | GL_TESS_CONTROL_SUBROUTINE_UNIFORM
Accepted by the |
| public static final int | GL_TESS_EVALUATION_SUBROUTINE
Accepted by the |
| public static final int | GL_TESS_EVALUATION_SUBROUTINE_UNIFORM
Accepted by the |
| public static final int | GL_TOP_LEVEL_ARRAY_SIZE
Accepted in the |
| public static final int | GL_TOP_LEVEL_ARRAY_STRIDE
Accepted in the |
| public static final int | GL_TRANSFORM_FEEDBACK_VARYING
Accepted by the |
| public static final int | GL_TYPE
Accepted in the |
| public static final int | GL_UNIFORM
Accepted by the |
| public static final int | GL_UNIFORM_BLOCK
Accepted by the |
| public static final int | GL_VERTEX_SUBROUTINE
Accepted by the |
| public static final int | GL_VERTEX_SUBROUTINE_UNIFORM
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||||
|---|---|---|---|---|---|
| public static int | glGetProgramInterfacei(int
the name of a program object whose interface to query program, int a token identifying the interface within programInterface, int program to query. One of:the name of the parameter within pname)programInterface to query. One of:
Queries a property of an interface in a program. | ||||
| public static void | glGetProgramInterfaceiv(int
the name of a program object whose interface to query program, int a token identifying the interface within programInterface, int program to query. One of:the name of the parameter within pname, IntBuffer programInterface to query. One of:
a variable to retrieve the value of params)pname for the program interfaceQueries a property of an interface in a program. | ||||
| public static void | glGetProgramInterfaceiv(int program, int programInterface, int pname, int[] params)
Array version of: | ||||
| public static int | glGetProgramResourceIndex(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, ByteBuffer program containing the resource named {Wcode name}. One of:the name of the resource to query the index of name)Queries the index of a named resource within a program. | ||||
| public static int | glGetProgramResourceIndex(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, CharSequence program containing the resource named {Wcode name}. One of:the name of the resource to query the index of name)Queries the index of a named resource within a program. | ||||
| public static void | glGetProgramResourceiv(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, int program containing the resource named name. One of:the active resource index index, IntBuffer an array that will receive the active resource properties props, IntBuffer a variable which will receive the number of values returned length, IntBuffer an array that will receive the property values params)Retrieves values for multiple properties of a single active resource within a program object. | ||||
| public static void | glGetProgramResourceiv(int program, int programInterface, int index, int[] props, int[] length, int[] params)
Array version of: | ||||
| public static int | glGetProgramResourceLocation(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, ByteBuffer program containing the resource named namethe name of the resource to query the location of name)Queries the location of a named resource within a program. | ||||
| public static int | glGetProgramResourceLocation(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, CharSequence program containing the resource named namethe name of the resource to query the location of name)Queries the location of a named resource within a program. | ||||
| public static int | glGetProgramResourceLocationIndex(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, ByteBuffer program containing the resource named name. Must be:
the name of the resource to query the location of name)Queries the fragment color index of a named variable within a program. | ||||
| public static int | glGetProgramResourceLocationIndex(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, CharSequence program containing the resource named name. Must be:
the name of the resource to query the location of name)Queries the fragment color index of a named variable within a program. | ||||
| public static void | glGetProgramResourceName(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, int program containing the indexed resource. One of:the index of the resource within index, IntBuffer programInterface of programa variable which will receive the length of the resource name length, ByteBuffer a character array into which will be written the name of the resource name)Queries the name of an indexed resource within a program. | ||||
| public static String | glGetProgramResourceName(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, int program containing the indexed resource. One of:the index of the resource within index, int programInterface of programthe size of the character array whose address is given by bufSize)nameQueries the name of an indexed resource within a program. | ||||
| public static String | glGetProgramResourceName(int
the name of a program object whose resources to query program, int a token identifying the interface within programInterface, int program containing the indexed resource. One of:the index of the resource within index)programInterface of programQueries the name of an indexed resource within a program. | ||||
| public static void | glGetProgramResourceName(int program, int programInterface, int index, int[] length, ByteBuffer name)
Array version of: | ||||
| public static void | nglGetProgramInterfaceiv(int program, int programInterface, int pname, long params)
Unsafe version of: | ||||
| public static int | nglGetProgramResourceIndex(int program, int programInterface, long name)
Unsafe version of: | ||||
| public static void | nglGetProgramResourceiv(int program, int programInterface, int index, int
the number of properties in propCount, long props, int propsthe size of the integer array whose address is given by bufSize, long length, long params)paramsUnsafe version of: | ||||
| public static int | nglGetProgramResourceLocation(int program, int programInterface, long name)
Unsafe version of: | ||||
| public static int | nglGetProgramResourceLocationIndex(int program, int programInterface, long name)
Unsafe version of: | ||||
| public static void | nglGetProgramResourceName(int program, int programInterface, int index, int
the size of the character array whose address is given by bufSize, long length, long name)nameUnsafe version of: |