[Mesa-dev] [PATCH 20/21] nir/lower_indirect: Bail early if modes == 0

Jason Ekstrand jason at jlekstrand.net
Sat Oct 28 18:36:28 UTC 2017


There's no point in walking the program if 100% if we're never going to
actually lower anything.
---
 src/compiler/nir/nir_lower_indirect_derefs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c
index c949224..f1e060c 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -202,6 +202,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;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list