summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-02-24 14:55:24 -0500
committerMarge Bot <eric+marge@anholt.net>2021-03-09 02:52:20 +0000
commit086262fc53ab7e1f68e7a4c4a188b1431c9c8554 (patch)
tree024903837d15d606dc14f12774a51d3bd9f91936
parent6d8b5e7f09cd941e74adec5d069edaed39b434c2 (diff)
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@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9271>
-rw-r--r--src/gallium/drivers/zink/zink_compiler.c5
1 files changed, 5 insertions, 0 deletions
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