libctru
v2.4.1
|
Functions for working with shaders. More...
Go to the source code of this file.
Data Structures | |
struct | float24Uniform_s |
24-bit float uniforms. More... | |
struct | shaderInstance_s |
Describes an instance of either a vertex or geometry shader. More... | |
struct | shaderProgram_s |
Describes an instance of a full shader program. More... | |
Functions | |
Result | shaderInstanceInit (shaderInstance_s *si, DVLE_s *dvle) |
Initializes a shader instance. More... | |
Result | shaderInstanceFree (shaderInstance_s *si) |
Frees a shader instance. More... | |
Result | shaderInstanceSetBool (shaderInstance_s *si, int id, bool value) |
Sets a bool uniform of a shader. More... | |
Result | shaderInstanceGetBool (shaderInstance_s *si, int id, bool *value) |
Gets a bool uniform of a shader. More... | |
s8 | shaderInstanceGetUniformLocation (shaderInstance_s *si, const char *name) |
Gets the location of a shader's uniform. More... | |
Result | shaderProgramInit (shaderProgram_s *sp) |
Initializes a shader program. More... | |
Result | shaderProgramFree (shaderProgram_s *sp) |
Frees a shader program. More... | |
Result | shaderProgramSetVsh (shaderProgram_s *sp, DVLE_s *dvle) |
Sets the vertex shader of a shader program. More... | |
Result | shaderProgramSetGsh (shaderProgram_s *sp, DVLE_s *dvle, u8 stride) |
Sets the geometry shader of a shader program. More... | |
Result | shaderProgramSetGshInputPermutation (shaderProgram_s *sp, u64 permutation) |
Configures the permutation of the input attributes of the geometry shader of a shader program. More... | |
Result | shaderProgramConfigure (shaderProgram_s *sp, bool sendVshCode, bool sendGshCode) |
Configures the shader units to use the specified shader program. More... | |
Result | shaderProgramUse (shaderProgram_s *sp) |
Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards. More... | |
Functions for working with shaders.
Result shaderInstanceFree | ( | shaderInstance_s * | si | ) |
Frees a shader instance.
si | Shader instance to free. |
Result shaderInstanceGetBool | ( | shaderInstance_s * | si, |
int | id, | ||
bool * | value | ||
) |
Gets a bool uniform of a shader.
si | Shader instance to use. |
id | ID of the bool uniform. |
value | Pointer to output the value to. |
s8 shaderInstanceGetUniformLocation | ( | shaderInstance_s * | si, |
const char * | name | ||
) |
Gets the location of a shader's uniform.
si | Shader instance to use. |
name | Name of the uniform. |
Result shaderInstanceInit | ( | shaderInstance_s * | si, |
DVLE_s * | dvle | ||
) |
Initializes a shader instance.
si | Shader instance to initialize. |
dvle | DVLE to initialize the shader instance with. |
Result shaderInstanceSetBool | ( | shaderInstance_s * | si, |
int | id, | ||
bool | value | ||
) |
Sets a bool uniform of a shader.
si | Shader instance to use. |
id | ID of the bool uniform. |
value | Value to set. |
Result shaderProgramConfigure | ( | shaderProgram_s * | sp, |
bool | sendVshCode, | ||
bool | sendGshCode | ||
) |
Configures the shader units to use the specified shader program.
sp | Shader program to use. |
sendVshCode | When true, the vertex shader's code and operand descriptors are uploaded. |
sendGshCode | When true, the geometry shader's code and operand descriptors are uploaded. |
Result shaderProgramFree | ( | shaderProgram_s * | sp | ) |
Frees a shader program.
sp | Shader program to free. |
Result shaderProgramInit | ( | shaderProgram_s * | sp | ) |
Initializes a shader program.
sp | Shader program to initialize. |
Result shaderProgramSetGsh | ( | shaderProgram_s * | sp, |
DVLE_s * | dvle, | ||
u8 | stride | ||
) |
Sets the geometry shader of a shader program.
sp | Shader program to use. |
dvle | Geometry shader to set. |
stride | Input stride of the shader (pass 0 to match the number of outputs of the vertex shader). |
Result shaderProgramSetGshInputPermutation | ( | shaderProgram_s * | sp, |
u64 | permutation | ||
) |
Configures the permutation of the input attributes of the geometry shader of a shader program.
sp | Shader program to use. |
permutation | Attribute permutation to use. |
Result shaderProgramSetVsh | ( | shaderProgram_s * | sp, |
DVLE_s * | dvle | ||
) |
Sets the vertex shader of a shader program.
sp | Shader program to use. |
dvle | Vertex shader to set. |
Result shaderProgramUse | ( | shaderProgram_s * | sp | ) |
Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.
sp | Shader program to use. |