diff options
author | Marek Olšák <[email protected]> | 2016-07-17 19:47:12 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-30 15:02:14 +0200 |
commit | 0a46e6f410f2838886828e18f0b6604b2702d809 (patch) | |
tree | c0fb847917cd5af4875c40e2b802581bcb32e649 /src/mesa/state_tracker/st_atom.c | |
parent | c8fe3b9dca73e3b91979d92ba4136b302001b3bb (diff) |
st/mesa: skip updates of states that have no effect
v2: - also don't check edge flags for GLES
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 32b8602a9d4..ef50ef9df9a 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -107,6 +107,7 @@ static void check_attrib_edgeflag(struct st_context *st) 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; @@ -117,11 +118,23 @@ void st_validate_state( struct st_context *st, enum st_pipeline pipeline ) /* Get pipeline state. */ switch (pipeline) { case ST_PIPELINE_RENDER: - check_attrib_edgeflag(st); + if (st->ctx->API == API_OPENGL_COMPAT) + check_attrib_edgeflag(st); + check_program_state(st); st_manager_validate_framebuffers(st); pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK; + + /* Don't update states that have no effect. */ + if (!ctx->TessCtrlProgram._Current) + pipeline_mask &= ~ST_NEW_TCS_RESOURCES; + if (!ctx->TessEvalProgram._Current) + pipeline_mask &= ~ST_NEW_TES_RESOURCES; + if (!ctx->GeometryProgram._Current) + pipeline_mask &= ~ST_NEW_GS_RESOURCES; + if (!ctx->Transform.ClipPlanesEnabled) + pipeline_mask &= ~ST_NEW_CLIP_STATE; break; case ST_PIPELINE_COMPUTE: pipeline_mask = ST_PIPELINE_COMPUTE_STATE_MASK; |