i965/fs: fix MOV_INDIRECT exec_size for doubles
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 20 Apr 2016 07:59:11 +0000 (09:59 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:09 +0000 (11:25 +0200)
In that case, the writes need two times the size of a 32-bit value.
We need to adjust the exec_size, so it is not breaking any hardware
rule.

v2:
  - Add an assert to verify type size is not less than 4 bytes (Jordan).

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp

index e105f4084fe1c8867839b7fb3d20b206bc653927..b479684fc675b0a9ca7467b20b11e8a37c929c2a 100644 (file)
@@ -4682,7 +4682,15 @@ get_lowered_simd_width(const struct brw_device_info *devinfo,
 
    case SHADER_OPCODE_MOV_INDIRECT:
       /* Prior to Broadwell, we only have 8 address subregisters */
-      return devinfo->gen < 8 ? 8 : MIN2(inst->exec_size, 16);
+      if (devinfo->gen < 8)
+         return 8;
+
+      if (inst->exec_size < 16) {
+         return inst->exec_size;
+      } else {
+         assert(type_sz(inst->dst.type) >= 4);
+         return MIN2(inst->exec_size / (type_sz(inst->dst.type) / 4), 16);
+      }
 
    default:
       return inst->exec_size;