summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-09-25 14:36:27 -0700
committerIan Romanick <[email protected]>2013-10-30 13:49:30 -0700
commit5cb80f03142ddcc949f4d208594004cc2bcc4140 (patch)
tree9a1c46daf1808acf5a4140a1445ba568b93e8bad /src/glsl/ast_to_hir.cpp
parent9d6294f5a2337c5aa975c8ac65f775467b51043d (diff)
glsl: Move layout(location) checks to AST-to-HIR conversion
This will simplify the addition of layout(location) qualifiers for separate shader objects. This was validated with new piglit tests arb_explicit_attrib_location/1.30/compiler/not-enabled-01.vert and arb_explicit_attrib_location/1.30/compiler/not-enabled-02.vert. v2: Refactor error checking to check_explicit_attrib_location_allowed and eliminate the gotos. Suggested by Paul. 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.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 68dd7778380..f75e68ce192 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2063,6 +2063,9 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
switch (state->target) {
case vertex_shader:
if (var->mode == ir_var_shader_in) {
+ if (!state->check_explicit_attrib_location_allowed(loc, var))
+ return;
+
break;
}
@@ -2077,6 +2080,9 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
case fragment_shader:
if (var->mode == ir_var_shader_out) {
+ if (!state->check_explicit_attrib_location_allowed(loc, var))
+ return;
+
break;
}
@@ -2126,6 +2132,8 @@ validate_explicit_location(const struct ast_type_qualifier *qual,
}
}
}
+
+ return;
}
static void