nir/spirv: Wrap borrow/carry ops in b2i
NIR specifies them as booleans but SPIR-V wants ints.
This commit is contained in:
@@ -2718,13 +2718,15 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
|
|||||||
case SpvOpIAddCarry:
|
case SpvOpIAddCarry:
|
||||||
assert(glsl_type_is_struct(val->ssa->type));
|
assert(glsl_type_is_struct(val->ssa->type));
|
||||||
val->ssa->elems[0]->def = nir_iadd(&b->nb, src[0], src[1]);
|
val->ssa->elems[0]->def = nir_iadd(&b->nb, src[0], src[1]);
|
||||||
val->ssa->elems[1]->def = nir_uadd_carry(&b->nb, src[0], src[1]);
|
val->ssa->elems[1]->def =
|
||||||
|
nir_b2i(&b->nb, nir_uadd_carry(&b->nb, src[0], src[1]));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case SpvOpISubBorrow:
|
case SpvOpISubBorrow:
|
||||||
assert(glsl_type_is_struct(val->ssa->type));
|
assert(glsl_type_is_struct(val->ssa->type));
|
||||||
val->ssa->elems[0]->def = nir_isub(&b->nb, src[0], src[1]);
|
val->ssa->elems[0]->def = nir_isub(&b->nb, src[0], src[1]);
|
||||||
val->ssa->elems[1]->def = nir_usub_borrow(&b->nb, src[0], src[1]);
|
val->ssa->elems[1]->def =
|
||||||
|
nir_b2i(&b->nb, nir_usub_borrow(&b->nb, src[0], src[1]));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case SpvOpUMulExtended:
|
case SpvOpUMulExtended:
|
||||||
|
Reference in New Issue
Block a user