From 195c60deb47dd5b7da0045facd5b07ba6e3cb2a2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 6 Jan 2016 17:13:04 -0800 Subject: [PATCH] nir/spirv: Wrap borrow/carry ops in b2i NIR specifies them as booleans but SPIR-V wants ints. --- src/glsl/nir/spirv/spirv_to_nir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index 875b18cebdd..8acfc4b392e 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -2718,13 +2718,15 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, case SpvOpIAddCarry: assert(glsl_type_is_struct(val->ssa->type)); 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; case SpvOpISubBorrow: assert(glsl_type_is_struct(val->ssa->type)); 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; case SpvOpUMulExtended: -- 2.30.2