[Mesa-dev] [PATCH 10/16] i965: Add function to copy a stencil miptree to an R8_UINT miptree

Jordan Justen jordan.l.justen at intel.com
Thu Aug 25 05:34:28 UTC 2016


On 2016-08-24 17:44:44, Matt Turner wrote:
> On Wed, Aug 24, 2016 at 4:55 PM, Jordan Justen
> <jordan.l.justen at intel.com> wrote:
> > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 55 ++++++++++++++++++++++++++-
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  4 ++
> >  2 files changed, 58 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index dd6280b..3f23588 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -674,7 +674,6 @@ miptree_create(struct brw_context *brw,
> >
> >     etc_format = (format != tex_format) ? tex_format : MESA_FORMAT_NONE;
> >
> > -   assert((layout_flags & MIPTREE_LAYOUT_DISABLE_AUX) == 0);
> >     assert((layout_flags & MIPTREE_LAYOUT_FOR_BO) == 0);
> >     mt = intel_miptree_create_layout(brw, target, format,
> >                                      first_level, last_level, width0,
> > @@ -2282,6 +2281,60 @@ intel_miptree_updownsample(struct brw_context *brw,
> >     }
> >  }
> >
> > +void
> > +intel_update_r8stencil(struct brw_context *brw,
> > +                       struct intel_mipmap_tree *mt)
> > +{
> > +   assert(brw->gen >= 7);
> > +   struct intel_mipmap_tree *src =
> > +      mt->format == MESA_FORMAT_S_UINT8 ? mt : mt->stencil_mt;
> > +   if (!src || brw->gen >= 8 || !src->r8stencil_needs_update)
> > +      return;
> > +
> > +   if(!mt->r8stencil_mt) {
> > +      uint32_t r8stencil_flags =
> > +         MIPTREE_LAYOUT_ACCELERATED_UPLOAD | MIPTREE_LAYOUT_TILING_Y |
> > +         MIPTREE_LAYOUT_DISABLE_AUX;
> > +      assert(brw->gen > 6); /* Handle MIPTREE_LAYOUT_FORCE_ALL_SLICE_AT_LOD */
> > +      mt->r8stencil_mt = intel_miptree_create(brw,
> > +                                                src->target,
> > +                                                MESA_FORMAT_R_UINT8,
> > +                                                src->first_level,
> > +                                                src->last_level,
> > +                                                src->logical_width0,
> > +                                                src->logical_height0,
> > +                                                src->logical_depth0,
> > +                                                src->num_samples,
> > +                                                r8stencil_flags);
> 
> Indentation here seems off.

Doh. Last minute rename to r8stencil. :\

I'll check that I didn't mess up indentation elsewhere as well.

It used to be stencil_tex, but that seemed a bit too generic. I'm not
too happy with r8stencil either. It looks like r8u_stencil would fix
the indentation. :)

-Jordan


More information about the mesa-dev mailing list