summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-04-19 16:38:39 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-05-06 16:40:19 +0200
commitcb405f170bfa7f249dad85a1951a9faa8a250b87 (patch)
treee708cd87d57b556f07329950c4f76af9e06eb38e /src/compiler
parent4c084f18fdfde8c7bd734735cb005a73f0b2b8ca (diff)
glsl: allow bindless samplers/images as out and inout parameters
From section 4.1.7 of the ARB_bindless_texture spec: "Samplers can be used as l-values, so can be assigned into and used as "out" and "inout" function parameters." From section 4.1.X of the ARB_bindless_texture spec: "Images can be used as l-values, so can be assigned into and used as "out" and "inout" function parameters." v3: - add spec comment - update the glsl error message Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b8fffc1c0e7..bed07dcbcaa 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -5577,11 +5577,23 @@ ast_parameter_declarator::hir(exec_list *instructions,
* "Opaque variables cannot be treated as l-values; hence cannot
* be used as out or inout function parameters, nor can they be
* assigned into."
+ *
+ * From section 4.1.7 of the ARB_bindless_texture spec:
+ *
+ * "Samplers can be used as l-values, so can be assigned into and used
+ * as "out" and "inout" function parameters."
+ *
+ * From section 4.1.X of the ARB_bindless_texture spec:
+ *
+ * "Images can be used as l-values, so can be assigned into and used as
+ * "out" and "inout" function parameters."
*/
if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out)
- && type->contains_opaque()) {
+ && (type->contains_atomic() ||
+ (!state->has_bindless() && type->contains_opaque()))) {
_mesa_glsl_error(&loc, state, "out and inout parameters cannot "
- "contain opaque variables");
+ "contain %s variables",
+ state->has_bindless() ? "atomic" : "opaque");
type = glsl_type::error_type;
}