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>
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) {
mkFlow(OP_JOIN, NULL, CC_ALWAYS, NULL)->fixed = 1;
}
+ curIfDepth--;
+
return true;
}