This extension adds support to shaders for "indirect subroutine calls", where a single shader can include many subroutines and dynamically select through the API which subroutine is called from each call site. Switching subroutines dynamically in this fashion can avoid the cost of recompiling and managing multiple shaders, while still retaining most of the performance of specialized shaders.
Requires ARB_gpu_shader5. Promoted to core in OpenGL 4..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_ACTIVE_SUBROUTINE_MAX_LENGTH
Accepted by the |
| public static final int | GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
Accepted by the |
| public static final int | GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
Accepted by the |
| public static final int | GL_ACTIVE_SUBROUTINE_UNIFORMS
Accepted by the |
| public static final int | GL_ACTIVE_SUBROUTINES
Accepted by the |
| public static final int | GL_COMPATIBLE_SUBROUTINES
Accepted by the |
| public static final int | GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS
Accepted by the |
| public static final int | GL_MAX_SUBROUTINES
Accepted by the |
| public static final int | GL_NUM_COMPATIBLE_SUBROUTINES
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void | glGetActiveSubroutineName(int
the name of the program containing the subroutine program, int the shader stage from which to query the subroutine name. One of: shadertype, int
the index of the shader subroutine uniform index, IntBuffer a variable which is to receive the length of the shader subroutine uniform name length, ByteBuffer an array into which the name of the shader subroutine uniform will be written name)Queries the name of an active shader subroutine. | ||||||||||
| public static String | glGetActiveSubroutineName(int
the name of the program containing the subroutine program, int the shader stage from which to query the subroutine name. One of: shadertype, int
the index of the shader subroutine uniform index, int the size of the buffer whose address is given in bufsize)nameQueries the name of an active shader subroutine. | ||||||||||
| public static String | glGetActiveSubroutineName(int
the name of the program containing the subroutine program, int the shader stage from which to query the subroutine name. One of: shadertype, int
the index of the shader subroutine uniform index)Queries the name of an active shader subroutine. | ||||||||||
| public static void | glGetActiveSubroutineName(int program, int shadertype, int index, int[] length, ByteBuffer name)
Array version of: | ||||||||||
| public static int | glGetActiveSubroutineUniformi(int
the name of the program containing the subroutine program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the index of the shader subroutine uniform index, int the parameter of the shader subroutine uniform to query. One of: pname)
Queries a property of an active shader subroutine uniform. | ||||||||||
| public static void | glGetActiveSubroutineUniformiv(int
the name of the program containing the subroutine program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the index of the shader subroutine uniform index, int the parameter of the shader subroutine uniform to query. One of: pname, IntBuffer
the address of a buffer into which the queried value or values will be placed values)Queries a property of an active shader subroutine uniform. | ||||||||||
| public static void | glGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, int[] values)
Array version of: | ||||||||||
| public static void | glGetActiveSubroutineUniformName(int
the name of the program containing the subroutine program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the index of the shader subroutine uniform index, IntBuffer the address of a variable into which is written the number of characters copied into length, ByteBuffer namethe address of a buffer that will receive the name of the specified shader subroutine uniform name)Queries the name of an active shader subroutine uniform. | ||||||||||
| public static String | glGetActiveSubroutineUniformName(int
the name of the program containing the subroutine program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the index of the shader subroutine uniform index, int the size of the buffer whose address is given in bufsize)nameQueries the name of an active shader subroutine uniform. | ||||||||||
| public static String | glGetActiveSubroutineUniformName(int
the name of the program containing the subroutine program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the index of the shader subroutine uniform index)Queries the name of an active shader subroutine uniform. | ||||||||||
| public static void | glGetActiveSubroutineUniformName(int program, int shadertype, int index, int[] length, ByteBuffer name)
Array version of: | ||||||||||
| public static int | glGetProgramStagei(int
the name of the program containing shader stage program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the parameter of the shader to query. One of: pname)
Retrieves properties of a program object corresponding to a specified shader stage. | ||||||||||
| public static void | glGetProgramStageiv(int
the name of the program containing shader stage program, int the shader stage from which to query for the subroutine parameter. One of: shadertype, int
the parameter of the shader to query. One of: pname, IntBuffer
a variable into which the queried value or values will be placed values)Retrieves properties of a program object corresponding to a specified shader stage. | ||||||||||
| public static void | glGetProgramStageiv(int program, int shadertype, int pname, int[] values)
Array version of: | ||||||||||
| public static int | glGetSubroutineIndex(int
the name of the program containing shader stage program, int the shader stage from which to query for subroutine function index. One of: shadertype, ByteBuffer
the name of the subroutine function whose index to query name)Retrieves the index of a subroutine function of a given shader stage within a program. | ||||||||||
| public static int | glGetSubroutineIndex(int
the name of the program containing shader stage program, int the shader stage from which to query for subroutine function index. One of: shadertype, CharSequence
the name of the subroutine function whose index to query name)Retrieves the index of a subroutine function of a given shader stage within a program. | ||||||||||
| public static int | glGetSubroutineUniformLocation(int
the name of the program containing shader stage program, int the shader stage from which to query for subroutine uniform index. One of: shadertype, ByteBuffer
the name of the subroutine uniform whose index to query. name)Retrieves the location of a subroutine uniform of a given shader stage within a program. | ||||||||||
| public static int | glGetSubroutineUniformLocation(int
the name of the program containing shader stage program, int the shader stage from which to query for subroutine uniform index. One of: shadertype, CharSequence
the name of the subroutine uniform whose index to query. name)Retrieves the location of a subroutine uniform of a given shader stage within a program. | ||||||||||
| public static int | glGetUniformSubroutineui(int
the shader stage from which to query for subroutine uniform index. One of: shadertype, int
the location of the subroutine uniform location)Retrieves the value of a subroutine uniform of a given shader stage of the current program. | ||||||||||
| public static void | glGetUniformSubroutineuiv(int
the shader stage from which to query for subroutine uniform index. One of: shadertype, int
the location of the subroutine uniform location, IntBuffer a variable to receive the value or values of the subroutine uniform params)Retrieves the value of a subroutine uniform of a given shader stage of the current program. | ||||||||||
| public static void | glGetUniformSubroutineuiv(int shadertype, int location, int[] params)
Array version of: | ||||||||||
| public static void | glUniformSubroutinesui(int
the shader stage to update. One of: shadertype, int index)
Loads active subroutine uniforms. | ||||||||||
| public static void | glUniformSubroutinesuiv(int
the shader stage to update. One of: shadertype, IntBuffer
an array holding the indices to load into the shader subroutine variables indices)Loads active subroutine uniforms. | ||||||||||
| public static void | |||||||||||
| public static void | nglGetActiveSubroutineName(int program, int shadertype, int index, int
the size of the buffer whose address is given in bufsize, long length, long name)nameUnsafe version of: | ||||||||||
| public static void | nglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, long values)
Unsafe version of: | ||||||||||
| public static void | nglGetActiveSubroutineUniformName(int program, int shadertype, int index, int
the size of the buffer whose address is given in bufsize, long length, long name)nameUnsafe version of: | ||||||||||
| public static void | nglGetProgramStageiv(int program, int shadertype, int pname, long values)
Unsafe version of: | ||||||||||
| public static int | |||||||||||
| public static int | nglGetSubroutineUniformLocation(int program, int shadertype, long name)
Unsafe version of: | ||||||||||
| public static void | nglGetUniformSubroutineuiv(int shadertype, int location, long params)
Unsafe version of: | ||||||||||
| public static void | nglUniformSubroutinesuiv(int shadertype, int
the number of uniform indices stored in count, long indices)indicesUnsafe version of: |
| GL_ACTIVE_SUBROUTINE_MAX_LENGTH | back to summary |
|---|---|
| public static final int GL_ACTIVE_SUBROUTINE_MAX_LENGTH Accepted by the | |
| GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS | back to summary |
|---|---|
| public static final int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS Accepted by the | |
| GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH | back to summary |
|---|---|
| public static final int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH Accepted by the | |
| GL_ACTIVE_SUBROUTINE_UNIFORMS | back to summary |
|---|---|
| public static final int GL_ACTIVE_SUBROUTINE_UNIFORMS Accepted by the | |
| GL_ACTIVE_SUBROUTINES | back to summary |
|---|---|
| public static final int GL_ACTIVE_SUBROUTINES Accepted by the | |
| GL_COMPATIBLE_SUBROUTINES | back to summary |
|---|---|
| public static final int GL_COMPATIBLE_SUBROUTINES Accepted by the | |
| GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS | back to summary |
|---|---|
| public static final int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS Accepted by the | |
| GL_MAX_SUBROUTINES | back to summary |
|---|---|
| public static final int GL_MAX_SUBROUTINES Accepted by the | |
| GL_NUM_COMPATIBLE_SUBROUTINES | back to summary |
|---|---|
| public static final int GL_NUM_COMPATIBLE_SUBROUTINES Accepted by the | |
| ARBShaderSubroutine | back to summary |
|---|---|
| protected ARBShaderSubroutine() | |
| glGetActiveSubroutineName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static void glGetActiveSubroutineName(int program, int shadertype, int index, IntBuffer length, ByteBuffer name) Queries the name of an active shader subroutine.
| ||||||
| glGetActiveSubroutineName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static String glGetActiveSubroutineName(int program, int shadertype, int index, int bufsize) Queries the name of an active shader subroutine.
| ||||||
| glGetActiveSubroutineName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static String glGetActiveSubroutineName(int program, int shadertype, int index) Queries the name of an active shader subroutine.
| ||||||
| glGetActiveSubroutineName | back to summary |
|---|---|
| public static void glGetActiveSubroutineName(int program, int shadertype, int index, int[] length, ByteBuffer name) Array version of: | |
| glGetActiveSubroutineUniformi | back to summary | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| public static int glGetActiveSubroutineUniformi(int program, int shadertype, int index, int pname) Queries a property of an active shader subroutine uniform.
| ||||||||||
| glGetActiveSubroutineUniformiv | back to summary | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| public static void glGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, IntBuffer values) Queries a property of an active shader subroutine uniform.
| ||||||||||
| glGetActiveSubroutineUniformiv | back to summary |
|---|---|
| public static void glGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, int[] values) Array version of: | |
| glGetActiveSubroutineUniformName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static void glGetActiveSubroutineUniformName(int program, int shadertype, int index, IntBuffer length, ByteBuffer name) Queries the name of an active shader subroutine uniform.
| ||||||
| glGetActiveSubroutineUniformName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static String glGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize) Queries the name of an active shader subroutine uniform.
| ||||||
| glGetActiveSubroutineUniformName | back to summary | |||||
|---|---|---|---|---|---|---|
| public static String glGetActiveSubroutineUniformName(int program, int shadertype, int index) Queries the name of an active shader subroutine uniform.
| ||||||
| glGetActiveSubroutineUniformName | back to summary |
|---|---|
| public static void glGetActiveSubroutineUniformName(int program, int shadertype, int index, int[] length, ByteBuffer name) Array version of: | |
| glGetProgramStagei | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static int glGetProgramStagei(int program, int shadertype, int pname) Retrieves properties of a program object corresponding to a specified shader stage.
| |||||||||||
| glGetProgramStageiv | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void glGetProgramStageiv(int program, int shadertype, int pname, IntBuffer values) Retrieves properties of a program object corresponding to a specified shader stage.
| |||||||||||
| glGetProgramStageiv | back to summary |
|---|---|
| public static void glGetProgramStageiv(int program, int shadertype, int pname, int[] values) Array version of: | |
| glGetSubroutineIndex | back to summary | |||||
|---|---|---|---|---|---|---|
| public static int glGetSubroutineIndex(int program, int shadertype, ByteBuffer name) Retrieves the index of a subroutine function of a given shader stage within a program.
| ||||||
| glGetSubroutineIndex | back to summary | |||||
|---|---|---|---|---|---|---|
| public static int glGetSubroutineIndex(int program, int shadertype, CharSequence name) Retrieves the index of a subroutine function of a given shader stage within a program.
| ||||||
| glGetSubroutineUniformLocation | back to summary | |||||
|---|---|---|---|---|---|---|
| public static int glGetSubroutineUniformLocation(int program, int shadertype, ByteBuffer name) Retrieves the location of a subroutine uniform of a given shader stage within a program.
| ||||||
| glGetSubroutineUniformLocation | back to summary | |||||
|---|---|---|---|---|---|---|
| public static int glGetSubroutineUniformLocation(int program, int shadertype, CharSequence name) Retrieves the location of a subroutine uniform of a given shader stage within a program.
| ||||||
| glGetUniformSubroutineui | back to summary | |||||
|---|---|---|---|---|---|---|
| public static int glGetUniformSubroutineui(int shadertype, int location) Retrieves the value of a subroutine uniform of a given shader stage of the current program.
| ||||||
| glGetUniformSubroutineuiv | back to summary | |||||
|---|---|---|---|---|---|---|
| public static void glGetUniformSubroutineuiv(int shadertype, int location, IntBuffer params) Retrieves the value of a subroutine uniform of a given shader stage of the current program.
| ||||||
| glGetUniformSubroutineuiv | back to summary |
|---|---|
| public static void glGetUniformSubroutineuiv(int shadertype, int location, int[] params) Array version of: | |
| glUniformSubroutinesui | back to summary | |||||
|---|---|---|---|---|---|---|
| public static void glUniformSubroutinesui(int shadertype, int index) Loads active subroutine uniforms.
| ||||||
| glUniformSubroutinesuiv | back to summary | |||||
|---|---|---|---|---|---|---|
| public static void glUniformSubroutinesuiv(int shadertype, IntBuffer indices) Loads active subroutine uniforms.
| ||||||
| glUniformSubroutinesuiv | back to summary |
|---|---|
| public static void glUniformSubroutinesuiv(int shadertype, int[] indices) Array version of: | |
| nglGetActiveSubroutineName | back to summary |
|---|---|
| public static void nglGetActiveSubroutineName(int program, int shadertype, int index, int bufsize, long length, long name) Unsafe version of:
| |
| nglGetActiveSubroutineUniformiv | back to summary |
|---|---|
| public static void nglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, long values) Unsafe version of: | |
| nglGetActiveSubroutineUniformName | back to summary |
|---|---|
| public static void nglGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize, long length, long name) Unsafe version of:
| |
| nglGetProgramStageiv | back to summary |
|---|---|
| public static void nglGetProgramStageiv(int program, int shadertype, int pname, long values) Unsafe version of: | |
| nglGetSubroutineIndex | back to summary |
|---|---|
| public static int nglGetSubroutineIndex(int program, int shadertype, long name) Unsafe version of: | |
| nglGetSubroutineUniformLocation | back to summary |
|---|---|
| public static int nglGetSubroutineUniformLocation(int program, int shadertype, long name) Unsafe version of: | |
| nglGetUniformSubroutineuiv | back to summary |
|---|---|
| public static void nglGetUniformSubroutineuiv(int shadertype, int location, long params) Unsafe version of: | |
| nglUniformSubroutinesuiv | back to summary |
|---|---|
| public static void nglUniformSubroutinesuiv(int shadertype, int count, long indices) Unsafe version of:
| |