diff options
author | Samuel Pitoiset <[email protected]> | 2017-04-19 16:40:38 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-06 16:40:19 +0200 |
commit | 75cc83747e711a2b8f6584305d5e383ead4ad6a8 (patch) | |
tree | 0540c5dfbbd1bda8d956030b883bc6b86f4241fc | |
parent | cb405f170bfa7f249dad85a1951a9faa8a250b87 (diff) |
glsl: allow bindless samplers/images as function return
The ARB_bindless_texture spec doesn't clearly state this, but as
it says "Replace Section 4.1.7 (Samplers), p. 25" and,
"Replace Section 4.1.X, (Images)", this should be allowed.
v3: - add 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]>
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index bed07dcbcaa..1c18c7b9c04 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -5764,12 +5764,17 @@ ast_function::hir(exec_list *instructions, * * "[Opaque types] can only be declared as function parameters * or uniform-qualified variables." + * + * The ARB_bindless_texture spec doesn't clearly state this, but as it says + * "Replace Section 4.1.7 (Samplers), p. 25" and, "Replace Section 4.1.X, + * (Images)", this should be allowed. */ - if (return_type->contains_opaque()) { + if (return_type->contains_atomic() || + (!state->has_bindless() && return_type->contains_opaque())) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(&loc, state, - "function `%s' return type can't contain an opaque type", - name); + "function `%s' return type can't contain an %s type", + name, state->has_bindless() ? "atomic" : "opaque"); } /**/ |