[Mesa-dev] [PATCH 15/22] i965/miptree: Prepare compressed offsets for isl based

Pohjolainen, Topi topi.pohjolainen at gmail.com
Wed Jul 19 13:52:53 UTC 2017


On Tue, Jul 18, 2017 at 02:01:25PM -0700, Jason Ekstrand wrote:
> On Tue, Jul 18, 2017 at 1:46 AM, Topi Pohjolainen <
> topi.pohjolainen at gmail.com> wrote:
> 
> > Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index a0b129adb4..1b8c0da80d 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -1462,6 +1462,15 @@ intel_miptree_get_image_offset(const struct
> > intel_mipmap_tree *mt,
> >        isl_surf_get_image_offset_sa(&mt->surf, level, slice, z,
> >                                     &x_offset_sa, &y_offset_sa);
> >
> > +      /* In case of compressed formats offsets are expected as blocks. */
> > +      if (mt->compressed) {
> > +         const struct isl_format_layout *fmtl =
> > +            isl_format_get_layout(mt->surf.format);
> > +
> > +         x_offset_sa /= fmtl->bw;
> > +         y_offset_sa /= fmtl->bh;
> > +      }
> >
> 
> I think what you probably want is to just to switch to
> isl_surf_get_image_offset_el()

Good call, thanks, changed locally.

> 
> --Jason
> 
> 
> > +
> >        *x = x_offset_sa;
> >        *y = y_offset_sa;
> >        return;
> > --
> > 2.11.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