Module: Mesa
Branch: main
Commit: aafef61f6a37e22f989eef10fd70399d787ba874
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aafef61f6a37e22f989eef10fd70399d787ba874

Author: Marek Olšák <[email protected]>
Date:   Sat Jun 10 22:07:40 2023 -0400

radeonsi/gfx11: fix GLCTS with register shadowing by keeping the CS preamble

Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23517>

---

 src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c 
b/src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c
index 2d73740d43f..aaae69f6e27 100644
--- a/src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c
+++ b/src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c
@@ -76,11 +76,15 @@ void si_init_cp_reg_shadowing(struct si_context *sctx)
                                    RADEON_USAGE_READWRITE | 
RADEON_PRIO_DESCRIPTORS);
       si_pm4_emit(sctx, shadowing_preamble);
       ac_emulate_clear_state(&sctx->screen->info, &sctx->gfx_cs, 
si_set_context_reg_array);
-      si_pm4_emit(sctx, sctx->cs_preamble_state);
 
-      /* The register values are shadowed, so we won't need to set them again. 
*/
-      si_pm4_free_state(sctx, sctx->cs_preamble_state, ~0);
-      sctx->cs_preamble_state = NULL;
+      /* TODO: Gfx11 fails GLCTS if we don't re-emit the preamble at the 
beginning of every IB. */
+      if (sctx->gfx_level < GFX11) {
+         si_pm4_emit(sctx, sctx->cs_preamble_state);
+
+         /* The register values are shadowed, so we won't need to set them 
again. */
+         si_pm4_free_state(sctx, sctx->cs_preamble_state, ~0);
+         sctx->cs_preamble_state = NULL;
+      }
 
       si_set_tracked_regs_to_clear_state(sctx);
 

Reply via email to