Class ARBShaderSubroutine


  • public class ARBShaderSubroutine
    extends java.lang.Object
    Native 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 in OpenGL 4.0.

    • Method Detail

      • nglGetSubroutineUniformLocation

        public static int nglGetSubroutineUniformLocation​(int program,
                                                          int shadertype,
                                                          long name)
        Unsafe version of: GetSubroutineUniformLocation
      • 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 stage
        shadertype - the shader stage from which to query for subroutine uniform index. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        name - the name of the subroutine uniform whose index to query.
      • nglGetSubroutineIndex

        public static int nglGetSubroutineIndex​(int program,
                                                int shadertype,
                                                long name)
        Unsafe version of: GetSubroutineIndex
      • 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 stage
        shadertype - the shader stage from which to query for subroutine function index. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        name - the name of the subroutine function whose index to query
      • nglGetActiveSubroutineUniformiv

        public static void nglGetActiveSubroutineUniformiv​(int program,
                                                           int shadertype,
                                                           int index,
                                                           int pname,
                                                           long values)
        Unsafe version of: GetActiveSubroutineUniformiv
      • nglGetActiveSubroutineUniformName

        public static void nglGetActiveSubroutineUniformName​(int program,
                                                             int shadertype,
                                                             int index,
                                                             int bufsize,
                                                             long length,
                                                             long name)
        Parameters:
        bufsize - the size of the buffer whose address is given in name
      • glGetActiveSubroutineUniformName

        public static void glGetActiveSubroutineUniformName​(int program,
                                                            int shadertype,
                                                            int index,
                                                            @Nullable
                                                            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 subroutine
        shadertype - the shader stage from which to query for the subroutine parameter. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
        length - the address of a variable into which is written the number of characters copied into name
        name - 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 subroutine
        shadertype - the shader stage from which to query for the subroutine parameter. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
        bufsize - the size of the buffer whose address is given in name
      • 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 subroutine
        shadertype - the shader stage from which to query for the subroutine parameter. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
      • nglGetActiveSubroutineName

        public static void nglGetActiveSubroutineName​(int program,
                                                      int shadertype,
                                                      int index,
                                                      int bufsize,
                                                      long length,
                                                      long name)
        Unsafe version of: GetActiveSubroutineName
        Parameters:
        bufsize - the size of the buffer whose address is given in name
      • glGetActiveSubroutineName

        public static void glGetActiveSubroutineName​(int program,
                                                     int shadertype,
                                                     int index,
                                                     @Nullable
                                                     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 subroutine
        shadertype - the shader stage from which to query the subroutine name. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
        length - a variable which is to receive the length of the shader subroutine uniform name
        name - 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 subroutine
        shadertype - the shader stage from which to query the subroutine name. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
        bufsize - the size of the buffer whose address is given in name
      • 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 subroutine
        shadertype - the shader stage from which to query the subroutine name. One of:
        VERTEX_SHADERFRAGMENT_SHADERGEOMETRY_SHADERTESS_CONTROL_SHADER
        TESS_EVALUATION_SHADER
        index - the index of the shader subroutine uniform
      • nglUniformSubroutinesuiv

        public static void nglUniformSubroutinesuiv​(int shadertype,
                                                    int count,
                                                    long indices)
        Unsafe version of: UniformSubroutinesuiv
        Parameters:
        count - the number of uniform indices stored in indices
      • nglGetUniformSubroutineuiv

        public static void nglGetUniformSubroutineuiv​(int shadertype,
                                                      int location,
                                                      long params)
        Unsafe version of: GetUniformSubroutineuiv
      • 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_SHADER
        TESS_EVALUATION_SHADER
        location - the location of the subroutine uniform
        params - 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_SHADER
        TESS_EVALUATION_SHADER
        location - the location of the subroutine uniform
      • nglGetProgramStageiv

        public static void nglGetProgramStageiv​(int program,
                                                int shadertype,
                                                int pname,
                                                long values)
        Unsafe version of: GetProgramStageiv
      • glGetActiveSubroutineUniformiv

        public static void glGetActiveSubroutineUniformiv​(int program,
                                                          int shadertype,
                                                          int index,
                                                          int pname,
                                                          int[] values)
      • glGetActiveSubroutineUniformName

        public static void glGetActiveSubroutineUniformName​(int program,
                                                            int shadertype,
                                                            int index,
                                                            @Nullable
                                                            int[] length,
                                                            java.nio.ByteBuffer name)
      • glGetActiveSubroutineName

        public static void glGetActiveSubroutineName​(int program,
                                                     int shadertype,
                                                     int index,
                                                     @Nullable
                                                     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