Mesa (master): compiler: add a new explicit interpolation mode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 29 10:32:54 UTC 2020


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Jan 24 10:14:42 2020 +0100

compiler: add a new explicit interpolation mode

This introduces one more interpolation mode INTERP_MODE_EXPLICIT,
which is needed for AMD_shader_explicit_vertex_parameter.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3578>

---

 src/compiler/glsl/ir_print_visitor.cpp | 2 +-
 src/compiler/glsl_types.h              | 2 +-
 src/compiler/nir/nir.h                 | 2 +-
 src/compiler/shader_enums.c            | 1 +
 src/compiler/shader_enums.h            | 1 +
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index 2eaebb21d47..86120e19b19 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -213,7 +213,7 @@ void ir_print_visitor::visit(ir_variable *ir)
                                 "in ", "out ", "inout ",
 			        "const_in ", "sys ", "temporary " };
    STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
-   const char *const interp[] = { "", "smooth", "flat", "noperspective" };
+   const char *const interp[] = { "", "smooth", "flat", "noperspective", "explicit" };
    STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
 
    fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h
index 28d4ad481ea..d5bb8dd6973 100644
--- a/src/compiler/glsl_types.h
+++ b/src/compiler/glsl_types.h
@@ -1254,7 +1254,7 @@ struct glsl_struct_field {
     * For interface blocks, the interpolation mode (as in
     * ir_variable::interpolation).  0 otherwise.
     */
-   unsigned interpolation:2;
+   unsigned interpolation:3;
 
    /**
     * For interface blocks, 1 if this variable uses centroid interpolation (as
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index c68fef5f1cc..8c0a0f03b7a 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -378,7 +378,7 @@ typedef struct nir_variable {
        *
        * \sa glsl_interp_mode
        */
-      unsigned interpolation:2;
+      unsigned interpolation:3;
 
       /**
        * If non-zero, then this variable may be packed along with other variables
diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c
index 7b908eab6f6..90b9881ff78 100644
--- a/src/compiler/shader_enums.c
+++ b/src/compiler/shader_enums.c
@@ -269,6 +269,7 @@ glsl_interp_mode_name(enum glsl_interp_mode qual)
       ENUM(INTERP_MODE_SMOOTH),
       ENUM(INTERP_MODE_FLAT),
       ENUM(INTERP_MODE_NOPERSPECTIVE),
+      ENUM(INTERP_MODE_EXPLICIT),
    };
    STATIC_ASSERT(ARRAY_SIZE(names) == INTERP_MODE_COUNT);
    return NAME(qual);
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 07f96f3733c..86ae5e9b87a 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -667,6 +667,7 @@ enum glsl_interp_mode
    INTERP_MODE_SMOOTH,
    INTERP_MODE_FLAT,
    INTERP_MODE_NOPERSPECTIVE,
+   INTERP_MODE_EXPLICIT,
    INTERP_MODE_COUNT /**< Number of interpolation qualifiers */
 };
 



More information about the mesa-commit mailing list