From 6c1f6f8291859209a9b585f65258e090d91f0347 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Dec 2014 10:54:13 +0200 Subject: glsl: Error out on invalid uses of the early_fragment_tests layout qualifier. Reviewed-by: Matt Turner --- src/glsl/ast_to_hir.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/glsl/ast_to_hir.cpp') diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index fa05c6565bc..7051d93149e 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2802,6 +2802,20 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, } apply_image_qualifier_to_variable(qual, var, state, loc); + + /* From section 4.4.1.3 of the GLSL 4.50 specification (Fragment Shader + * Inputs): + * + * "Fragment shaders also allow the following layout qualifier on in only + * (not with variable declarations) + * layout-qualifier-id + * early_fragment_tests + * [...]" + */ + if (qual->flags.q.early_fragment_tests) { + _mesa_glsl_error(loc, state, "early_fragment_tests layout qualifier only " + "valid in fragment shader input layout declaration."); + } } /** -- cgit v1.2.3