op[0] = this->subexpressions[0]->hir(instructions, state);
op[1] = this->subexpressions[1]->hir(instructions, state);
- error_emitted = ((op[0]->type == glsl_error_type)
- || (op[1]->type == glsl_error_type));
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
type = op[0]->type;
if (!error_emitted) {
case ast_plus:
op[0] = this->subexpressions[0]->hir(instructions, state);
- error_emitted = (op[0]->type == glsl_error_type);
- if (type == glsl_error_type)
+ error_emitted = op[0]->type->is_error();
+ if (type->is_error())
op[0]->type = type;
result = op[0];
type = unary_arithmetic_result_type(op[0]->type);
- error_emitted = (op[0]->type == glsl_error_type);
+ error_emitted = op[0]->type->is_error();
result = new ir_expression(operations[this->oper], type,
op[0], NULL);
op[0] = this->subexpressions[0]->hir(instructions, state);
op[1] = this->subexpressions[1]->hir(instructions, state);
- error_emitted = ((op[0]->type == glsl_error_type)
- || (op[1]->type == glsl_error_type));
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
type = modulus_result_type(op[0]->type, op[1]->type);
op[0] = this->subexpressions[0]->hir(instructions, state);
op[1] = this->subexpressions[1]->hir(instructions, state);
- error_emitted = ((op[0]->type == glsl_error_type)
- || (op[1]->type == glsl_error_type));
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
type = relational_result_type(op[0]->type, op[1]->type, state);
/* The relational operators must either generate an error or result
* in a scalar boolean. See page 57 of the GLSL 1.50 spec.
*/
- assert((type == glsl_error_type)
+ assert(type->is_error()
|| ((type->base_type == GLSL_TYPE_BOOL)
&& type->is_scalar()));
op[0] = this->subexpressions[0]->hir(instructions, state);
op[1] = this->subexpressions[1]->hir(instructions, state);
- error_emitted = ((op[0]->type == glsl_error_type)
- || (op[1]->type == glsl_error_type));
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
type = arithmetic_result_type(op[0]->type, op[1]->type,
(this->oper == ast_mul_assign),
/* FINISHME: This is copied from ast_assign above. It should
* FINISHME: probably be consolidated.
*/
- error_emitted = ((op[0]->type == glsl_error_type)
- || (temp_rhs->type == glsl_error_type));
+ error_emitted = op[0]->type->is_error() || temp_rhs->type->is_error();
type = op[0]->type;
if (!error_emitted) {