compiler: add a new explicit interpolation mode
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 24 Jan 2020 09:14:42 +0000 (10:14 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 09:49:50 +0000 (09:49 +0000)
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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3578>

src/compiler/glsl/ir_print_visitor.cpp
src/compiler/glsl_types.h
src/compiler/nir/nir.h
src/compiler/shader_enums.c
src/compiler/shader_enums.h

index 2eaebb21d479b5677d4de170b208fb469a884ca7..86120e19b1934db0a1fb032e3b794d846d1f9afb 100644 (file)
@@ -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) ",
index 28d4ad481eabcc0a1a302620f59fc92d2bb67fc6..d5bb8dd6973e4751b03b37dbf45c24ce3fc9f20c 100644 (file)
@@ -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
index c68fef5f1ccac9748f3e31d6d35aa910cdd2521c..8c0a0f03b7a480f1e991e22597e6e28f936d0d8d 100644 (file)
@@ -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
index 7b908eab6f609af2324be7430a62f0552190b30e..90b9881ff78a252588073cf0aea8a106f7dfdf73 100644 (file)
@@ -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);
index 07f96f3733cfb116ff1176df220f1cc1bd25e706..86ae5e9b87afa48de58a7bf196f6cc9da2541e4d 100644 (file)
@@ -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 */
 };