i965/fs: Calculate maximum execution size of MOV_INDIRECT correctly.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 17 May 2016 23:10:38 +0000 (16:10 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:19:22 +0000 (23:19 -0700)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs.cpp

index df72fda49c2c97194569f95f7566795ab2ad9ca1..22c4d345f5a406720eb7c5ad0b0809a83b2c392b 100644 (file)
@@ -4901,15 +4901,9 @@ get_lowered_simd_width(const struct brw_device_info *devinfo,
 
    case SHADER_OPCODE_MOV_INDIRECT:
       /* Prior to Broadwell, we only have 8 address subregisters */
-      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);
-      }
+      return MIN3(devinfo->gen >= 8 ? 16 : 8,
+                  2 * REG_SIZE / (inst->dst.stride * type_sz(inst->dst.type)),
+                  inst->exec_size);
 
    default:
       return inst->exec_size;