aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/zink
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-19 16:53:04 +0200
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:47 +0000
commitc24c3da00a73216b7002a6b877a852c2266e48f5 (patch)
tree34a1026600650bebbccd9bb48c0c22fb2826e3bb /src/gallium/drivers/zink
parent0a912269d4caea9b4fd7ef11d98c34971e5d8a63 (diff)
zink/spirv: fixup b2i32 and implement b2f32
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/zink')
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index 8f0e61d06e9..5fd403dd28c 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -828,7 +828,16 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
case nir_op_b2i32:
assert(nir_op_infos[alu->op].num_inputs == 1);
- result = bvec_to_uvec(ctx, src[0], num_components);
+ result = emit_select(ctx, dest_type, src[0],
+ get_uvec_constant(ctx, 32, num_components, 1),
+ get_uvec_constant(ctx, 32, num_components, 0));
+ break;
+
+ case nir_op_b2f32:
+ assert(nir_op_infos[alu->op].num_inputs == 1);
+ result = emit_select(ctx, dest_type, src[0],
+ get_fvec_constant(ctx, 32, num_components, 1),
+ get_fvec_constant(ctx, 32, num_components, 0));
break;
#define BUILTIN_UNOP(nir_op, spirv_op) \