[Mesa-dev] [PATCH 16/18] nir/lower_indirect: Bail early if modes == 0
Jason Ekstrand
jason at jlekstrand.net
Wed Jul 11 21:18:18 UTC 2018
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 d85c1704222..c1f3cf86823 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -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;
--
2.17.1
More information about the mesa-dev
mailing list