spirv: fix SpvOpBitSize return value.
authorDave Airlie <airlied@redhat.com>
Fri, 3 May 2019 02:53:56 +0000 (12:53 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 3 May 2019 05:22:57 +0000 (15:22 +1000)
The spir-v spec says this returns a bool.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/vtn_alu.c

index d8ffc18d495bc6a9f6b7abbf3a32c28cedf97375..6d4347887cdc1b8f6ab538abf43cc4a44266006e 100644 (file)
@@ -646,9 +646,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
          val->ssa->def =
             nir_ishr(&b->nb, src[0], nir_imm_int(&b->nb, src_bit_size - 1));
 
-      if (src_bit_size != 32)
-         val->ssa->def = nir_u2u32(&b->nb, val->ssa->def);
-
+      val->ssa->def = nir_i2b(&b->nb, val->ssa->def);
       break;
    }