//Pascal &or the FreePascal use of nintendo 2ds, 3ds regime // // Copyright (c) 2013, 2015, 2017 Kenneth Dwayne Lee Bsc. // all rights reserved // Type float24Uniform_s = record id : u32; data : array[0..2] of u32; end; shaderInstance_s = record dvle : ^DVLE_s; boolUniforms : u16; boolUniformMask : u16; intUniforms : array[0..3] of u32; float24Uniforms : ^float24Uniform_s; intUniformMask : u8; numFloat24Uniforms : u8; end; PshaderInstance_s = ^shaderInstance_s; shaderProgram_s = record vertexShader : ^shaderInstance_s; geometryShader : ^shaderInstance_s; geoShaderInputPermutation : array[0..1] of u32; geoShaderInputStride : u8; end; PshaderProgram_s = ^shaderProgram_s; {* * @brief Initializes a shader instance. * @param si Shader instance to initialize. * @param dvle DVLE to initialize the shader instance with. } function shaderInstanceInit(si:PshaderInstance_s; dvle:PDVLE_s):s32;cdecl;external; {* * @brief Frees a shader instance. * @param si Shader instance to free. } function shaderInstanceFree(si:PshaderInstance_s):s32;cdecl;external; {* * @brief Sets a bool uniform of a shader. * @param si Shader instance to use. * @param id ID of the bool uniform. * @param value Value to set. } function shaderInstanceSetBool(si:PshaderInstance_s; id:cint; value:bool):s32;cdecl;external; {* * @brief Gets a bool uniform of a shader. * @param si Shader instance to use. * @param id ID of the bool uniform. * @param value Pointer to output the value to. } function shaderInstanceGetBool(si:PshaderInstance_s; id:cint; value:Pbool):s32;cdecl;external; {* * @brief Gets the location of a shader's uniform. * @param si Shader instance to use. * @param name Name of the uniform. } function shaderInstanceGetUniformLocation(si:PshaderInstance_s; name:pchar):s8;cdecl;external; {* * @brief Initializes a shader program. * @param sp Shader program to initialize. } function shaderProgramInit(sp:PshaderProgram_s):s32;cdecl;external; {* * @brief Frees a shader program. * @param sp Shader program to free. } function shaderProgramFree(sp:PshaderProgram_s):s32;cdecl;external; {* * @brief Sets the vertex shader of a shader program. * @param sp Shader program to use. * @param dvle Vertex shader to set. } function shaderProgramSetVsh(sp:PshaderProgram_s; dvle:PDVLE_s):s32;cdecl;external; {* * @brief Sets the geometry shader of a shader program. * @param sp Shader program to use. * @param dvle Geometry shader to set. * @param stride Input stride of the shader (pass 0 to match the number of outputs of the vertex shader). } function shaderProgramSetGsh(sp:PshaderProgram_s; dvle:PDVLE_s; stride:u8):s32;cdecl;external; {* * @brief Configures the permutation of the input attributes of the geometry shader of a shader program. * @param sp Shader program to use. * @param permutation Attribute permutation to use. } function shaderProgramSetGshInputPermutation(sp:PshaderProgram_s; permutation:u64):s32;cdecl;external; {* * @brief Configures the shader units to use the specified shader program. * @param sp Shader program to use. * @param sendVshCode When true, the vertex shader's code and operand descriptors are uploaded. * @param sendGshCode When true, the geometry shader's code and operand descriptors are uploaded. } function shaderProgramConfigure(sp:PshaderProgram_s; sendVshCode:bool; sendGshCode:bool):s32;cdecl;external; {* * @brief Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards. * @param sp Shader program to use. } function shaderProgramUse(sp:PshaderProgram_s):s32;cdecl;external;