glsl: Set .flat for gl_FrontFacing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Dec 2019 16:40:29 +0000 (11:40 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Dec 2019 19:54:50 +0000 (19:54 +0000)
It is a boolean.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3237>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3237>

src/compiler/glsl/builtin_variables.cpp

index ef8aca76e0cc60d99d3c570c6ffb706cb939a7c1..cf2a233d15f96d6e8b41798355699baf46eacb2a 100644 (file)
@@ -1252,10 +1252,13 @@ builtin_variable_generator::generate_fs_special_vars()
       add_input(VARYING_SLOT_POS, vec4_t, frag_coord_precision, "gl_FragCoord");
    }
 
-   if (this->state->ctx->Const.GLSLFrontFacingIsSysVal)
-      add_system_value(SYSTEM_VALUE_FRONT_FACE, bool_t, "gl_FrontFacing");
-   else
-      add_input(VARYING_SLOT_FACE, bool_t, "gl_FrontFacing");
+   if (this->state->ctx->Const.GLSLFrontFacingIsSysVal) {
+      var = add_system_value(SYSTEM_VALUE_FRONT_FACE, bool_t, "gl_FrontFacing");
+      var->data.interpolation = INTERP_MODE_FLAT;
+   } else {
+      var = add_input(VARYING_SLOT_FACE, bool_t, "gl_FrontFacing");
+      var->data.interpolation = INTERP_MODE_FLAT;
+   }
 
    if (state->is_version(120, 100)) {
       if (this->state->ctx->Const.GLSLPointCoordIsSysVal)