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@anholt.net>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15597>
This commit is contained in:
M Henning 2022-02-08 01:00:02 -05:00 committed by Marge Bot
parent 0c4d1762de
commit 9da14a2119

View file

@ -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;
}