glsl: Fix gl_shader_program::UniformLocationBaseScale assert. 26/7126/1
authorVinson Lee <vlee@freedesktop.org>
Tue, 25 Jun 2013 05:50:30 +0000 (22:50 -0700)
committerVinson Lee <vlee@freedesktop.org>
Wed, 26 Jun 2013 01:45:01 +0000 (18:45 -0700)
commit 26d86d26f9f972b19c7040bdb1b1daf48537ef3e added
gl_shader_program::UniformLocationBaseScale. According to the code
comments in that commit, UniformLocationBaseScale "must be >=1".

UniformLocationBaseScale is of type unsigned. Coverity reported a "Macro
compares unsigned to 0" defect as well.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/uniforms.h

index 14fe26d..9223917 100644 (file)
@@ -272,7 +272,7 @@ static inline GLint
 _mesa_uniform_merge_location_offset(const struct gl_shader_program *prog,
                                     unsigned base_location, unsigned offset)
 {
-   assert(prog->UniformLocationBaseScale >= 0);
+   assert(prog->UniformLocationBaseScale >= 1);
    assert(offset < prog->UniformLocationBaseScale);
    return (base_location * prog->UniformLocationBaseScale) + offset;
 }