diff options
author | Marek Olšák <[email protected]> | 2015-03-15 19:21:31 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-03-16 12:54:19 +0100 |
commit | 1f4bb3826464e2ce1d3f47183c96e6e7fde9a1d7 (patch) | |
tree | 464396926ec1edb58a98a1f7f654ee1504beb0f8 /src | |
parent | f5832f3f9dd0ac0b401d351acab19425fe3c1187 (diff) |
radeonsi: don't emit PA_SC_LINE_STIPPLE after every rasterizer state change
Do it only when the line stipple state is changed.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_draw.c | 7 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 30bf41f2316..313ced7f5d1 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -161,5 +161,6 @@ void si_begin_new_cs(struct si_context *ctx) ctx->last_prim = -1; ctx->last_multi_vgt_param = -1; ctx->last_rast_prim = -1; + ctx->last_sc_line_stipple = ~0; ctx->emit_scratch_reloc = true; } diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 8cfaf708183..29f01f35d38 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -162,7 +162,6 @@ struct si_context { struct si_framebuffer framebuffer; struct si_vertex_element *vertex_elements; - unsigned pa_sc_line_stipple; /* for saving when using blitter */ struct pipe_stencil_ref stencil_ref; /* shaders */ @@ -227,6 +226,7 @@ struct si_context { int last_prim; int last_multi_vgt_param; int last_rast_prim; + unsigned last_sc_line_stipple; int current_rast_prim; /* primitive type after TES, GS */ /* Scratch buffer */ diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index e3e6fa45728..4bb6f2b2764 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -705,9 +705,6 @@ static void si_bind_rs_state(struct pipe_context *ctx, void *state) if (state == NULL) return; - // TODO - sctx->pa_sc_line_stipple = rs->pa_sc_line_stipple; - if (sctx->framebuffer.nr_samples > 1 && (!old_rs || old_rs->multisample_enable != rs->multisample_enable)) sctx->db_render_state.dirty = true; @@ -716,7 +713,6 @@ static void si_bind_rs_state(struct pipe_context *ctx, void *state) si_update_fb_rs_state(sctx); sctx->clip_regs.dirty = true; - sctx->last_rast_prim = -1; /* reset this so that it gets updated */ } static void si_delete_rs_state(struct pipe_context *ctx, void *state) diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index b68e493c4bb..7523c2aefd2 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -154,16 +154,19 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx) { struct radeon_winsys_cs *cs = sctx->b.rings.gfx.cs; unsigned rast_prim = sctx->current_rast_prim; + struct si_state_rasterizer *rs = sctx->emitted.named.rasterizer; - if (rast_prim == sctx->last_rast_prim) + if (rast_prim == sctx->last_rast_prim && + rs->pa_sc_line_stipple == sctx->last_sc_line_stipple) return; r600_write_context_reg(cs, R_028A0C_PA_SC_LINE_STIPPLE, - sctx->pa_sc_line_stipple | + rs->pa_sc_line_stipple | S_028A0C_AUTO_RESET_CNTL(rast_prim == PIPE_PRIM_LINES ? 1 : rast_prim == PIPE_PRIM_LINE_STRIP ? 2 : 0)); sctx->last_rast_prim = rast_prim; + sctx->last_sc_line_stipple = rs->pa_sc_line_stipple; } static void si_emit_draw_registers(struct si_context *sctx, |