Class ShaderSubroutine

Represents a shader subroutine parameter. Allows selection of subroutine implementations for vertex or fragment shaders.

class ShaderSubroutine
  : BaseShaderParameter;

Constructors

NameDescription
this (shader, shaderType, name) Creates a subroutine parameter for the given shader and type.
this (shader, shaderType, name, subroutineName) Creates a subroutine parameter with a specific subroutine name.

Fields

NameTypeDescription
_name dlib.text.str.StringParameter name.
index uintSubroutine index.
location intSubroutine location and index.
shaderType ShaderTypeShader type.
subroutineName dlib.text.str.StringSubroutine name.
autoBind boolWhether to automatically bind the parameter when the shader is bound.
name stringParameter name.
shader ShaderOwning shader.

Methods

NameDescription
bind () Binds the subroutine.
getIndex (subrName) Gets the subroutine index for a given name.
initUniform () Initializes the uniform location.
unbind () Unbinds the subroutine (no-op).