From: Samuel Iglesias Gonsálvez Date: Wed, 20 Apr 2016 07:59:11 +0000 (+0200) Subject: i965/fs: fix MOV_INDIRECT exec_size for doubles X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c9006f95796e67cf2cac98795627c31b15b0371;p=mesa.git i965/fs: fix MOV_INDIRECT exec_size for doubles 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 Reviewed-by: Jordan Justen Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e105f4084fe..b479684fc67 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -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;