Class ShaderSubroutine
Represents a shader subroutine parameter. Allows selection of subroutine implementations for vertex or fragment shaders.
Constructors
| Name | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
_name
|
dlib | Parameter name. |
index
|
uint | Subroutine index. |
location
|
int | Subroutine location and index. |
shaderType
|
ShaderType | Shader type. |
subroutineName
|
dlib | Subroutine name. |
autoBind
|
bool | Whether to automatically bind the parameter when the shader is bound. |
name
|
string | Parameter name. |
shader
|
Shader | Owning shader. |
Methods
| Name | Description |
|---|---|
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). |