summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-06-12 21:17:13 +1200
committerChris Forbes <[email protected]>2014-06-26 07:58:25 +1200
commit91b8ecbe1c134604fc87b3761a308b15a6caf394 (patch)
treee13fec2fb13327b3f05f868a242bc8988921ced2 /src/glsl
parentd4703f94460b4571c82167dbe29207c448aeed7c (diff)
glsl: Disallow primitive type layout qualifier on variables.
This only makes any sense on the GS input or output layout declaration, nowhere else. Fixes the piglit tests: * spec/glsl-1.50/compiler/incorrect-in-layout-qualifiers-with-variable-declarations.geom * spec/glsl-1.50/compiler/incorrect-out-layout-qualifiers-with-variable-declarations.geom * spec/glsl-1.50/compiler/layout-fs-no-output.frag * spec/glsl-1.50/compiler/layout-vs-no-input.vert * spec/glsl-1.50/compiler/layout-vs-no-output.vert Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 132a955b781..92e0f90b81c 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2469,6 +2469,13 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
_mesa_shader_stage_to_string(state->stage));
}
+ /* Disallow layout qualifiers which may only appear on layout declarations. */
+ if (qual->flags.q.prim_type) {
+ _mesa_glsl_error(loc, state,
+ "Primitive type may only be specified on GS input or output "
+ "layout declaration, not on variables.");
+ }
+
/* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says:
*
* "However, the const qualifier cannot be used with out or inout."