mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
radeonsi: emit DRAW_PREAMBLE only if it changes
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
c466093512
commit
834bee42ed
3 changed files with 17 additions and 8 deletions
|
|
@ -159,4 +159,6 @@ void si_begin_new_cs(struct si_context *ctx)
|
||||||
ctx->last_primitive_restart_en = -1;
|
ctx->last_primitive_restart_en = -1;
|
||||||
ctx->last_restart_index = SI_RESTART_INDEX_UNKNOWN;
|
ctx->last_restart_index = SI_RESTART_INDEX_UNKNOWN;
|
||||||
ctx->last_gs_out_prim = -1;
|
ctx->last_gs_out_prim = -1;
|
||||||
|
ctx->last_prim = -1;
|
||||||
|
ctx->last_multi_vgt_param = -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,8 @@ struct si_context {
|
||||||
int last_primitive_restart_en;
|
int last_primitive_restart_en;
|
||||||
int last_restart_index;
|
int last_restart_index;
|
||||||
int last_gs_out_prim;
|
int last_gs_out_prim;
|
||||||
|
int last_prim;
|
||||||
|
int last_multi_vgt_param;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* si_blit.c */
|
/* si_blit.c */
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,8 @@ static void si_emit_draw_registers(struct si_context *sctx,
|
||||||
unsigned ia_multi_vgt_param = si_get_ia_multi_vgt_param(sctx, info);
|
unsigned ia_multi_vgt_param = si_get_ia_multi_vgt_param(sctx, info);
|
||||||
|
|
||||||
/* Draw state. */
|
/* Draw state. */
|
||||||
|
if (prim != sctx->last_prim ||
|
||||||
|
ia_multi_vgt_param != sctx->last_multi_vgt_param) {
|
||||||
if (sctx->b.chip_class >= CIK) {
|
if (sctx->b.chip_class >= CIK) {
|
||||||
radeon_emit(cs, PKT3(PKT3_DRAW_PREAMBLE, 2, 0));
|
radeon_emit(cs, PKT3(PKT3_DRAW_PREAMBLE, 2, 0));
|
||||||
radeon_emit(cs, prim); /* VGT_PRIMITIVE_TYPE */
|
radeon_emit(cs, prim); /* VGT_PRIMITIVE_TYPE */
|
||||||
|
|
@ -188,6 +190,9 @@ static void si_emit_draw_registers(struct si_context *sctx,
|
||||||
r600_write_config_reg(cs, R_008958_VGT_PRIMITIVE_TYPE, prim);
|
r600_write_config_reg(cs, R_008958_VGT_PRIMITIVE_TYPE, prim);
|
||||||
r600_write_context_reg(cs, R_028AA8_IA_MULTI_VGT_PARAM, ia_multi_vgt_param);
|
r600_write_context_reg(cs, R_028AA8_IA_MULTI_VGT_PARAM, ia_multi_vgt_param);
|
||||||
}
|
}
|
||||||
|
sctx->last_prim = prim;
|
||||||
|
sctx->last_multi_vgt_param = ia_multi_vgt_param;
|
||||||
|
}
|
||||||
|
|
||||||
if (gs_out_prim != sctx->last_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);
|
r600_write_context_reg(cs, R_028A6C_VGT_GS_OUT_PRIM_TYPE, gs_out_prim);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue