diff options
author | Bruce Merry <bmerry@users.sourceforge.net> | 2007-12-21 23:18:40 +0200 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-01-01 09:59:51 -0700 |
commit | cd354eb10fa1eef14b274cc76c5af6d9b9f6897c (patch) | |
tree | b68af9cf21f5aaaab8e5d26266553def6b54fb07 /src | |
parent | e9ac27ee23ef3672a608b85dd3d7c6165aad4611 (diff) |
Convert to 0/1 when setting boolean uniforms
Also add some extra tests to the shader_api regression tests
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/shader_api.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 8eb3e41e693..96940be5dfc 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1259,6 +1259,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) { |