[Mesa-dev] [PATCH 2/5] st/mesa: remove redundant sample_mask checking

Marek Olšák maraeo at gmail.com
Wed Jun 14 21:41:14 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

cso does that too
---
 src/mesa/state_tracker/st_atom_msaa.c | 7 +------
 src/mesa/state_tracker/st_context.h   | 1 -
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_msaa.c b/src/mesa/state_tracker/st_atom_msaa.c
index 0bdb9b2..814077f 100644
--- a/src/mesa/state_tracker/st_atom_msaa.c
+++ b/src/mesa/state_tracker/st_atom_msaa.c
@@ -55,26 +55,21 @@ void st_update_sample_mask( struct st_context *st )
             Also, there's an interface restriction here in theory it is
             encouraged this mask not be the same at each pixel. */
          sample_mask = (1 << nr_bits) - 1;
          if (st->ctx->Multisample.SampleCoverageInvert)
             sample_mask = ~sample_mask;
       }
       if (st->ctx->Multisample.SampleMask)
          sample_mask &= st->ctx->Multisample.SampleMaskValue;
    }
 
-   /* mask off unused bits or don't care? */
-
-   if (sample_mask != st->state.sample_mask) {
-      st->state.sample_mask = sample_mask;
-      cso_set_sample_mask(st->cso_context, sample_mask);
-   }
+   cso_set_sample_mask(st->cso_context, sample_mask);
 }
 
 void st_update_sample_shading( struct st_context *st )
 {
    if (!st->fp)
       return;
 
    if (!st->ctx->Extensions.ARB_sample_shading)
       return;
 
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 6497587..2fe9d92 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -149,21 +149,20 @@ struct st_context
       unsigned fb_height;
       unsigned fb_num_samples;
       unsigned fb_num_layers;
       struct pipe_scissor_state scissor[PIPE_MAX_VIEWPORTS];
       struct pipe_viewport_state viewport[PIPE_MAX_VIEWPORTS];
       struct {
          unsigned num;
          boolean include;
          struct pipe_scissor_state rects[PIPE_MAX_WINDOW_RECTANGLES];
       } window_rects;
-      unsigned sample_mask;
 
       GLuint poly_stipple[32];  /**< In OpenGL's bottom-to-top order */
 
       GLuint fb_orientation;
    } state;
 
    uint64_t dirty; /**< dirty states */
 
    /** This masks out unused shader resources. Only valid in draw calls. */
    uint64_t active_states;
-- 
2.7.4



More information about the mesa-dev mailing list