i965/fs: Copy the offset when lowering logical pull constant sends
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Jun 2016 22:01:04 +0000 (15:01 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 1 Jun 2016 23:00:44 +0000 (16:00 -0700)
This fixes 64 Vulkan CTS tests per gen

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96299
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 00d937e30a73d46bfe8de6f249dc9df60e31c3ec..bd026de0c5743687078ad3f3c370b10a962461f5 100644 (file)
@@ -4448,6 +4448,14 @@ lower_varying_pull_constant_logical_send(const fs_builder &bld, fs_inst *inst)
    const brw_device_info *devinfo = bld.shader->devinfo;
 
    if (devinfo->gen >= 7) {
+      /* We are switching the instruction from an ALU-like instruction to a
+       * send-from-grf instruction.  Since sends can't handle strides or
+       * source modifiers, we have to make a copy of the offset source.
+       */
+      fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD);
+      bld.MOV(tmp, inst->src[1]);
+      inst->src[1] = tmp;
+
       inst->opcode = FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7;
 
    } else {