diff options
author | Samuel Pitoiset <[email protected]> | 2017-04-19 16:46:14 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-06 16:40:19 +0200 |
commit | e1eb30975ac43a6332fa38079b1d813363baf6c0 (patch) | |
tree | a89588a5c6f1afd6ced104cbe8e6ef7969fdbd48 /src/compiler/glsl | |
parent | 75cc83747e711a2b8f6584305d5e383ead4ad6a8 (diff) |
glsl: allow bindless samplers/images inside interface blocks
From section 4.3.7 of the ARB_bindless_texture spec:
"(remove the following bullet from the last list on p. 39, thereby
permitting sampler types in interface blocks; image types are also
permitted in blocks by this extension)"
* sampler types are not allowed
v3: - update the spec comment
- update the glsl error message
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 1c18c7b9c04..25e473c814c 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -6965,9 +6965,19 @@ ast_process_struct_or_iface_block_members(exec_list *instructions, assert(decl_type); if (is_interface) { - if (decl_type->contains_opaque()) { + /* From section 4.3.7 of the ARB_bindless_texture spec: + * + * "(remove the following bullet from the last list on p. 39, + * thereby permitting sampler types in interface blocks; image + * types are also permitted in blocks by this extension)" + * + * * sampler types are not allowed + */ + if (decl_type->contains_atomic() || + (!state->has_bindless() && decl_type->contains_opaque())) { _mesa_glsl_error(&loc, state, "uniform/buffer in non-default " - "interface block contains opaque variable"); + "interface block contains %s variable", + state->has_bindless() ? "atomic" : "opaque"); } } else { if (decl_type->contains_atomic()) { |