nir/lower_indirect: Bail early if modes == 0

There's no point in walking the program if we're never going to actually
lower anything.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Jason Ekstrand 2017-10-28 09:05:01 -07:00
parent 4434591bf5
commit 7f75cf2a94

View file

@ -205,6 +205,9 @@ nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes)
{
bool progress = false;
if (modes == 0)
return false;
nir_foreach_function(function, shader) {
if (function->impl)
progress = lower_indirects_impl(function->impl, modes) || progress;