[Mesa-dev] [PATCH 59/59] i965/fs: fix MOV_INDIRECT exec_size for doubles

Jordan Justen jordan.l.justen at intel.com
Mon May 2 03:04:23 UTC 2016


On 2016-04-29 04:29:56, Samuel Iglesias Gonsálvez wrote:
> 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.
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 059edc6..85d430c 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -4655,7 +4655,13 @@ 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
> +         return MIN2(inst->exec_size / (type_sz(inst->dst.type) / 4), 16);

Can't type_sz return < 4, which could cause a divide by 0? If that
can't happen along this code path, would an assert be a good idea?

-Jordan

>  
>     default:
>        return inst->exec_size;
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list