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

Author: Dave Airlie <[email protected]>
Date:   Tue Jul 26 08:16:00 2022 +1000

gallium/tgsi: reorder pipe shader type defines.

Line these up with Mesa, prepare for fallout.

zink: the one where Mike gets overfriendly with enum layouts.

Reviewed-by: Mike Blumenkrantz <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17747>

---

 src/gallium/auxiliary/tgsi/tgsi_strings.c | 4 ++--
 src/gallium/drivers/radeonsi/si_state.h   | 2 +-
 src/gallium/drivers/zink/zink_context.h   | 4 +++-
 src/gallium/drivers/zink/zink_draw.cpp    | 8 ++++----
 src/gallium/include/pipe/p_defines.h      | 4 ++--
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c 
b/src/gallium/auxiliary/tgsi/tgsi_strings.c
index c282fdcc8c9..ea601e6493f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
@@ -35,10 +35,10 @@
 const char *tgsi_processor_type_names[6] =
 {
    "VERT",
-   "FRAG",
-   "GEOM",
    "TESS_CTRL",
    "TESS_EVAL",
+   "GEOM",
+   "FRAG",
    "COMP"
 };
 
diff --git a/src/gallium/drivers/radeonsi/si_state.h 
b/src/gallium/drivers/radeonsi/si_state.h
index 11b7d06c350..e7569534c76 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -33,7 +33,7 @@
 extern "C" {
 #endif
 
-#define SI_NUM_GRAPHICS_SHADERS (PIPE_SHADER_TESS_EVAL + 1)
+#define SI_NUM_GRAPHICS_SHADERS (PIPE_SHADER_FRAGMENT + 1)
 #define SI_NUM_SHADERS          (PIPE_SHADER_COMPUTE + 1)
 
 #define SI_NUM_VERTEX_BUFFERS SI_MAX_ATTRIBS
diff --git a/src/gallium/drivers/zink/zink_context.h 
b/src/gallium/drivers/zink/zink_context.h
index 81ea3d5575d..30c3151a8c9 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -418,7 +418,9 @@ zink_fb_clear_enabled(const struct zink_context *ctx, 
unsigned idx)
 static inline uint32_t
 zink_program_cache_stages(uint32_t stages_present)
 {
-   return stages_present >> 2;
+   return (stages_present & ((1 << PIPE_SHADER_TESS_CTRL) |
+                             (1 << PIPE_SHADER_TESS_EVAL) |
+                             (1 << PIPE_SHADER_GEOMETRY))) >> 1;
 }
 
 void
diff --git a/src/gallium/drivers/zink/zink_draw.cpp 
b/src/gallium/drivers/zink/zink_draw.cpp
index 22001cc0149..bf6e3e17874 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -1065,10 +1065,10 @@ zink_invalid_launch_grid(struct pipe_context *pctx, 
const struct pipe_grid_info
 }
 
 #define STAGE_BASE 0
-#define STAGE_BASE_GS 1
-#define STAGE_BASE_TES 4
-#define STAGE_BASE_TES_GS 5
-#define STAGE_BASE_TCS_TES 6
+#define STAGE_BASE_GS 4
+#define STAGE_BASE_TES 2
+#define STAGE_BASE_TES_GS 6
+#define STAGE_BASE_TCS_TES 3
 #define STAGE_BASE_TCS_TES_GS 7
 
 template <unsigned STAGE_MASK>
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index dd486ff13b1..eeaa8a30c5d 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -551,10 +551,10 @@ enum pipe_resource_usage {
  */
 enum pipe_shader_type {
    PIPE_SHADER_VERTEX,
-   PIPE_SHADER_FRAGMENT,
-   PIPE_SHADER_GEOMETRY,
    PIPE_SHADER_TESS_CTRL,
    PIPE_SHADER_TESS_EVAL,
+   PIPE_SHADER_GEOMETRY,
+   PIPE_SHADER_FRAGMENT,
    PIPE_SHADER_COMPUTE,
    PIPE_SHADER_TYPES,
 };

Reply via email to