mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02: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_restart_index = SI_RESTART_INDEX_UNKNOWN;
|
||||
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_restart_index;
|
||||
int last_gs_out_prim;
|
||||
int last_prim;
|
||||
int last_multi_vgt_param;
|
||||
};
|
||||
|
||||
/* si_blit.c */
|
||||
|
|
|
|||
|
|
@ -179,14 +179,19 @@ static void si_emit_draw_registers(struct si_context *sctx,
|
|||
unsigned ia_multi_vgt_param = si_get_ia_multi_vgt_param(sctx, info);
|
||||
|
||||
/* Draw state. */
|
||||
if (sctx->b.chip_class >= CIK) {
|
||||
radeon_emit(cs, PKT3(PKT3_DRAW_PREAMBLE, 2, 0));
|
||||
radeon_emit(cs, prim); /* VGT_PRIMITIVE_TYPE */
|
||||
radeon_emit(cs, ia_multi_vgt_param); /* IA_MULTI_VGT_PARAM */
|
||||
radeon_emit(cs, 0); /* VGT_LS_HS_CONFIG */
|
||||
} else {
|
||||
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);
|
||||
if (prim != sctx->last_prim ||
|
||||
ia_multi_vgt_param != sctx->last_multi_vgt_param) {
|
||||
if (sctx->b.chip_class >= CIK) {
|
||||
radeon_emit(cs, PKT3(PKT3_DRAW_PREAMBLE, 2, 0));
|
||||
radeon_emit(cs, prim); /* VGT_PRIMITIVE_TYPE */
|
||||
radeon_emit(cs, ia_multi_vgt_param); /* IA_MULTI_VGT_PARAM */
|
||||
radeon_emit(cs, 0); /* VGT_LS_HS_CONFIG */
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
sctx->last_prim = prim;
|
||||
sctx->last_multi_vgt_param = ia_multi_vgt_param;
|
||||
}
|
||||
|
||||
if (gs_out_prim != sctx->last_gs_out_prim) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue