st/mesa: call check_program_state only when needed
authorMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jun 2017 21:06:09 +0000 (23:06 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 12 Jun 2017 16:24:37 +0000 (18:24 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_atom.c

index cbac7629e9c52fe1af165cb7697e21a2a048fa1b..bcfbcf878f00322cf0af9e0c0bb1094ac075b079 100644 (file)
@@ -116,7 +116,6 @@ static void check_program_state( struct st_context *st )
    }
 
    st->dirty |= dirty;
-   st->gfx_shaders_may_be_dirty = false;
 }
 
 static void check_attrib_edgeflag(struct st_context *st)
@@ -171,7 +170,11 @@ void st_validate_state( struct st_context *st, enum st_pipeline pipeline )
       if (st->ctx->API == API_OPENGL_COMPAT)
          check_attrib_edgeflag(st);
 
-      check_program_state(st);
+      if (st->gfx_shaders_may_be_dirty) {
+         check_program_state(st);
+         st->gfx_shaders_may_be_dirty = false;
+      }
+
       st_manager_validate_framebuffers(st);
 
       pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK;