Mesa (main): radeonsi: remove the chip_class dimension from the draw_vbo array

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 21:44:44 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Jun 13 21:13:39 2021 -0400

radeonsi: remove the chip_class dimension from the draw_vbo array

We don't use/initialize draw_vbo callbacks for other generations anymore.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11384>

---

 src/gallium/drivers/radeonsi/si_pipe.h         | 5 ++---
 src/gallium/drivers/radeonsi/si_state_draw.cpp | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index b823faec41d..2af9365a656 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1285,7 +1285,7 @@ struct si_context {
     */
    struct hash_table *dirty_implicit_resources;
 
-   pipe_draw_vbo_func draw_vbo[NUM_GFX_VERSIONS - GFX6][2][2][2][2];
+   pipe_draw_vbo_func draw_vbo[2][2][2][2];
    /* When b.draw_vbo is a wrapper, real_draw_vbo is the real draw_vbo function */
    pipe_draw_vbo_func real_draw_vbo;
 
@@ -2021,8 +2021,7 @@ static inline unsigned si_get_shader_wave_size(struct si_shader *shader)
 
 static inline void si_select_draw_vbo(struct si_context *sctx)
 {
-   pipe_draw_vbo_func draw_vbo = sctx->draw_vbo[sctx->chip_class - GFX6]
-                                               [!!sctx->shader.tes.cso]
+   pipe_draw_vbo_func draw_vbo = sctx->draw_vbo[!!sctx->shader.tes.cso]
                                                [!!sctx->shader.gs.cso]
                                                [sctx->ngg]
                                                [si_compute_prim_discard_enabled(sctx)];
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index f7a286db54c..59cd90d09ef 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -2321,7 +2321,7 @@ static void si_init_draw_vbo(struct si_context *sctx)
    if (NGG && GFX_VERSION < GFX10)
       return;
 
-   sctx->draw_vbo[GFX_VERSION - GFX6][HAS_TESS][HAS_GS][NGG][ALLOW_PRIM_DISCARD_CS] =
+   sctx->draw_vbo[HAS_TESS][HAS_GS][NGG][ALLOW_PRIM_DISCARD_CS] =
       si_draw_vbo<GFX_VERSION, HAS_TESS, HAS_GS, NGG, ALLOW_PRIM_DISCARD_CS>;
 }
 



More information about the mesa-commit mailing list