diff options
author | Rhys Perry <[email protected]> | 2018-06-06 20:55:06 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-08-01 00:10:01 -0400 |
commit | ea2a3f52b4acee0378e02414b9c39e3f0c66cbf1 (patch) | |
tree | 0078ef5bd2cb08b41daa512f6b6c4ffddddab425 /src/compiler | |
parent | 42d4acb39dbdc11645a3a7e4f9d6f1ca080bcf04 (diff) |
glsl: allow ?: operator with images and samplers when bindless is enabled
Signed-off-by: Rhys Perry <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index dd60a2a87fd..74160ec142b 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -1850,9 +1850,11 @@ ast_expression::do_hir(exec_list *instructions, * expressions; such use results in a compile-time error." */ if (type->contains_opaque()) { - _mesa_glsl_error(&loc, state, "opaque variables cannot be operands " - "of the ?: operator"); - error_emitted = true; + if (!(state->has_bindless() && (type->is_image() || type->is_sampler()))) { + _mesa_glsl_error(&loc, state, "variables of type %s cannot be " + "operands of the ?: operator", type->name); + error_emitted = true; + } } ir_constant *cond_val = op[0]->constant_expression_value(ctx); |