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

Author: Marek Olšák <[email protected]>
Date:   Thu Sep 23 08:05:04 2021 -0400

radeonsi: set vs_uses_base_instance using C++ template arguments

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

---

 src/gallium/drivers/radeonsi/si_state_draw.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp 
b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index 80cb3ac3409..78ddd564e53 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -217,10 +217,12 @@ static bool si_update_shaders(struct si_context *sctx)
       }
    }
 
-   sctx->vs_uses_base_instance =
-      sctx->shader.vs.current ? sctx->shader.vs.current->uses_base_instance :
-      sctx->queued.named.hs ? sctx->queued.named.hs->uses_base_instance :
-      sctx->shader.gs.current->uses_base_instance;
+   if (GFX_VERSION >= GFX9 && HAS_TESS)
+      sctx->vs_uses_base_instance = sctx->queued.named.hs->uses_base_instance;
+   else if (GFX_VERSION >= GFX9 && HAS_GS)
+      sctx->vs_uses_base_instance = 
sctx->shader.gs.current->uses_base_instance;
+   else
+      sctx->vs_uses_base_instance = 
sctx->shader.vs.current->uses_base_instance;
 
    union si_vgt_stages_key key;
    key.index = 0;

Reply via email to