diff options
author | Timothy Arceri <[email protected]> | 2016-02-11 15:14:21 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-02-12 09:12:23 +1100 |
commit | b60024703531119c42468f49a08491206f3202fb (patch) | |
tree | 1b5cc020b63b93490512127564ac3ec4270689db /src | |
parent | 98d3cc9fbcdf4f630921a763261925d91bd04053 (diff) |
glsl: don't validate interface blocks twice
We already check for opaque types so don't recheck for atomics
and images.
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 38336729cea..dbeb5c0ad40 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -6303,30 +6303,28 @@ ast_process_struct_or_iface_block_members(exec_list *instructions, */ assert(decl_type); - if (is_interface && decl_type->contains_opaque()) { - _mesa_glsl_error(&loc, state, - "uniform/buffer in non-default interface block contains " - "opaque variable"); - } - - if (decl_type->contains_atomic()) { - /* From section 4.1.7.3 of the GLSL 4.40 spec: - * - * "Members of structures cannot be declared as atomic counter - * types." - */ - _mesa_glsl_error(&loc, state, "atomic counter in structure, " - "shader storage block or uniform block"); - } + if (is_interface) { + if (decl_type->contains_opaque()) { + _mesa_glsl_error(&loc, state, "uniform/buffer in non-default " + "interface block contains opaque variable"); + } + } else { + if (decl_type->contains_atomic()) { + /* From section 4.1.7.3 of the GLSL 4.40 spec: + * + * "Members of structures cannot be declared as atomic counter + * types." + */ + _mesa_glsl_error(&loc, state, "atomic counter in structure"); + } - if (decl_type->contains_image()) { - /* FINISHME: Same problem as with atomic counters. - * FINISHME: Request clarification from Khronos and add - * FINISHME: spec quotation here. - */ - _mesa_glsl_error(&loc, state, - "image in structure, shader storage block or " - "uniform block"); + if (decl_type->contains_image()) { + /* FINISHME: Same problem as with atomic counters. + * FINISHME: Request clarification from Khronos and add + * FINISHME: spec quotation here. + */ + _mesa_glsl_error(&loc, state, "image in structure"); + } } if (qual->flags.q.explicit_binding) { |