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

Jason Ekstrand jason at jlekstrand.net
Tue Apr 19 23:19:51 UTC 2016


On Tue, Apr 19, 2016 at 3:29 PM, Chad Versace <chad.versace at intel.com>
wrote:

> 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;
>         }
>

Done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160419/9b92912e/attachment.html>


More information about the mesa-dev mailing list