[Mesa-dev] [PATCH] glsl: allow layout qualifier overrides with ARB_shading_language_420pack

Timothy Arceri timothy.arceri at collabora.com
Mon May 23 05:42:35 UTC 2016


On Mon, 2016-05-23 at 14:29 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> GLSL 4.20 allows overriding the layout qualifiers.
> 
> This helps fix:
> GL45-CTS.shading_language_420pack.qualifier_override_layout
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

> ---
>  src/compiler/glsl/ast_type.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/ast_type.cpp
> b/src/compiler/glsl/ast_type.cpp
> index c44dcc6..54e9dad 100644
> --- a/src/compiler/glsl/ast_type.cpp
> +++ b/src/compiler/glsl/ast_type.cpp
> @@ -711,7 +711,12 @@
> ast_layout_expression::process_qualifier_constant(struct
> _mesa_glsl_parse_state
>           return false;
>        }
>  
> -      if (!first_pass && *value != const_int->value.u[0]) {
> +      /* 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]) {
>           YYLTYPE loc = const_expression->get_location();
>           _mesa_glsl_error(&loc, state, "%s layout qualifier does not
> "
>  		          "match previous declaration (%d vs %d)",


More information about the mesa-dev mailing list