Mesa (main): zink: run lower_io_to_scalar before rewriting bo access

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 27 17:23:38 UTC 2021


Module: Mesa
Branch: main
Commit: 3a1ecd1e8ccfb73d76d5c20bbce9ee3e1d3ffcea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a1ecd1e8ccfb73d76d5c20bbce9ee3e1d3ffcea

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Oct 20 11:03:00 2021 -0400

zink: run lower_io_to_scalar before rewriting bo access

this is happening in ntv anyway, so move it to the compiler here

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13484>

---

 src/gallium/drivers/zink/zink_compiler.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 59c88aae5ed..be08bf811aa 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -898,8 +898,10 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shad
       default: break;
       }
    }
-   if (screen->driconf.inline_uniforms)
+   if (screen->driconf.inline_uniforms) {
+      NIR_PASS_V(nir, nir_lower_io_to_scalar, nir_var_mem_ubo | nir_var_mem_ssbo | nir_var_mem_shared);
       NIR_PASS_V(nir, rewrite_bo_access);
+   }
    if (inlined_uniforms) {
       optimize_nir(nir);
 
@@ -1413,8 +1415,10 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
    NIR_PASS_V(nir, lower_64bit_vertex_attribs);
    NIR_PASS_V(nir, unbreak_bos);
    /* run in compile if there could be inlined uniforms */
-   if (!screen->driconf.inline_uniforms)
+   if (!screen->driconf.inline_uniforms) {
+      NIR_PASS_V(nir, nir_lower_io_to_scalar, nir_var_mem_ubo | nir_var_mem_ssbo | nir_var_mem_shared);
       NIR_PASS_V(nir, rewrite_bo_access);
+   }
 
    if (zink_debug & ZINK_DEBUG_NIR) {
       fprintf(stderr, "NIR shader:\n---8<---\n");



More information about the mesa-commit mailing list