summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-09-25 11:01:07 -0700
committerIan Romanick <[email protected]>2013-10-30 13:49:29 -0700
commit2cb760d9945b30bed027a14c2a9ac20d07d7c5ba (patch)
tree6e445d03537e4f841b0c78a76e50b5478d4202f6 /src/glsl/ast_to_hir.cpp
parent8f00a77fbc611f472ffda7a8181950519cc71ccb (diff)
glsl: Eliminate the global check in validate_explicit_location
Since the separation of ir_var_function_in and ir_var_shader_in (similar for out), this check is no longer necessary. Previously, global_scope was the only way to tell which was which. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index e1f987b4e51..d30463aa613 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2052,7 +2052,6 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
struct _mesa_glsl_parse_state *state,
YYLTYPE *loc)
{
- const bool global_scope = (state->current_function == NULL);
bool fail = false;
const char *string = "";
@@ -2064,7 +2063,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
*/
switch (state->target) {
case vertex_shader:
- if (!global_scope || (var->mode != ir_var_shader_in)) {
+ if (var->mode != ir_var_shader_in) {
fail = true;
string = "input";
}
@@ -2077,7 +2076,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
return;
case fragment_shader:
- if (!global_scope || (var->mode != ir_var_shader_out)) {
+ if (var->mode != ir_var_shader_out) {
fail = true;
string = "output";
}