On Thu, Jun 15, 2017 at 10:01:53PM +0300, Pohjolainen, Topi wrote:
> On Thu, Jun 15, 2017 at 11:39:44AM -0700, Jason Ekstrand wrote:
> > On Tue, Jun 13, 2017 at 7:50 AM, Topi Pohjolainen <
> > topi.pohjolai...@gmail.com> wrote:
> > 
> > > Signed-off-by: Topi Pohjolainen <topi.pohjolai...@intel.com>
> > > ---
> > >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 28
> > > +++++++++++++++++++++------
> > >  1 file changed, 22 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > > b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > > index f44bac988f..c81d345fbc 100644
> > > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > > @@ -1294,7 +1294,8 @@ intel_miptree_copy_slice_sw(struct brw_context *brw,
> > >  {
> > >     void *src, *dst;
> > >     ptrdiff_t src_stride, dst_stride;
> > > -   int cpp = dst_mt->cpp;
> > > +   const unsigned cpp = dst_mt->surf.size > 0 ?
> > > +      (isl_format_get_layout(dst_mt->surf.format)->bpb / 8) :
> > > dst_mt->cpp;
> > >
> > >     intel_miptree_map(brw, src_mt,
> > >                       src_level, src_layer,
> > > @@ -1355,13 +1356,28 @@ intel_miptree_copy_slice(struct brw_context *brw,
> > >                           unsigned dst_level, unsigned dst_layer)
> > >
> > >  {
> > > -   uint32_t width = minify(src_mt->physical_width0,
> > > -                           src_level - src_mt->first_level);
> > > -   uint32_t height = minify(src_mt->physical_height0,
> > > -                            src_level - src_mt->first_level);
> > >     mesa_format format = src_mt->format;
> > > +   uint32_t width, height;
> > > +
> > > +   if (src_mt->surf.size > 0) {
> > > +      width = minify(src_mt->surf.phys_level0_sa.width,
> > > +                     src_level - src_mt->first_level);
> > > +      height = minify(src_mt->surf.phys_level0_sa.height,
> > > +                      src_level - src_mt->first_level);
> > > +
> > > +      const unsigned level_depth = src_mt->surf.dim == ISL_SURF_DIM_3D ?
> > >
> > 
> > This needs a MAYBE_UNUSED or else we'll get warnings in release builds.
> > Another option would be to do
> > 
> > if (src_mt->surf.dim == ISL_SURF_DIM_3D)
> >    assert(src_layer < minify());
> > else
> >    assert(src_layer < src_mt->surf.phys_level0_sa.array_len);
> > 
> > I think that would actually be better.
> 
> Thanks, used the latter locally.
> 

Patches 7, 8, and revised 9 are
Reviewed-by: Nanley Chery <nanley.g.ch...@intel.com>

> > 
> > 
> > > +         minify(src_mt->surf.phys_level0_sa.depth,
> > > +                src_level - src_mt->first_level) :
> > > +         src_mt->surf.phys_level0_sa.array_len;
> > > +      assert(src_layer < level_depth);
> > > +   } else {
> > > +      width = minify(src_mt->physical_width0,
> > > +                     src_level - src_mt->first_level);
> > > +      height = minify(src_mt->physical_height0,
> > > +                      src_level - src_mt->first_level);
> > > +      assert(src_layer < src_mt->level[src_level].depth);
> > > +   }
> > >
> > > -   assert(src_layer < src_mt->level[src_level].depth);
> > >     assert(src_mt->format == dst_mt->format);
> > >
> > >     if (dst_mt->compressed) {
> > > --
> > > 2.11.0
> > >
> > > _______________________________________________
> > > mesa-dev mailing list
> > > mesa-dev@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > >
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to