From 1e9e8ead11a2f5670c4b4e376a5d47db0977c680 Mon Sep 17 00:00:00 2001 From: fincs Date: Sun, 24 Jan 2016 01:45:39 +0100 Subject: [PATCH] Fix integer and boolean uniforms --- include/c3d/uniforms.h | 4 ++-- source/uniforms.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/c3d/uniforms.h b/include/c3d/uniforms.h index dc45455..bfe939e 100644 --- a/include/c3d/uniforms.h +++ b/include/c3d/uniforms.h @@ -21,7 +21,7 @@ static inline C3D_FVec* C3D_FVUnifWritePtr(GPU_SHADER_TYPE type, int id, int siz static inline C3D_IVec* C3D_IVUnifWritePtr(GPU_SHADER_TYPE type, int id) { - id -= 0x70; + id -= 0x60; C3D_IVUnifDirty[type][id] = true; return &C3D_IVUnif[type][id]; } @@ -66,7 +66,7 @@ static inline void C3D_IVUnifSet(GPU_SHADER_TYPE type, int id, int x, int y, int static inline void C3D_BoolUnifSet(GPU_SHADER_TYPE type, int id, bool value) { - id -= 0x78; + id -= 0x68; C3D_BoolUnifsDirty[type] = true; if (value) C3D_BoolUnifs[type] |= BIT(id); diff --git a/source/uniforms.c b/source/uniforms.c index 9e359df..4427d4e 100644 --- a/source/uniforms.c +++ b/source/uniforms.c @@ -79,7 +79,7 @@ void C3D_UpdateUniforms(GPU_SHADER_TYPE type) // Update bool uniforms if (C3D_BoolUnifsDirty[type]) { - GPUCMD_AddWrite(GPUREG_VSH_BOOLUNIFORM+offset, 0x7FFF0000 | (u32)~C3D_BoolUnifs[type]); + GPUCMD_AddWrite(GPUREG_VSH_BOOLUNIFORM+offset, 0x7FFF0000 | C3D_BoolUnifs[type]); C3D_BoolUnifsDirty[type] = false; } }