zink/spirv: implement f2b1
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 19 Jul 2019 12:27:47 +0000 (14:27 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:47 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c

index 3cef61b64634b2ac5e9206600e61736e606419ca..6612caf1eb17e2ea70e3c89527718a3e863573fa 100644 (file)
@@ -834,6 +834,15 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
       }
       break;
 
+   case nir_op_f2b1: {
+      assert(nir_op_infos[alu->op].num_inputs == 1);
+      float values[NIR_MAX_VEC_COMPONENTS] = { 0 };
+      SpvId zero = get_fvec_constant(ctx, nir_src_bit_size(alu->src[0].src),
+                                     num_components, values);
+      result = emit_binop(ctx, SpvOpFOrdNotEqual, dest_type, src[0], zero);
+      } break;
+
+
 #define BINOP(nir_op, spirv_op) \
    case nir_op: \
       assert(nir_op_infos[alu->op].num_inputs == 2); \