Package org.lwjgl.opengl
Class ARBShaderSubroutine
- java.lang.Object
-
- org.lwjgl.opengl.ARBShaderSubroutine
-
public class ARBShaderSubroutine extends java.lang.ObjectNative bindings to the ARB_shader_subroutine extension.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 inOpenGL 4.0.
-
-
Field Summary
Fields Modifier and Type Field and Description static intGL_ACTIVE_SUBROUTINE_MAX_LENGTH
GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS
GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
GL_ACTIVE_SUBROUTINE_UNIFORMS
GL_ACTIVE_SUBROUTINESAccepted by thepnameparameter of GetProgramStageiv.static intGL_COMPATIBLE_SUBROUTINESAccepted by thepnameparameter of GetActiveSubroutineUniformiv.static intGL_MAX_SUBROUTINE_UNIFORM_LOCATIONS
GL_MAX_SUBROUTINESAccepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v.static intGL_NUM_COMPATIBLE_SUBROUTINESAccepted by thepnameparameter of GetActiveSubroutineUniformiv.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringglGetActiveSubroutineName(int program, int shadertype, int index)Queries the name of an active shader subroutine.static java.lang.StringglGetActiveSubroutineName(int program, int shadertype, int index, int bufsize)Queries the name of an active shader subroutine.static voidglGetActiveSubroutineName(int program, int shadertype, int index, int[] length, java.nio.ByteBuffer name)Array version of:GetActiveSubroutineNamestatic voidglGetActiveSubroutineName(int program, int shadertype, int index, java.nio.IntBuffer length, java.nio.ByteBuffer name)Queries the name of an active shader subroutine.static intglGetActiveSubroutineUniformi(int program, int shadertype, int index, int pname)Queries a property of an active shader subroutine uniform.static voidglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, int[] values)Array version of:GetActiveSubroutineUniformivstatic voidglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, java.nio.IntBuffer values)Queries a property of an active shader subroutine uniform.static java.lang.StringglGetActiveSubroutineUniformName(int program, int shadertype, int index)Queries the name of an active shader subroutine uniform.static java.lang.StringglGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize)Queries the name of an active shader subroutine uniform.static voidglGetActiveSubroutineUniformName(int program, int shadertype, int index, int[] length, java.nio.ByteBuffer name)Array version of:GetActiveSubroutineUniformNamestatic voidglGetActiveSubroutineUniformName(int program, int shadertype, int index, java.nio.IntBuffer length, java.nio.ByteBuffer name)Queries the name of an active shader subroutine uniform.static intglGetProgramStagei(int program, int shadertype, int pname)Retrieves properties of a program object corresponding to a specified shader stage.static voidglGetProgramStageiv(int program, int shadertype, int pname, int[] values)Array version of:GetProgramStageivstatic voidglGetProgramStageiv(int program, int shadertype, int pname, java.nio.IntBuffer values)Retrieves properties of a program object corresponding to a specified shader stage.static intglGetSubroutineIndex(int program, int shadertype, java.nio.ByteBuffer name)Retrieves the index of a subroutine function of a given shader stage within a program.static intglGetSubroutineIndex(int program, int shadertype, java.lang.CharSequence name)Retrieves the index of a subroutine function of a given shader stage within a program.static intglGetSubroutineUniformLocation(int program, int shadertype, java.nio.ByteBuffer name)Retrieves the location of a subroutine uniform of a given shader stage within a program.static intglGetSubroutineUniformLocation(int program, int shadertype, java.lang.CharSequence name)Retrieves the location of a subroutine uniform of a given shader stage within a program.static intglGetUniformSubroutineui(int shadertype, int location)Retrieves the value of a subroutine uniform of a given shader stage of the current program.static voidglGetUniformSubroutineuiv(int shadertype, int location, int[] params)Array version of:GetUniformSubroutineuivstatic voidglGetUniformSubroutineuiv(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 voidglUniformSubroutinesui(int shadertype, int index)Loads active subroutine uniforms.static voidglUniformSubroutinesuiv(int shadertype, int[] indices)Array version of:UniformSubroutinesuivstatic voidglUniformSubroutinesuiv(int shadertype, java.nio.IntBuffer indices)Loads active subroutine uniforms.
-
-
-
Field Detail
-
GL_ACTIVE_SUBROUTINES, GL_ACTIVE_SUBROUTINE_UNIFORMS, GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS, GL_ACTIVE_SUBROUTINE_MAX_LENGTH, GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
Accepted by thepnameparameter of GetProgramStageiv.
-
GL_MAX_SUBROUTINES, GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS
Accepted by thepnameparameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v.
-
GL_NUM_COMPATIBLE_SUBROUTINES, GL_COMPATIBLE_SUBROUTINES
Accepted by thepnameparameter of GetActiveSubroutineUniformiv.
-
-
Method Detail
-
glGetSubroutineUniformLocation
public static int glGetSubroutineUniformLocation(int program, int shadertype, java.nio.ByteBuffer name) public 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.- Parameters:
program- the name of the program containing shader stageshadertype- the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERname- the name of the subroutine uniform whose index to query.
-
glGetSubroutineIndex
public static int glGetSubroutineIndex(int program, int shadertype, java.nio.ByteBuffer name) public 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.- Parameters:
program- the name of the program containing shader stageshadertype- the shader stage from which to query for subroutine function index. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERname- the name of the subroutine function whose index to query
-
glGetActiveSubroutineUniformiv
public static void glGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, java.nio.IntBuffer values)Queries a property of an active shader subroutine uniform.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniformpname- the parameter of the shader subroutine uniform to query. One of:NUM_COMPATIBLE_SUBROUTINESCOMPATIBLE_SUBROUTINESUNIFORM_SIZEUNIFORM_NAME_LENGTHvalues- the address of a buffer into which the queried value or values will be placed
-
glGetActiveSubroutineUniformi
public static int glGetActiveSubroutineUniformi(int program, int shadertype, int index, int pname)Queries a property of an active shader subroutine uniform.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniformpname- the parameter of the shader subroutine uniform to query. One of:NUM_COMPATIBLE_SUBROUTINESCOMPATIBLE_SUBROUTINESUNIFORM_SIZEUNIFORM_NAME_LENGTH
-
glGetActiveSubroutineUniformName
public 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.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniformlength- the address of a variable into which is written the number of characters copied intonamename- the address of a buffer that will receive the name of the specified shader subroutine uniform
-
glGetActiveSubroutineUniformName
public static java.lang.String glGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize)Queries the name of an active shader subroutine uniform.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniformbufsize- the size of the buffer whose address is given inname
-
glGetActiveSubroutineUniformName
public static java.lang.String glGetActiveSubroutineUniformName(int program, int shadertype, int index)Queries the name of an active shader subroutine uniform.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniform
-
glGetActiveSubroutineName
public 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.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query the subroutine name. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- 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 written
-
glGetActiveSubroutineName
public static java.lang.String glGetActiveSubroutineName(int program, int shadertype, int index, int bufsize)Queries the name of an active shader subroutine.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query the subroutine name. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniformbufsize- the size of the buffer whose address is given inname
-
glGetActiveSubroutineName
public static java.lang.String glGetActiveSubroutineName(int program, int shadertype, int index)Queries the name of an active shader subroutine.- Parameters:
program- the name of the program containing the subroutineshadertype- the shader stage from which to query the subroutine name. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindex- the index of the shader subroutine uniform
-
glUniformSubroutinesuiv
public static void glUniformSubroutinesuiv(int shadertype, java.nio.IntBuffer indices)Loads active subroutine uniforms.- Parameters:
shadertype- the shader stage to update. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERindices- an array holding the indices to load into the shader subroutine variables
-
glUniformSubroutinesui
public static void glUniformSubroutinesui(int shadertype, int index)Loads active subroutine uniforms.- Parameters:
shadertype- the shader stage to update. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADER
-
glGetUniformSubroutineuiv
public 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.- Parameters:
shadertype- the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERlocation- the location of the subroutine uniformparams- a variable to receive the value or values of the subroutine uniform
-
glGetUniformSubroutineui
public static int glGetUniformSubroutineui(int shadertype, int location)Retrieves the value of a subroutine uniform of a given shader stage of the current program.- Parameters:
shadertype- the shader stage from which to query for subroutine uniform index. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERlocation- the location of the subroutine uniform
-
glGetProgramStageiv
public 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.- Parameters:
program- the name of the program containing shader stageshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERpname- the parameter of the shader to query. One of:ACTIVE_SUBROUTINESACTIVE_SUBROUTINE_UNIFORMSACTIVE_SUBROUTINE_UNIFORM_LOCATIONSACTIVE_SUBROUTINE_MAX_LENGTHACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTHvalues- a variable into which the queried value or values will be placed
-
glGetProgramStagei
public static int glGetProgramStagei(int program, int shadertype, int pname)Retrieves properties of a program object corresponding to a specified shader stage.- Parameters:
program- the name of the program containing shader stageshadertype- the shader stage from which to query for the subroutine parameter. One of:VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADERTESS_EVALUATION_SHADERpname- the parameter of the shader to query. One of:ACTIVE_SUBROUTINESACTIVE_SUBROUTINE_UNIFORMSACTIVE_SUBROUTINE_UNIFORM_LOCATIONSACTIVE_SUBROUTINE_MAX_LENGTHACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
-
glGetActiveSubroutineUniformiv
public static void glGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, int[] values)Array version of:GetActiveSubroutineUniformiv
-
glGetActiveSubroutineUniformName
public static void glGetActiveSubroutineUniformName(int program, int shadertype, int index, int[] length, java.nio.ByteBuffer name)Array version of:GetActiveSubroutineUniformName
-
glGetActiveSubroutineName
public static void glGetActiveSubroutineName(int program, int shadertype, int index, int[] length, java.nio.ByteBuffer name)Array version of:GetActiveSubroutineName
-
glUniformSubroutinesuiv
public static void glUniformSubroutinesuiv(int shadertype, int[] indices)Array version of:UniformSubroutinesuiv
-
glGetUniformSubroutineuiv
public static void glGetUniformSubroutineuiv(int shadertype, int location, int[] params)Array version of:GetUniformSubroutineuiv
-
glGetProgramStageiv
public static void glGetProgramStageiv(int program, int shadertype, int pname, int[] values)Array version of:GetProgramStageiv
-
-