Mesa (master): glsl: Set .flat for gl_FrontFacing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 30 20:09:37 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon Dec 30 11:40:29 2019 -0500

glsl: Set .flat for gl_FrontFacing

It is a boolean.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at 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 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index ef8aca76e0c..cf2a233d15f 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -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)




More information about the mesa-commit mailing list