[Mesa-dev] [PATCH] glsl: Disallow unsized array of atomic_uint

Kenneth Graunke kenneth at whitecape.org
Tue Sep 12 07:03:50 UTC 2017


On Monday, September 11, 2017 11:15:05 PM PDT Iago Toral Quiroga wrote:
> This was a bugfix to the spec addressed in OpenGL 4.5 and there is
> a CTS test to check this.
> 
> Fixes:
> KHR-GL45.shader_atomic_counters.negative-unsized-array
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index 98d2f94e12..81eeec103b 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5542,6 +5542,17 @@ ast_declarator_list::hir(exec_list *instructions,
>                               "GLSL ES");
>        }
>  
> +      /* Section 4.4.6.1 Atomic Counter Layout Qualifiers of the GLSL 4.50 spec:

Maybe:

"of the 4.50 revision 7 spec says:"

since only the latest version of 4.5 says this?  Or just quote 4.6 :)

> +       *
> +       *    "It is a compile-time error to declare an unsized array of
> +       *     atomic_uint"
> +       */
> +      if (var->type->is_unsized_array() &&
> +          var->type->without_array()->base_type == GLSL_TYPE_ATOMIC_UINT) {
> +         _mesa_glsl_error(& loc, state,
> +                          "Unsized array of atomic_uint is not allowed");
> +      }
> +
>        /* If the declaration is not a redeclaration, there are a few additional
>         * semantic checks that must be applied.  In addition, variable that was
>         * created for the declaration should be added to the IR stream.
> 

Either way,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170912/98cd4a4c/attachment.sig>


More information about the mesa-dev mailing list