summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBruce Merry <[email protected]>2007-12-21 23:18:40 +0200
committerBrian <[email protected]>2008-01-01 09:58:15 -0700
commit2bf2a8cc6dbf8cd4561bfc45886d5317beda098b (patch)
tree1cf1228104ff69ffbee3b4f7374831e800a2bc7c /src/mesa
parent3f948025dbbff665ed41ad771e459472cc069e8b (diff)
Convert to 0/1 when setting boolean uniforms
Also add some extra tests to the shader_api regression tests
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/shader_api.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index a9e3e3a4267..d0c82351037 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1258,6 +1258,13 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
uniformVal[i] = fValues[i];
}
}
+ if (uType == GL_BOOL ||
+ uType == GL_BOOL_VEC2 ||
+ uType == GL_BOOL_VEC3 ||
+ uType == GL_BOOL_VEC4) {
+ for (i = 0; i < elems; i++)
+ uniformVal[i] = uniformVal[i] ? 1.0f : 0.0f;
+ }
}
if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) {