From 8782a0b8dfd7955ec144ae8b0eb16ade6cdb89eb Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 30 Jan 2023 11:11:39 -0800 Subject: [PATCH] microsoft/compiler: Ensure native_low_precision is set for 16-bit bitcasts/stores Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index ea9990ecc3d..e26b0816b2d 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -1925,6 +1925,8 @@ store_dest(struct ntd_context *ctx, nir_dest *dest, unsigned chan, case nir_type_float: if (nir_dest_bit_size(*dest) == 64) ctx->mod.feats.doubles = true; + if (nir_dest_bit_size(*dest) == 16) + ctx->mod.feats.native_low_precision = true; store_dest_value(ctx, dest, chan, value); break; case nir_type_uint: @@ -1982,6 +1984,8 @@ get_src(struct ntd_context *ctx, nir_src *src, unsigned chan, assert(ctx->mod.feats.doubles); ctx->mod.feats.int64_ops = true; } + if (bit_size == 16) + ctx->mod.feats.native_low_precision = true; assert(dxil_value_type_bitsize_equal_to(value, bit_size)); return bitcast_to_int(ctx, bit_size, value); } @@ -1996,6 +2000,8 @@ get_src(struct ntd_context *ctx, nir_src *src, unsigned chan, assert(ctx->mod.feats.int64_ops); ctx->mod.feats.doubles = true; } + if (bit_size == 16) + ctx->mod.feats.native_low_precision = true; assert(dxil_value_type_bitsize_equal_to(value, bit_size)); return bitcast_to_float(ctx, bit_size, value);