Mesa (master): zink: run more nir passes for tess shaders

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 9 03:01:22 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Feb 24 14:55:24 2021 -0500

zink: run more nir passes for tess shaders

running nir_lower_io_arrays_to_elements_no_indirects for only some stages
breaks location-setting for the stages which don't run it when
e.g., dmat2x3 variables are sometimes split across locations and
sometimes jammed into a single location (TCS I'm looking at you)

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

---

 src/gallium/drivers/zink/zink_compiler.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 62ba11fd4a9..db42e2c73af 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -547,6 +547,11 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
 
    if (nir->info.stage == MESA_SHADER_VERTEX)
       create_vs_pushconst(nir);
+   else if (nir->info.stage == MESA_SHADER_TESS_CTRL ||
+            nir->info.stage == MESA_SHADER_TESS_EVAL) {
+      NIR_PASS_V(nir, nir_lower_indirect_derefs, nir_var_shader_in | nir_var_shader_out, UINT_MAX);
+      NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
+   }
 
    /* only do uniforms -> ubo if we have uniforms, otherwise we're just
     * screwing with the bindings for no reason



More information about the mesa-commit mailing list