From 2bf2a8cc6dbf8cd4561bfc45886d5317beda098b Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Fri, 21 Dec 2007 23:18:40 +0200 Subject: Convert to 0/1 when setting boolean uniforms Also add some extra tests to the shader_api regression tests --- src/mesa/shader/shader_api.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa/shader/shader_api.c') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index a9e3e3a426..d0c8235103 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) { -- cgit v1.2.3