aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.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/ast_to_hir.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/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index e451bda8016..e07e5f509b5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -3245,6 +3245,9 @@ apply_explicit_location(const struct ast_type_qualifier *qual,
"compute shader variables cannot be given "
"explicit locations");
return;
+ default:
+ fail = true;
+ break;
};
if (fail) {
@@ -3276,7 +3279,7 @@ apply_explicit_location(const struct ast_type_qualifier *qual,
? (qual_location + FRAG_RESULT_DATA0)
: (qual_location + VARYING_SLOT_VAR0);
break;
- case MESA_SHADER_COMPUTE:
+ default:
assert(!"Unexpected shader type");
break;
}
@@ -4089,6 +4092,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
case MESA_SHADER_COMPUTE:
/* Invariance isn't meaningful in compute shaders. */
break;
+ default:
+ break;
}
}