* consider a true boolean to be ~0. Fix this up with a != 0
* comparison.
*/
- if (type->base_type == GLSL_TYPE_BOOL) {
+ if (type->is_boolean()) {
nir_alu_instr *load_ssbo_compare =
nir_alu_instr_create(shader, nir_op_ine);
load_ssbo_compare->src[0].src.is_ssa = true;
* a true boolean to be ~0. Fix this up with a != 0 comparison.
*/
- if (ir->type->base_type == GLSL_TYPE_BOOL)
+ if (ir->type->is_boolean())
this->result = nir_ine(&b, &load->dest.ssa, nir_imm_int(&b, 0));
return;
assert(ir->operands[0]->type == ir->type);
break;
case ir_unop_logic_not:
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
+ assert(ir->operands[0]->type->is_boolean());
break;
case ir_unop_neg:
break;
case ir_unop_f2b:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
break;
case ir_unop_b2f:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type->is_boolean());
assert(ir->type->base_type == GLSL_TYPE_FLOAT);
break;
case ir_unop_i2b:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
break;
case ir_unop_b2i:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type->is_boolean());
assert(ir->type->base_type == GLSL_TYPE_INT);
break;
case ir_unop_u2f:
break;
case ir_unop_i642b:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
break;
case ir_unop_i642f:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
assert(ir->type->base_type == GLSL_TYPE_INT64);
break;
case ir_unop_b2i64:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type->is_boolean());
assert(ir->type->base_type == GLSL_TYPE_INT64);
break;
case ir_unop_f2i64:
break;
case ir_unop_d2b:
assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
break;
case ir_unop_frexp_sig:
* comparison on scalar or vector types and return a boolean scalar or
* vector type of the same size.
*/
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
assert(ir->operands[0]->type == ir->operands[1]->type);
assert(ir->operands[0]->type->is_vector()
|| ir->operands[0]->type->is_scalar());
case ir_binop_logic_and:
case ir_binop_logic_xor:
case ir_binop_logic_or:
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->operands[1]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_boolean());
+ assert(ir->operands[0]->type->is_boolean());
+ assert(ir->operands[1]->type->is_boolean());
break;
case ir_binop_dot:
break;
case ir_triop_csel:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type->is_boolean());
assert(ir->type->vector_elements == ir->operands[0]->type->vector_elements);
assert(ir->type == ir->operands[1]->type);
assert(ir->type == ir->operands[2]->type);