From f779af2d105a6330c022fa93684103d166ec36d5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 5 Nov 2020 13:01:02 -0500 Subject: [PATCH] zink: set nir options for 64bit handling based on feature presence Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 80ac3b09f1b..cf7fee64dd4 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -217,6 +217,30 @@ static const struct nir_shader_compiler_options nir_options = { .lower_mul_high = true, .lower_rotate = true, .lower_uadd_carry = true, + .lower_pack_64_2x32_split = true, + .lower_unpack_64_2x32_split = true, + .lower_int64_options = ~0, + .lower_doubles_options = ~nir_lower_fp64_full_software, +}; + +static const struct nir_shader_compiler_options softfp_nir_options = { + .lower_all_io_to_temps = true, + .lower_ffma16 = true, + .lower_ffma32 = true, + .lower_ffma64 = true, + .lower_fdph = true, + .lower_flrp32 = true, + .lower_fpow = true, + .lower_fsat = true, + .lower_extract_byte = true, + .lower_extract_word = true, + .lower_mul_high = true, + .lower_rotate = true, + .lower_uadd_carry = true, + .lower_pack_64_2x32_split = true, + .lower_unpack_64_2x32_split = true, + .lower_int64_options = ~0, + .lower_doubles_options = ~0, }; const void * @@ -225,6 +249,10 @@ zink_get_compiler_options(struct pipe_screen *screen, enum pipe_shader_type shader) { assert(ir == PIPE_SHADER_IR_NIR); + struct zink_screen *zscreen = zink_screen(screen); + /* do we actually want this? fails a lot and not just from bugs I've added */ + if (!zscreen->info.feats.features.shaderFloat64) + return &softfp_nir_options; return &nir_options; }