glsl: allow ?: operator with images and samplers when bindless is enabled

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Rhys Perry
2018-06-06 20:55:06 +01:00
committed by Marek Olšák
parent 42d4acb39d
commit ea2a3f52b4

View File

@@ -1850,9 +1850,11 @@ ast_expression::do_hir(exec_list *instructions,
* expressions; such use results in a compile-time error." * expressions; such use results in a compile-time error."
*/ */
if (type->contains_opaque()) { if (type->contains_opaque()) {
_mesa_glsl_error(&loc, state, "opaque variables cannot be operands " if (!(state->has_bindless() && (type->is_image() || type->is_sampler()))) {
"of the ?: operator"); _mesa_glsl_error(&loc, state, "variables of type %s cannot be "
error_emitted = true; "operands of the ?: operator", type->name);
error_emitted = true;
}
} }
ir_constant *cond_val = op[0]->constant_expression_value(ctx); ir_constant *cond_val = op[0]->constant_expression_value(ctx);