[Mesa-dev] [PATCH] glsl: Fix merging of layout(invocations) with other qualifiers

Jordan Justen jljusten at gmail.com
Wed Jul 2 15:32:18 PDT 2014


Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On Fri, Jun 27, 2014 at 2:21 AM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> If another layout qualifier appeared to the left of `invocations` in the
> GS input layout declaration, the invocation count would be dropped on
> the floor.
>
> Fixes the piglit test:
>
> spec/ARB_transform_feedback3/arb_transform_feedback3-ext_interleaved_two_bufs_gs_max
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> Cc: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> Note that the handling of the special rules for layout declarations in general is a bit of a disaster -- merge_in_qualifier tries to do the right thing, but merge_qualifier still ends up coming into play in various cases. It's probably better to dispose of the distinction within the parser, and disallow qualifiers appearing in the wrong contexts later. (This is what is already done to disallow layout-declaration-only qualifiers on variables)
>
>  src/glsl/ast_type.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
> index 77053d5..ddd1f4e 100644
> --- a/src/glsl/ast_type.cpp
> +++ b/src/glsl/ast_type.cpp
> @@ -154,6 +154,16 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
>        this->max_vertices = q.max_vertices;
>     }
>
> +   if (q.flags.q.invocations) {
> +      if (this->flags.q.invocations && this->invocations != q.invocations) {
> +         _mesa_glsl_error(loc, state,
> +                          "geometry shader set conflicting invocations "
> +                          "(%d and %d)", this->invocations, q.invocations);
> +         return false;
> +      }
> +      this->invocations = q.invocations;
> +   }
> +
>     if ((q.flags.i & ubo_mat_mask.flags.i) != 0)
>        this->flags.i &= ~ubo_mat_mask.flags.i;
>     if ((q.flags.i & ubo_layout_mask.flags.i) != 0)
> --
> 2.0.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list