i965: Respect stride and subreg_offset for ATTR registers
authorKristian Høgsberg Kristensen <krh@bitplanet.net>
Wed, 23 Sep 2015 23:57:47 +0000 (16:57 -0700)
committerKristian Høgsberg Kristensen <krh@bitplanet.net>
Thu, 24 Sep 2015 17:17:27 +0000 (10:17 -0700)
When we assign hw regs to attributes, we don't incorporate the stride
and subreg_offset from the fs_reg. It's rarely used, but the integer
multiplication lowering uses unusual stride and subreg_offset
combination breaks when one source is an attribute.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91970
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 225a3122c79c02e6c17af8de14e03bf6bbf0cc67..618bbd2866a3f441ab694d24c587e5611b55ee9a 100644 (file)
@@ -1564,7 +1564,10 @@ fs_visitor::assign_vs_urb_setup()
 
             inst->src[i].file = HW_REG;
             inst->src[i].fixed_hw_reg =
-               retype(brw_vec8_grf(grf, 0), inst->src[i].type);
+               stride(byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type),
+                                  inst->src[i].subreg_offset),
+                      inst->exec_size * inst->src[i].stride,
+                      inst->exec_size, inst->src[i].stride);
          }
       }
    }