[Mesa-dev] [PATCH 05/13] isl: Add a helper for determining when a typed load/store can be used

Chad Versace chad.versace at intel.com
Tue Apr 19 22:29:30 UTC 2016


On Sat 16 Apr 2016, Jason Ekstrand wrote:
> ---
>  src/intel/isl/isl.h               |  7 +++++++
>  src/intel/isl/isl_storage_image.c | 10 ++++++++++
>  2 files changed, 17 insertions(+)

> +bool
> +isl_has_matching_typed_storage_image_format(const struct brw_device_info *devinfo,
> +                                            enum isl_format fmt)
> +{
> +   return (isl_format_get_layout(fmt)->bs <= 4 ||
> +           (isl_format_get_layout(fmt)->bs <= 8 &&
> +            (devinfo->gen >= 8 || devinfo->is_haswell)) ||
> +           devinfo->gen >= 9);
> +}

Please use the prevalent style in i965 for chained branches on the gen.
It's much easier to read and verify correct. Gens are listed in
decreasing order, newest to oldest:

	if (devinfo->gen >= 9) {
		return true;
	} else if (devinfo->gen >= 8 || devinfo->is_haswell) {
		return isl_format_get_layout(fmt)->bs <= 8;
	} else {
		return (isl_format_get_layout(fmt)->bs <= 4;
	}


More information about the mesa-dev mailing list