ctx->defs[ssa->index] = result;
}
+static SpvId
+emit_select(struct ntv_context *ctx, SpvId type, SpvId cond,
+ SpvId if_true, SpvId if_false)
+{
+ return emit_triop(ctx, SpvOpSelect, type, cond, if_true, if_false);
+}
+
static SpvId
bvec_to_uvec(struct ntv_context *ctx, SpvId value, unsigned num_components)
{
uint32_t ones[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff };
SpvId zero = get_uvec_constant(ctx, 32, num_components, zeros);
SpvId one = get_uvec_constant(ctx, 32, num_components, ones);
- return emit_triop(ctx, SpvOpSelect, otype, value, one, zero);
+ return emit_select(ctx, otype, value, one, zero);
}
static SpvId
}
result = emit_binop(ctx, op, bool_type, src[0], src[1]);
- result = emit_triop(ctx, SpvOpSelect, dest_type, result, one, zero);
+ result = emit_select(ctx, dest_type, result, one, zero);
}
break;
num_components, zero);
result = emit_binop(ctx, SpvOpFOrdGreaterThan, bool_type, src[0], cmp);
- result = emit_triop(ctx, SpvOpSelect, dest_type, result, src[1], src[2]);
+ result = emit_select(ctx, dest_type, result, src[1], src[2]);
}
break;
case nir_op_bcsel:
assert(nir_op_infos[alu->op].num_inputs == 3);
- result = emit_triop(ctx, SpvOpSelect, dest_type, src[0], src[1], src[2]);
+ result = emit_select(ctx, dest_type, src[0], src[1], src[2]);
break;
case nir_op_vec2: