glsl2: Don't clear swizzles for Mesa IR constants after fetching them.
authorEric Anholt <eric@anholt.net>
Sat, 26 Jun 2010 00:20:46 +0000 (17:20 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 26 Jun 2010 00:20:46 +0000 (17:20 -0700)
Missed this while hacking in constants support.  Fixes:
glsl-algebraic-mul-*
glsl-algebraic-rcp-*
glsl-vs-swizzle-swizzle-lhs
glsl-vs-vec4-indexing-6

src/mesa/shader/ir_to_mesa.cpp

index a46286e82b4fe2443be456cef88f2638b74b1277..456f69cd36fa8da376987b61c78a76bfebce6dab 100644 (file)
@@ -349,7 +349,6 @@ ir_to_mesa_visitor::src_reg_for_float(float val)
    src_reg.file = PROGRAM_CONSTANT;
    src_reg.index = _mesa_add_unnamed_constant(this->prog->Parameters,
                                              &val, 1, &src_reg.swizzle);
-   src_reg.swizzle = SWIZZLE_NOOP;
 
    return src_reg;
 }
@@ -994,7 +993,6 @@ ir_to_mesa_visitor::visit(ir_constant *ir)
         _mesa_add_unnamed_constant(this->prog->Parameters,
                                    &ir->value.f[0], ir->type->vector_elements,
                                    &src_reg.swizzle);
-      src_reg.swizzle = SWIZZLE_NOOP;
    } else {
       assert(!"FINISHME: non-float constants");
    }