Mesa (main): nouveau/nir: Allow up to 6 nested joins
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Apr 15 01:27:44 UTC 2022
Module: Mesa
Branch: main
Commit: 9da14a21193425dfb02d620e3da7eed954119b68
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9da14a21193425dfb02d620e3da7eed954119b68
Author: M Henning <drawoc at darkrefraction.com>
Date: Tue Feb 8 01:00:02 2022 -0500
nouveau/nir: Allow up to 6 nested joins
This matches what the tgsi path does and doesn't regress any tests. (For
comparison, unlimited join nesting does regress tests in deqp and piglit)
Fixes graphical artifacts from stack overflows in
https://www.shadertoy.com/view/Xds3zN
with nir on kepler
Reviewed-by: Emma Anholt <emma at anholt.net>
Acked-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15597>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index f9703fe7cde..192f2f59c1b 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -1485,9 +1485,9 @@ Converter::visit(nir_if *nif)
insertJoins = insertJoins && bb->getExit()->op == OP_BRA;
}
- /* only insert joins for the most outer if */
- if (--curIfDepth)
+ if (curIfDepth > 6) {
insertJoins = false;
+ }
/* we made sure that all threads would converge at the same block */
if (insertJoins) {
@@ -1498,6 +1498,8 @@ Converter::visit(nir_if *nif)
mkFlow(OP_JOIN, NULL, CC_ALWAYS, NULL)->fixed = 1;
}
+ curIfDepth--;
+
return true;
}
More information about the mesa-commit
mailing list