OSDN Git Service

nir/lower_indirect: Bail early if modes == 0
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 28 Oct 2017 16:05:01 +0000 (09:05 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 2 Aug 2018 01:02:28 +0000 (18:02 -0700)
There's no point in walking the program if we're never going to actually
lower anything.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_lower_indirect_derefs.c

index d85c170..c1f3cf8 100644 (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;