OSDN Git Service

nir: allow more nested loops to be unrolled
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 23 Jul 2018 08:02:28 +0000 (18:02 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Aug 2018 23:03:13 +0000 (09:03 +1000)
commitd0803dea11233ee4df079fbf6bba40e6f6cd2c2b
treeecb4eeb4900b62fa36d66a64353fcd4d13d001ab
parent9baff597ce021f7691187b0d1d1bbc16d07b13e1
nir: allow more nested loops to be unrolled

The innermost check was added to stop us from unrolling multiple
loops in a single pass, and to stop outer loops from unrolling.

When we successfully unroll a loop we need to run the analysis
pass again before deciding if we want to go ahead an unroll a
second loop.

However the logic was flawed because it never tried to unroll any
nested loops other than the first innermost loop it found.
If this innermost loop is not unrolled we end up skipping all
other nested loops.

This unrolls a loop in a Deus Ex: MD shader on ultra settings and
also unrolls a loop in a shader from the game Prey when running
on DXVK.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_loop_unroll.c