[Mesa-dev] [PATCH 18/31] i965/fs: Calculate maximum execution size of MOV_INDIRECT correctly.

Francisco Jerez currojerez at riseup.net
Sat May 21 05:47:53 UTC 2016


---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index bec96b1..9baf41c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -4909,15 +4909,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;
-- 
2.7.3



More information about the mesa-dev mailing list