From: Andres Gomez Date: Sat, 22 Oct 2016 14:22:13 +0000 (+0300) Subject: Revert "glsl: allow layout qualifier overrides with ARB_shading_language_420pack" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b27be186cb9001cd6a062f2179974ef95b273734;p=mesa.git Revert "glsl: allow layout qualifier overrides with ARB_shading_language_420pack" This reverts commit aaa69c79cd584db4d9c6ea7794e93d29f3d54572. The commit was erroneous because the ast_layout_expression class is meant to hold a list used for an after check that all the declared values for a layout-qualifier-name are consistent. Therefore, the check for the possibility of duplicated values was previously fixed to happen much sooner, in the GLSL parser and the merge of layout qualifiers, and the process_qualifier_constant method only needs to check that the values are consistent. By now, those layout-qualifier-name represented as a ast_layout_expression are "max_vertices", "invocations", "vertices", "local_size_[x|y|z]" and "xfb_stride". From page 40 (page 46 of the PDF) of the GLSL 1.50 spec: " All geometry shader output layout declarations in a program must declare the same layout and same value for max_vertices." From page 44 (page 50 of the PDF) of the GLSL 4.00 spec: " If an invocation count is declared, all such declarations must specify the same count." From page 47 (page 53 of the PDF) of the GLSL 4.00 spec: " All tessellation control shader layout declarations in a program must specify the same output patch vertex count." From page 60 (page 66 of the PDF) of the GLSL 4.30 spec: " Also, if such a layout qualifier is declared more than once in the same shader, all those declarations must set the same set of local work-group sizes and set them to the same values; otherwise a compile-time error results. If multiple compute shaders attached to a single program object declare local work-group size, the declarations must be identical; otherwise a link-time error results." From page 73 (page 79 of the PDF) of the GLSL 4.40 spec: " While xfb_stride can be declared multiple times for the same buffer, it is a compile-time or link-time error to have different values specified for the stride for the same buffer." Fixes GL44-CTS.enhanced_layouts.xfb_duplicated_stride Reviewed-by: Timothy Arceri Signed-off-by: Andres Gomez --- diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp index b10ea3b787a..3431e242811 100644 --- a/src/compiler/glsl/ast_type.cpp +++ b/src/compiler/glsl/ast_type.cpp @@ -802,12 +802,7 @@ ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state return false; } - /* From section 4.4 "Layout Qualifiers" of the GLSL 4.50 spec: - * "When the same layout-qualifier-name occurs multiple times, - * in a single declaration, the last occurrence overrides the - * former occurrence(s)." - */ - if (!state->has_420pack() && !first_pass && *value != const_int->value.u[0]) { + if (!first_pass && *value != const_int->value.u[0]) { YYLTYPE loc = const_expression->get_location(); _mesa_glsl_error(&loc, state, "%s layout qualifier does not " "match previous declaration (%d vs %d)",