From: Marek Olšák Date: Sun, 7 Dec 2014 19:15:49 +0000 (+0100) Subject: radeonsi: emit GS_OUT_PRIM_TYPE only if it changes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6fde19491038074eb2d5ddb1bae48276530f9d74;p=mesa.git radeonsi: emit GS_OUT_PRIM_TYPE only if it changes Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 0bbc381bc9c..a40387cadb9 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -158,4 +158,5 @@ void si_begin_new_cs(struct si_context *ctx) si_invalidate_draw_sh_constants(ctx); ctx->last_primitive_restart_en = -1; ctx->last_restart_index = SI_RESTART_INDEX_UNKNOWN; + ctx->last_gs_out_prim = -1; } diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 471a55440d6..6766635b0a1 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -182,6 +182,7 @@ struct si_context { int last_sh_base_reg; int last_primitive_restart_en; int last_restart_index; + int last_gs_out_prim; }; /* si_blit.c */ diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 40a55c50fe9..a65eaa1f7ec 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -192,7 +192,10 @@ static void si_emit_draw_registers(struct si_context *sctx, r600_write_context_reg(cs, R_028AA8_IA_MULTI_VGT_PARAM, ia_multi_vgt_param); } - r600_write_context_reg(cs, R_028A6C_VGT_GS_OUT_PRIM_TYPE, gs_out_prim); + if (gs_out_prim != sctx->last_gs_out_prim) { + r600_write_context_reg(cs, R_028A6C_VGT_GS_OUT_PRIM_TYPE, gs_out_prim); + sctx->last_gs_out_prim = gs_out_prim; + } /* Primitive restart. */ if (info->primitive_restart != sctx->last_primitive_restart_en) {