From c4ddf67ee17aa5bdbf8cdf0e5f9eb6c5ad85e28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 25 Nov 2020 03:20:52 -0500 Subject: [PATCH] radeonsi: don't invalidate emitted NUM_INSTANCES for u_blitter invalidate_draw_sh_constants should invalidate only SGPRs. invalidate_draw_constants invalidates SGPRs and NUM_INSTANCES. u_blitter called invalidate_draw_sh_constants, which previously invalidated NUM_INSTANCES as well. This commit fixes that. Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_gfx_cs.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.h | 5 +++++ src/gallium/drivers/radeonsi/si_state_draw.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index 18cd4e63bde..df554473bd5 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -536,7 +536,7 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs) /* Invalidate various draw states so that they are emitted before * the first draw call. */ - si_invalidate_draw_sh_constants(ctx); + si_invalidate_draw_constants(ctx); ctx->last_index_size = -1; ctx->last_primitive_restart_en = -1; ctx->last_restart_index = SI_RESTART_INDEX_UNKNOWN; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index d14fe6916dd..34589112c95 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1634,6 +1634,11 @@ static inline void si_context_add_resource_size(struct si_context *sctx, struct static inline void si_invalidate_draw_sh_constants(struct si_context *sctx) { sctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN; +} + +static inline void si_invalidate_draw_constants(struct si_context *sctx) +{ + si_invalidate_draw_sh_constants(sctx); sctx->last_instance_count = SI_INSTANCE_COUNT_UNKNOWN; } diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 4235731df0d..f1565f497e8 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -901,7 +901,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw assert(indirect_va % 8 == 0); - si_invalidate_draw_sh_constants(sctx); + si_invalidate_draw_constants(sctx); radeon_emit(cs, PKT3(PKT3_SET_BASE, 2, 0)); radeon_emit(cs, 1);