}
type = glsl_type::bool_type;
} else {
+ ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
+ "and_tmp");
+ instructions->push_tail(tmp);
+
ir_if *const stmt = new(ctx) ir_if(op[0]);
instructions->push_tail(stmt);
error_emitted = true;
}
- ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
- "and_tmp");
- instructions->push_tail(tmp);
-
ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp);
ir_assignment *const then_assign =
new(ctx) ir_assignment(then_deref, op[1], NULL);
}
type = glsl_type::bool_type;
} else {
- ir_if *const stmt = new(ctx) ir_if(op[0]);
- instructions->push_tail(stmt);
-
ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
"or_tmp");
instructions->push_tail(tmp);
+ ir_if *const stmt = new(ctx) ir_if(op[0]);
+ instructions->push_tail(stmt);
+
op[1] = this->subexpressions[1]->hir(&stmt->then_instructions, state);
if (!op[1]->type->is_boolean() || !op[1]->type->is_scalar()) {