i965: Fix new FS handling of builtin uniforms with packed scalars in structs.
authorEric Anholt <eric@anholt.net>
Thu, 30 Sep 2010 20:26:38 +0000 (13:26 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 30 Sep 2010 20:45:42 +0000 (13:45 -0700)
We were pointing each element at the .x channel of the
ParameterValues.

Fixes glsl1-linear fog.

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

index efa0f2136b288a72d0685e08be03e84653b41aab..0a77b5ab4ede07b4397ddc328baed1a297d4af80 100644 (file)
@@ -696,12 +696,12 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
          */
         int last_swiz = -1;
         for (unsigned int i = 0; i < 4; i++) {
-           int this_swiz = GET_SWZ(element->swizzle, i);
-           if (this_swiz == last_swiz)
+           int swiz = GET_SWZ(element->swizzle, i);
+           if (swiz == last_swiz)
               break;
-           last_swiz = this_swiz;
+           last_swiz = swiz;
 
-           c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i];
+           c->prog_data.param[c->prog_data.nr_params++] = &vec_values[swiz];
         }
       }
    }