[Mesa-dev] [PATCH 27/32] i965: Change resolve flags to enum

Pohjolainen, Topi topi.pohjolainen at gmail.com
Thu Jan 5 15:57:05 UTC 2017


On Wed, Jan 04, 2017 at 05:58:46PM -0800, Ben Widawsky wrote:
> On 17-01-04 10:00:59, Topi Pohjolainen Topi Pohjolainen wrote:
> > On Mon, Jan 02, 2017 at 06:37:18PM -0800, Ben Widawsky wrote:
> > > In the foreseeable future it doesn't seem to make sense to have multiple
> > > resolve flags. What does make sense is to have the caller give an
> > > indication to the lower layers what it things should be done for
> > > resolve. The enum change distinguishes this binary selection.
> > > 
> > > v2: Make setting the hint more concise (Topi)
> > > 
> > > Cc: Topi Pohjolainen <topi.pohjolainen at gmail.com>
> > > Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> > > Acked-by: Daniel Stone <daniels at collabora.com>
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_blorp.c         |  8 ++++----
> > >  src/mesa/drivers/dri/i965/brw_context.c       | 13 +++++++------
> > >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 12 ++++++------
> > >  src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 13 ++++++++-----
> > >  4 files changed, 25 insertions(+), 21 deletions(-)
> > > 
> > > diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
> > > index 8d58616f59..d02920be57 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_blorp.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
> > > @@ -209,12 +209,12 @@ blorp_surf_for_miptree(struct brw_context *brw,
> > >              surf->aux_usage = ISL_AUX_USAGE_NONE;
> > >           }
> > >        } else if (!(safe_aux_usage & (1 << surf->aux_usage))) {
> > > -         uint32_t flags = 0;
> > > -         if (safe_aux_usage & (1 << ISL_AUX_USAGE_CCS_E))
> > > -            flags |= INTEL_MIPTREE_IGNORE_CCS_E;
> > > +         const enum intel_resolve_hint hint =
> > > +            safe_aux_usage & (1 << ISL_AUX_USAGE_CCS_E) ?
> > > +            INTEL_RESOLVE_HINT_IGNORE_CCS_E : 0;
> > > 
> > >           intel_miptree_resolve_color(brw, mt,
> > > -                                     *level, start_layer, num_layers, flags);
> > > +                                     *level, start_layer, num_layers, hint);
> > > 
> > >           assert(!intel_miptree_has_color_unresolved(mt, *level, 1,
> > >                                                      start_layer, num_layers));
> > > diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> > > index ce01605826..ffcefe799d 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_context.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_context.c
> > > @@ -261,9 +261,10 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
> > >        /* Sampling engine understands lossless compression and resolving
> > >         * those surfaces should be skipped for performance reasons.
> > >         */
> > > -      const int flags = intel_texture_view_requires_resolve(brw, tex_obj) ?
> > > -                           0 : INTEL_MIPTREE_IGNORE_CCS_E;
> > > -      intel_miptree_all_slices_resolve_color(brw, tex_obj->mt, flags);
> > > +      const enum intel_resolve_hint hint =
> > > +         intel_texture_view_requires_resolve(brw, tex_obj) ?  0 :
> >                                                                ^
> > extra space. You could also put it to the line below with the else-branch...
> > 
> 
> Fixed the space. I don't get the part about putting it with the else-branch.

Ah, yeah, just meant:

             const enum intel_resolve_hint hint =
                intel_texture_view_requires_resolve(brw, tex_obj) ?
                0 : INTEL_RESOLVE_HINT_IGNORE_CCS_E;

But either way.


More information about the mesa-dev mailing list