diff options
author | Iago Toral Quiroga <[email protected]> | 2017-09-11 14:19:41 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-09-12 09:16:05 +0200 |
commit | 51bf007d2c27fbad6dac590c72f0fc4860e3fa02 (patch) | |
tree | f9a5e14833e31ac9e3d5a19a673183e5a0b5bd79 | |
parent | ea314bf812b7c5151c13031dcd08f8517aa59d59 (diff) |
glsl: Disallow unsized array of atomic_uint
This was a bugfix to the spec addressed in OpenGL 4.5 (revision
7 of the spec) and there is a CTS test to check this.
Fixes:
KHR-GL45.shader_atomic_counters.negative-unsized-array
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 98d2f94e129..9ded2cbda7f 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.60 spec: + * + * "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. |