Mesa (master): zink: set nir options for 64bit handling based on feature presence

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 18 01:17:11 UTC 2020


Module: Mesa
Branch: master
Commit: f779af2d105a6330c022fa93684103d166ec36d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f779af2d105a6330c022fa93684103d166ec36d5

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Nov  5 13:01:02 2020 -0500

zink: set nir options for 64bit handling based on feature presence

Reviewed-by: Erik Faye-Lund <kusmabite at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7654>

---

 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;
 }
 



More information about the mesa-commit mailing list