public class ARBShaderSubroutine
extends java.lang.Object
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.0.
| Modifier and Type | Field and Description |
|---|---|
static int |
GL_ACTIVE_SUBROUTINE_MAX_LENGTH
Accepted by the
pname parameter of GetProgramStageiv. |
static int |
GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
Accepted by the
pname parameter of GetProgramStageiv. |
static int |
GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
Accepted by the
pname parameter of GetProgramStageiv. |
static int |
GL_ACTIVE_SUBROUTINE_UNIFORMS
Accepted by the
pname parameter of GetProgramStageiv. |
static int |
GL_ACTIVE_SUBROUTINES
Accepted by the
pname parameter of GetProgramStageiv. |
static int |
GL_COMPATIBLE_SUBROUTINES
Accepted by the
pname parameter of GetActiveSubroutineUniformiv. |
static int |
GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS
Accepted by the
pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. |
static int |
GL_MAX_SUBROUTINES
Accepted by the
pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. |
static int |
GL_NUM_COMPATIBLE_SUBROUTINES
Accepted by the
pname parameter of GetActiveSubroutineUniformiv. |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
glGetActiveSubroutineName(int program,
int shadertype,
int index)
Queries the name of an active shader subroutine.
|
static java.lang.String |
glGetActiveSubroutineName(int program,
int shadertype,
int index,
int bufsize)
Queries the name of an active shader subroutine.
|
static void |
glGetActiveSubroutineName(int program,
int shadertype,
int index,
int[] length,
java.nio.ByteBuffer name)
Array version of:
GetActiveSubroutineName |
static void |
glGetActiveSubroutineName(int program,
int shadertype,
int index,
java.nio.IntBuffer length,
java.nio.ByteBuffer name)
Queries the name of an active shader subroutine.
|
static int |
glGetActiveSubroutineUniformi(int program,
int shadertype,
int index,
int pname)
Queries a property of an active shader subroutine uniform.
|
static void |
glGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
int[] values)
Array version of:
GetActiveSubroutineUniformiv |
static void |
glGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
java.nio.IntBuffer values)
Queries a property of an active shader subroutine uniform.
|
static java.lang.String |
glGetActiveSubroutineUniformName(int program,
int shadertype,
int index)
Queries the name of an active shader subroutine uniform.
|
static java.lang.String |
glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
int bufsize)
Queries the name of an active shader subroutine uniform.
|
static void |
glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
int[] length,
java.nio.ByteBuffer name)
Array version of:
GetActiveSubroutineUniformName |
static void |
glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
java.nio.IntBuffer length,
java.nio.ByteBuffer name)
Queries the name of an active shader subroutine uniform.
|
static int |
glGetProgramStagei(int program,
int shadertype,
int pname)
Retrieves properties of a program object corresponding to a specified shader stage.
|
static void |
glGetProgramStageiv(int program,
int shadertype,
int pname,
int[] values)
Array version of:
GetProgramStageiv |
static void |
glGetProgramStageiv(int program,
int shadertype,
int pname,
java.nio.IntBuffer values)
Retrieves properties of a program object corresponding to a specified shader stage.
|
static int |
glGetSubroutineIndex(int program,
int shadertype,
java.nio.ByteBuffer name)
Retrieves the index of a subroutine function of a given shader stage within a program.
|
static int |
glGetSubroutineIndex(int program,
int shadertype,
java.lang.CharSequence name)
Retrieves the index of a subroutine function of a given shader stage within a program.
|
static int |
glGetSubroutineUniformLocation(int program,
int shadertype,
java.nio.ByteBuffer name)
Retrieves the location of a subroutine uniform of a given shader stage within a program.
|
static int |
glGetSubroutineUniformLocation(int program,
int shadertype,
java.lang.CharSequence name)
Retrieves the location of a subroutine uniform of a given shader stage within a program.
|
static int |
glGetUniformSubroutineui(int shadertype,
int location)
Retrieves the value of a subroutine uniform of a given shader stage of the current program.
|
static void |
glGetUniformSubroutineuiv(int shadertype,
int location,
int[] params)
Array version of:
GetUniformSubroutineuiv |
static void |
glGetUniformSubroutineuiv(int shadertype,
int location,
java.nio.IntBuffer params)
Retrieves the value of a subroutine uniform of a given shader stage of the current program.
|
static void |
glUniformSubroutinesui(int shadertype,
int index)
Loads active subroutine uniforms.
|
static void |
glUniformSubroutinesuiv(int shadertype,
int[] indices)
Array version of:
UniformSubroutinesuiv |
static void |
glUniformSubroutinesuiv(int shadertype,
java.nio.IntBuffer indices)
Loads active subroutine uniforms.
|
static void |
nglGetActiveSubroutineName(int program,
int shadertype,
int index,
int bufsize,
long length,
long name)
Unsafe version of:
GetActiveSubroutineName |
static void |
nglGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
long values)
Unsafe version of:
GetActiveSubroutineUniformiv |
static void |
nglGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
int bufsize,
long length,
long name)
Unsafe version of:
GetActiveSubroutineUniformName |
static void |
nglGetProgramStageiv(int program,
int shadertype,
int pname,
long values)
Unsafe version of:
GetProgramStageiv |
static int |
nglGetSubroutineIndex(int program,
int shadertype,
long name)
Unsafe version of:
GetSubroutineIndex |
static int |
nglGetSubroutineUniformLocation(int program,
int shadertype,
long name)
Unsafe version of:
GetSubroutineUniformLocation |
static void |
nglGetUniformSubroutineuiv(int shadertype,
int location,
long params)
Unsafe version of:
GetUniformSubroutineuiv |
static void |
nglUniformSubroutinesuiv(int shadertype,
int count,
long indices)
Unsafe version of:
UniformSubroutinesuiv |
public static final int GL_ACTIVE_SUBROUTINES
pname parameter of GetProgramStageiv.public static final int GL_ACTIVE_SUBROUTINE_UNIFORMS
pname parameter of GetProgramStageiv.public static final int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
pname parameter of GetProgramStageiv.public static final int GL_ACTIVE_SUBROUTINE_MAX_LENGTH
pname parameter of GetProgramStageiv.public static final int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
pname parameter of GetProgramStageiv.public static final int GL_MAX_SUBROUTINES
pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v.public static final int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS
pname parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v.public static final int GL_NUM_COMPATIBLE_SUBROUTINES
pname parameter of GetActiveSubroutineUniformiv.public static final int GL_COMPATIBLE_SUBROUTINES
pname parameter of GetActiveSubroutineUniformiv.public static int nglGetSubroutineUniformLocation(int program,
int shadertype,
long name)
GetSubroutineUniformLocationpublic static int glGetSubroutineUniformLocation(int program,
int shadertype,
java.nio.ByteBuffer name)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
name - the name of the subroutine uniform whose index to query.public static int glGetSubroutineUniformLocation(int program,
int shadertype,
java.lang.CharSequence name)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
name - the name of the subroutine uniform whose index to query.public static int nglGetSubroutineIndex(int program,
int shadertype,
long name)
GetSubroutineIndexpublic static int glGetSubroutineIndex(int program,
int shadertype,
java.nio.ByteBuffer name)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for subroutine function index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
name - the name of the subroutine function whose index to querypublic static int glGetSubroutineIndex(int program,
int shadertype,
java.lang.CharSequence name)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for subroutine function index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
name - the name of the subroutine function whose index to querypublic static void nglGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
long values)
GetActiveSubroutineUniformivpublic static void glGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
java.nio.IntBuffer values)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformpname - the parameter of the shader subroutine uniform to query. One of:NUM_COMPATIBLE_SUBROUTINES | COMPATIBLE_SUBROUTINES | UNIFORM_SIZE | UNIFORM_NAME_LENGTH |
values - the address of a buffer into which the queried value or values will be placedpublic static int glGetActiveSubroutineUniformi(int program,
int shadertype,
int index,
int pname)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformpname - the parameter of the shader subroutine uniform to query. One of:NUM_COMPATIBLE_SUBROUTINES | COMPATIBLE_SUBROUTINES | UNIFORM_SIZE | UNIFORM_NAME_LENGTH |
public static void nglGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
int bufsize,
long length,
long name)
GetActiveSubroutineUniformNamebufsize - the size of the buffer whose address is given in namepublic static void glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
@Nullable
java.nio.IntBuffer length,
java.nio.ByteBuffer name)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformlength - the address of a variable into which is written the number of characters copied into namename - the address of a buffer that will receive the name of the specified shader subroutine uniformpublic static java.lang.String glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
int bufsize)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformbufsize - the size of the buffer whose address is given in namepublic static java.lang.String glGetActiveSubroutineUniformName(int program,
int shadertype,
int index)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformpublic static void nglGetActiveSubroutineName(int program,
int shadertype,
int index,
int bufsize,
long length,
long name)
GetActiveSubroutineNamebufsize - the size of the buffer whose address is given in namepublic static void glGetActiveSubroutineName(int program,
int shadertype,
int index,
@Nullable
java.nio.IntBuffer length,
java.nio.ByteBuffer name)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query the subroutine name. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformlength - a variable which is to receive the length of the shader subroutine uniform namename - an array into which the name of the shader subroutine uniform will be writtenpublic static java.lang.String glGetActiveSubroutineName(int program,
int shadertype,
int index,
int bufsize)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query the subroutine name. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformbufsize - the size of the buffer whose address is given in namepublic static java.lang.String glGetActiveSubroutineName(int program,
int shadertype,
int index)
program - the name of the program containing the subroutineshadertype - the shader stage from which to query the subroutine name. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
index - the index of the shader subroutine uniformpublic static void nglUniformSubroutinesuiv(int shadertype,
int count,
long indices)
UniformSubroutinesuivcount - the number of uniform indices stored in indicespublic static void glUniformSubroutinesuiv(int shadertype,
java.nio.IntBuffer indices)
shadertype - the shader stage to update. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
indices - an array holding the indices to load into the shader subroutine variablespublic static void glUniformSubroutinesui(int shadertype,
int index)
shadertype - the shader stage to update. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
public static void nglGetUniformSubroutineuiv(int shadertype,
int location,
long params)
GetUniformSubroutineuivpublic static void glGetUniformSubroutineuiv(int shadertype,
int location,
java.nio.IntBuffer params)
shadertype - the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
location - the location of the subroutine uniformparams - a variable to receive the value or values of the subroutine uniformpublic static int glGetUniformSubroutineui(int shadertype,
int location)
shadertype - the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
location - the location of the subroutine uniformpublic static void nglGetProgramStageiv(int program,
int shadertype,
int pname,
long values)
GetProgramStageivpublic static void glGetProgramStageiv(int program,
int shadertype,
int pname,
java.nio.IntBuffer values)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
pname - the parameter of the shader to query. One of:ACTIVE_SUBROUTINES | ACTIVE_SUBROUTINE_UNIFORMS |
ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS | ACTIVE_SUBROUTINE_MAX_LENGTH |
ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH |
values - a variable into which the queried value or values will be placedpublic static int glGetProgramStagei(int program,
int shadertype,
int pname)
program - the name of the program containing shader stageshadertype - the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADER | FRAGMENT_SHADER | GEOMETRY_SHADER | TESS_CONTROL_SHADER |
TESS_EVALUATION_SHADER |
pname - the parameter of the shader to query. One of:ACTIVE_SUBROUTINES | ACTIVE_SUBROUTINE_UNIFORMS |
ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS | ACTIVE_SUBROUTINE_MAX_LENGTH |
ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH |
public static void glGetActiveSubroutineUniformiv(int program,
int shadertype,
int index,
int pname,
int[] values)
GetActiveSubroutineUniformivpublic static void glGetActiveSubroutineUniformName(int program,
int shadertype,
int index,
@Nullable
int[] length,
java.nio.ByteBuffer name)
GetActiveSubroutineUniformNamepublic static void glGetActiveSubroutineName(int program,
int shadertype,
int index,
@Nullable
int[] length,
java.nio.ByteBuffer name)
GetActiveSubroutineNamepublic static void glUniformSubroutinesuiv(int shadertype,
int[] indices)
UniformSubroutinesuivpublic static void glGetUniformSubroutineuiv(int shadertype,
int location,
int[] params)
GetUniformSubroutineuivpublic static void glGetProgramStageiv(int program,
int shadertype,
int pname,
int[] values)
GetProgramStageivCopyright LWJGL. All Rights Reserved. License terms.