[Mesa-dev] [PATCH v4 00/13] deal with multiple appearances of the same layout-qualifier-name in a single declaration
Andres Gomez
agomez at igalia.com
Mon Nov 14 17:15:01 UTC 2016
In the case of layout-qualifier-names that can appear multiple times
in different declarations of the same shader or, even, the same
program, but that have to consistently hold the same value we are
using the ast_layout_expression class which holds a list to store all
the appearances to be able to check for coherence later.
Until now, we were also holding inside the ast_layout_expression
values of the same layout-qualifier-name that could appear inside a
single layout-qualifier or across multiple layout-qualifiers in a
single declaration.
This was a problem since, inside a declaration, only the last
appearance should be taken into account. As we were not doing this,
the compilation or linking was failing due to different values of the
same layout-qualifier-name in a single declaration when such
layout-qualifier-name had as a constraint to hold the same value
across the same shader or program.
Now, we only hold the last appearanace of a repeated
layout-qualifier-name inside a single declaration.
These following 2 example will help to illustrate the problem:
- " #version 150
#extension GL_ARB_shading_language_420pack: enable
#extension GL_ARB_enhanced_layouts: enable
layout(max_vertices=2, max_vertices=3) out;
layout(max_vertices=3) out;"
- " #version 150
#extension GL_ARB_shading_language_420pack: enable
#extension GL_ARB_enhanced_layouts: enable
layout(max_vertices=2) layout(max_vertices=3) out;
layout(max_vertices=3) out;"
Although different values for "max_vertices" should result in a
compilation error. The above code is valid because max_vertices=2 is
ignored.
The main changes in this v4 series are:
New patch 3/13.
New patch 4/13.
New patch 5/13.
New patch 6/13.
New patch 7/13.
Old patch v3 8/8 is now patch 9/13 to be closer in the log history
with the other related changes.
Fixes:
- GL44-CTS.shading_language_420pack.qualifier_override_layout
- GL44-CTS.enhanced_layouts.xfb_duplicated_stride
Andres Gomez (13):
glsl: ignore all but the rightmost layout-qualifier-name
glsl: merge layouts into the default one as the last step in interface
blocks
glsl: Split default out layout qualifier merge
glsl: Split default in layout qualifier merge
glsl: simplifies the merge of the default in layout qualifier
glsl: Remove unneeded check for incompatible primitive types in GS
glsl: Add comments for the point mode layout-id-qualifier validation
glsl: ignore all but the rightmost layout qualifier name from the
rightmost layout qualifier
glsl: simplified ast_type_qualifier::merge_into_[in|out]_qualifier API
glsl: simplified error checking for duplicated layout-qualifiers
glsl: push layout-qualifier-name values from variable declarations to
global
Revert "glsl: geom shader max_vertices layout must match."
Revert "glsl: allow layout qualifier overrides with
ARB_shading_language_420pack"
src/compiler/glsl/ast.h | 53 +++--
src/compiler/glsl/ast_to_hir.cpp | 13 +-
src/compiler/glsl/ast_type.cpp | 360 ++++++++++++++++++-------------
src/compiler/glsl/glsl_parser.yy | 184 ++++++++--------
src/compiler/glsl/glsl_parser_extras.cpp | 22 +-
5 files changed, 362 insertions(+), 270 deletions(-)
--
2.9.3
More information about the mesa-dev
mailing list