summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2017-05-31 19:56:56 -0500
committerRob Herring <[email protected]>2017-06-08 07:26:04 -0500
commitada3c3aa3da5d04bd597014dc1b5d4b028313513 (patch)
tree17c7f2e142110692347e22daca5b8a95bb16f939 /src/compiler/glsl/link_varyings.cpp
parent6150ea794b9589ea1aba1c672673cf096140364f (diff)
glsl: Fix gl_shader_stage enum unsigned comparison
Replace -1 with MESA_SHADER_NONE enum value to fix sign related warning: external/mesa3d/src/compiler/glsl/link_varyings.cpp:1415:25: warning: comparison of constant -1 with expression of type 'gl_shader_stage' is always true [-Wtautological-constant-out-of-range-compare] (consumer_stage != -1 && consumer_stage != MESA_SHADER_FRAGMENT))) { ~~~~~~~~~~~~~~ ^ ~~ Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Rob Herring <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index d04f546c243..910e2eda82b 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1412,7 +1412,7 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
if (!disable_varying_packing &&
(needs_flat_qualifier ||
- (consumer_stage != -1 && consumer_stage != MESA_SHADER_FRAGMENT))) {
+ (consumer_stage != MESA_SHADER_NONE && consumer_stage != MESA_SHADER_FRAGMENT))) {
/* Since this varying is not being consumed by the fragment shader, its
* interpolation type varying cannot possibly affect rendering.
* Also, this variable is non-flat and is (or contains) an integer
@@ -2170,8 +2170,8 @@ assign_varying_locations(struct gl_context *ctx,
varying_matches matches(disable_varying_packing, xfb_enabled,
ctx->Extensions.ARB_enhanced_layouts,
- producer ? producer->Stage : (gl_shader_stage)-1,
- consumer ? consumer->Stage : (gl_shader_stage)-1);
+ producer ? producer->Stage : MESA_SHADER_NONE,
+ consumer ? consumer->Stage : MESA_SHADER_NONE);
hash_table *tfeedback_candidates =
_mesa_hash_table_create(NULL, _mesa_key_hash_string,
_mesa_key_string_equal);