Dolphin shaders
Some checks failed
Build Dusk / run-tests (pull_request) Failing after 13s
Build Dusk / build-linux (pull_request) Failing after 18s
Build Dusk / build-psp (pull_request) Failing after 18s
Build Dusk / build-gamecube (pull_request) Failing after 16s
Build Dusk / build-wii (pull_request) Failing after 13s
Some checks failed
Build Dusk / run-tests (pull_request) Failing after 13s
Build Dusk / build-linux (pull_request) Failing after 18s
Build Dusk / build-psp (pull_request) Failing after 18s
Build Dusk / build-gamecube (pull_request) Failing after 16s
Build Dusk / build-wii (pull_request) Failing after 13s
This commit is contained in:
@@ -9,9 +9,91 @@
|
||||
#include "error/error.h"
|
||||
|
||||
typedef struct {
|
||||
void *empty;
|
||||
mat4 view;
|
||||
mat4 proj;
|
||||
mat4 model;
|
||||
|
||||
bool_t isProjectionPerspective;
|
||||
Mtx44 matrixProjection;
|
||||
Mtx matrixView;
|
||||
Mtx matrixModel;
|
||||
Mtx matrixModelView;
|
||||
|
||||
uint_fast8_t dirtyMatrix;
|
||||
} shaderdolphin_t;
|
||||
|
||||
typedef struct {
|
||||
void *empty;
|
||||
} shaderdefinitiondolphin_t;
|
||||
} shaderdefinitiondolphin_t;
|
||||
|
||||
#define SHADER_DOLPHIN_DIRTY_MODEL (1 << 0)
|
||||
#define SHADER_DOLPHIN_DIRTY_PROJ (1 << 1)
|
||||
#define SHADER_DOLPHIN_DIRTY_VIEW (1 << 2)
|
||||
|
||||
extern shaderdolphin_t *SHADER_BOUND;
|
||||
|
||||
/**
|
||||
* Initializes a dolphin shader. Basically a render parameter pipeline.
|
||||
*
|
||||
* @param shader Shader to initialize.
|
||||
* @param def Definition of the shader to initialize with.
|
||||
* @return Error code if failure.
|
||||
*/
|
||||
errorret_t shaderInitDolphin(
|
||||
shaderdolphin_t *shader,
|
||||
const shaderdefinitiondolphin_t *def
|
||||
);
|
||||
|
||||
/**
|
||||
* Binds a dolphin shader. Basically sets the render parameters for rendering.
|
||||
*
|
||||
* @param shader Shader to bind.
|
||||
* @return Error code if failure.
|
||||
*/
|
||||
errorret_t shaderBindDolphin(shaderdolphin_t *shader);
|
||||
|
||||
/**
|
||||
* Sets a matrix uniform in the dolphin shader. Basically does nothing.
|
||||
*
|
||||
* @param shader Shader to set the matrix in.
|
||||
* @param name Name of the uniform to set.
|
||||
* @param matrix Matrix to set.
|
||||
* @return Error code if failure.
|
||||
*/
|
||||
errorret_t shaderSetMatrixDolphin(
|
||||
shaderdolphin_t *shader,
|
||||
const char_t *name,
|
||||
mat4 matrix
|
||||
);
|
||||
|
||||
/**
|
||||
* Disposes a dolphin shader. Basically does nothing.
|
||||
*
|
||||
* @param shader Shader to dispose.
|
||||
* @return Error code if failure.
|
||||
*/
|
||||
errorret_t shaderDisposeDolphin(shaderdolphin_t *shader);
|
||||
|
||||
/**
|
||||
* Internal Dolphin method, called right before a draw call to perform a matrix
|
||||
* update and recalc.
|
||||
*
|
||||
* @return Error code if failure.
|
||||
*/
|
||||
errorret_t shaderUpdateMVPDolphin();
|
||||
|
||||
/**
|
||||
* Converts a glm style column major mat4 to a GX compatible row major Mtx44.
|
||||
*
|
||||
* @param in Matrix to convert.
|
||||
* @param out Output converted matrix.
|
||||
*/
|
||||
void shaderMat4ToMtx44(const mat4 in, Mtx44 out);
|
||||
|
||||
/**
|
||||
* Converts a glm style column major mat4 to a GX compatible row major Mtx.
|
||||
*
|
||||
* @param inGlmMatrix Matrix to convert.
|
||||
* @param outGXMatrix Output converted matrix.
|
||||
*/
|
||||
void shaderMat4ToMtx(const mat4 inGlmMatrix, Mtx outGXMatrix);
|
||||
Reference in New Issue
Block a user