[Mesa-dev] [PATCH 7/8] st/mesa: don't update atomic, SSBO, UBO and TBO states that have no effect

Marek Olšák maraeo at gmail.com
Sun Aug 7 01:12:23 UTC 2016


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

---
 src/mesa/state_tracker/st_atom.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index dddc5ff..94e012a 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -150,23 +150,26 @@ static void check_attrib_edgeflag(struct st_context *st)
 /***********************************************************************
  * Update all derived state:
  */
 
 void st_validate_state( struct st_context *st, enum st_pipeline pipeline )
 {
    struct gl_context *ctx = st->ctx;
    uint64_t dirty, pipeline_mask;
    uint32_t dirty_lo, dirty_hi;
 
-   /* Get Mesa driver state. */
-   st->dirty |= st->ctx->NewDriverState & ST_ALL_STATES_MASK;
-   st->ctx->NewDriverState = 0;
+   /* Get Mesa driver state.
+    *
+    * Inactive states are shader states not used by shaders at the moment.
+    */
+   st->dirty |= ctx->NewDriverState & st->active_states & ST_ALL_STATES_MASK;
+   ctx->NewDriverState = 0;
 
    /* Get pipeline state. */
    switch (pipeline) {
    case ST_PIPELINE_RENDER:
       if (st->ctx->API == API_OPENGL_COMPAT)
          check_attrib_edgeflag(st);
 
       check_program_state(st);
       st_manager_validate_framebuffers(st);
 
-- 
2.7.4



More information about the mesa-dev mailing list