i965/vs: Fix builtin uniform setup.
authorEric Anholt <eric@anholt.net>
Tue, 9 Aug 2011 21:49:29 +0000 (14:49 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Aug 2011 20:04:43 +0000 (13:04 -0700)
I want to intelligently pack them at some point, but for now we have
the params set up in groups of 4.  Fixes glsl-vs-normalscale.

src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index e11ec40cc7b0f6a32618a12eb981df72b879f31a..93252f732857f3646cc51939e134095bb88356fb 100644 (file)
@@ -443,13 +443,12 @@ vec4_visitor::setup_builtin_uniform_values(ir_variable *ir)
       int last_swiz = -1;
       for (unsigned int j = 0; j < 4; j++) {
         int swiz = GET_SWZ(slots[i].swizzle, j);
-        if (swiz == last_swiz)
-           break;
         last_swiz = swiz;
 
         c->prog_data.param[this->uniforms * 4 + j] = &values[swiz];
         c->prog_data.param_convert[this->uniforms * 4 + j] = PARAM_NO_CONVERT;
-        this->uniform_size[this->uniforms]++;
+        if (swiz <= last_swiz)
+           this->uniform_size[this->uniforms]++;
       }
       this->uniforms++;
    }