Add C3D_BoolUnifSet, correct int/bool uniform IDs

This commit is contained in:
fincs 2015-12-05 14:23:54 +01:00
parent 7c48f9106f
commit 959f250f4e

View File

@ -21,6 +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) static inline C3D_IVec* C3D_IVUnifWritePtr(GPU_SHADER_TYPE type, int id)
{ {
id -= 0x70;
C3D_IVUnifDirty[type][id] = true; C3D_IVUnifDirty[type][id] = true;
return &C3D_IVUnif[type][id]; return &C3D_IVUnif[type][id];
} }
@ -63,4 +64,14 @@ static inline void C3D_IVUnifSet(GPU_SHADER_TYPE type, int id, int x, int y, int
*ptr = IVec_Pack(x, y, z, w); *ptr = IVec_Pack(x, y, z, w);
} }
static inline void C3D_BoolUnifSet(GPU_SHADER_TYPE type, int id, bool value)
{
id -= 0x78;
C3D_BoolUnifsDirty[type] = true;
if (value)
C3D_BoolUnifs[type] |= BIT(id);
else
C3D_BoolUnifs[type] &= ~BIT(id);
}
void C3D_UpdateUniforms(GPU_SHADER_TYPE type); void C3D_UpdateUniforms(GPU_SHADER_TYPE type);