i965/fs: Set smear on shader_time diff register.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 8 Mar 2015 08:13:41 +0000 (00:13 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Mar 2015 23:07:03 +0000 (16:07 -0700)
The ADD(diff, diff, fs_reg(-2u)) instruction reads diff, which is a
width 1 register.  We need to read it as <0,1,0> with a subreg of 0,
which is what smear accomplishes.

Fixes assertion:
brw_eu_emit.c:285: validate_reg: Assertion `hstride == 0' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86974
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/drivers/dri/i965/brw_fs.cpp

index 951cd97c49ee6e0270e6f74a0fa112a3638f5969..71087f2f87c8281c93c2c89458616302ddc46f98 100644 (file)
@@ -765,6 +765,7 @@ fs_visitor::emit_shader_time_end()
    fs_reg start = shader_start_time;
    start.negate = true;
    fs_reg diff = fs_reg(GRF, alloc.allocate(1), BRW_REGISTER_TYPE_UD, 1);
+   diff.set_smear(0);
    fs_inst *add = ADD(diff, start, shader_end_time);
    add->force_writemask_all = true;
    emit(add);