Mesa (staging/22.0): anv: Enable nir_opt_access

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 25 21:11:14 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: ace12c4da36f7b47ba9ec77c45f294872f185a30
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ace12c4da36f7b47ba9ec77c45f294872f185a30

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Feb 18 17:49:57 2022 +0200

anv: Enable nir_opt_access

This commit will enable pass for searching readonly / writeonly
access when it's missing.

We don't support shaderStorageImageReadWithoutFormat
and the optimization pass causes those shaders to
take the write-only path which does support formatless.

Following games are affected with positive result:
 - Wolfenstein: Youngblood
 - Wolfenstein II: The New Colossus https://gitlab.freedesktop.org/mesa/mesa/-/issues/3138
 - Rage 2 https://gitlab.freedesktop.org/mesa/mesa/-/issues/5791
 - The Surge 2 https://gitlab.freedesktop.org/mesa/mesa/-/issues/5805
 - Metro Exodus https://gitlab.freedesktop.org/mesa/mesa/-/issues/4703
 - DOOM Eternal https://gitlab.freedesktop.org/mesa/mesa/-/issues/4273

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3138,https://gitlab.freedesktop.org/mesa/mesa/-/issues/5791,https://gitlab.freedesktop.org/mesa/mesa/-/issues/4273
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov at globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15082>
(cherry picked from commit ded9cb904f02cfe4206f88f8a41f49258f09f2b0)

---

 .pick_status.json               | 2 +-
 src/intel/vulkan/anv_pipeline.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index fc9ce43103f..dd888fccf6a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -697,7 +697,7 @@
         "description": "anv: Enable nir_opt_access",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 57637ee4cc0..0c4abb8339f 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -234,6 +234,12 @@ anv_shader_compile_to_nir(struct anv_device *device,
     */
    NIR_PASS_V(nir, nir_lower_variable_initializers, ~0);
 
+   const nir_opt_access_options opt_access_options = {
+      .is_vulkan = true,
+      .infer_non_readable = true,
+   };
+   NIR_PASS_V(nir, nir_opt_access, &opt_access_options);
+
    /* Split member structs.  We do this before lower_io_to_temporaries so that
     * it doesn't lower system values to temporaries by accident.
     */



More information about the mesa-commit mailing list