i965: Make pixel_xy results UW.
authorEric Anholt <eric@anholt.net>
Sun, 5 Sep 2010 03:54:52 +0000 (20:54 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 7 Sep 2010 20:00:22 +0000 (13:00 -0700)
There is a restriction on the destination of an operation involving a
vector immediate being 128-bit aligned and the destination horizontal
stride being equivalent to 2 bytes.  Fixes bad pixel_x results from
gl_FragCoord, where each pair had the same value.

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

index 811d1082284c3ae90896825f4834aa70e33612b2..25a20e760428d4cd5e390441109299d8c101b73b 100644 (file)
@@ -1211,6 +1211,8 @@ fs_visitor::emit_interpolation()
    this->current_annotation = "compute pixel centers";
    this->pixel_x = fs_reg(this, glsl_type::uint_type);
    this->pixel_y = fs_reg(this, glsl_type::uint_type);
+   this->pixel_x.type = BRW_REGISTER_TYPE_UW;
+   this->pixel_y.type = BRW_REGISTER_TYPE_UW;
    emit(fs_inst(BRW_OPCODE_ADD,
                this->pixel_x,
                fs_reg(stride(suboffset(g1_uw, 4), 2, 4, 0)),