From 0722cd7a30be4945ef20bb890dede85b792faf6b Mon Sep 17 00:00:00 2001 From: Charles Baker Date: Fri, 14 Jan 2022 15:07:56 +1300 Subject: [PATCH] zink: Avoid redundant cast to uint on PackHalf2x16 result For example the previous code generates the following sequence of SPIR-V instructions ending with a redundant cast to uint: %2018 = OpExtInst %uint %1 PackHalf2x16 %2017 %2019 = OpBitcast %uint %2018 The new code generates: %2018 = OpExtInst %uint %1 PackHalf2x16 %2017 Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 1 - 1 file changed, 1 deletion(-) 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 a31b0d6a470..374bdf5e480 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 @@ -1737,7 +1737,6 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu) case nir_op_pack_half_2x16: assert(nir_op_infos[alu->op].num_inputs == 1); result = emit_builtin_unop(ctx, GLSLstd450PackHalf2x16, get_dest_type(ctx, &alu->dest.dest, nir_type_uint), src[0]); - force_float = true; break; BUILTIN_UNOPF(nir_op_unpack_half_2x16, GLSLstd450UnpackHalf2x16)