Mesa (master): compiler: Drop now unused gl_varying_slot_name()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 13 01:10:18 UTC 2021


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Thu Feb 11 12:35:44 2021 -0800

compiler: Drop now unused gl_varying_slot_name()

There's reuse of values depending on the stage, so a function that
just takes the value might produce invalid results.  All the codebase
was already changed to use the gl_varying_slot_name_for_stage()
instead.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8998>

---

 src/compiler/shader_enums.c | 13 ++++---------
 src/compiler/shader_enums.h |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c
index d6fe197fa0f..7c53a09ce9b 100644
--- a/src/compiler/shader_enums.c
+++ b/src/compiler/shader_enums.c
@@ -155,8 +155,11 @@ gl_vert_attrib_name(gl_vert_attrib attrib)
 }
 
 const char *
-gl_varying_slot_name(gl_varying_slot slot)
+gl_varying_slot_name_for_stage(gl_varying_slot slot, gl_shader_stage stage)
 {
+   if (stage != MESA_SHADER_FRAGMENT && slot == VARYING_SLOT_PRIMITIVE_SHADING_RATE)
+      return "VARYING_SLOT_PRIMITIVE_SHADING_RATE";
+
    static const char *names[] = {
       ENUM(VARYING_SLOT_POS),
       ENUM(VARYING_SLOT_COL0),
@@ -227,14 +230,6 @@ gl_varying_slot_name(gl_varying_slot slot)
    return NAME(slot);
 }
 
-const char *
-gl_varying_slot_name_for_stage(gl_varying_slot slot, gl_shader_stage stage)
-{
-   if (stage != MESA_SHADER_FRAGMENT && slot == VARYING_SLOT_PRIMITIVE_SHADING_RATE)
-      return "VARYING_SLOT_PRIMITIVE_SHADING_RATE";
-   return gl_varying_slot_name(slot);
-}
-
 const char *
 gl_system_value_name(gl_system_value sysval)
 {
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index f76d863839a..1af7f122efb 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -253,6 +253,7 @@ const char *gl_vert_attrib_name(gl_vert_attrib attrib);
  * - vertResults (in prog_print.c's arb_output_attrib_string())
  * - fragAttribs (in prog_print.c's arb_input_attrib_string())
  * - _mesa_varying_slot_in_fs()
+ * - _mesa_varying_slot_name_for_stage()
  */
 typedef enum
 {
@@ -332,7 +333,6 @@ typedef enum
 #define VARYING_SLOT_TESS_MAX	(VARYING_SLOT_PATCH0 + MAX_VARYING)
 #define MAX_VARYINGS_INCL_PATCH (VARYING_SLOT_TESS_MAX - VARYING_SLOT_VAR0)
 
-const char *gl_varying_slot_name(gl_varying_slot slot);
 const char *gl_varying_slot_name_for_stage(gl_varying_slot slot,
                                            gl_shader_stage stage);
 



More information about the mesa-commit mailing list