summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_lower_indirect_derefs.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-10-28 09:05:01 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2018-08-01 18:02:28 -0700
commit7f75cf2a9408b9af562e033ef6c1d1fd15141421 (patch)
tree52cc0c264eb55e403bb6f2a66465ca63da2686c8 /src/compiler/nir/nir_lower_indirect_derefs.c
parent4434591bf56a6b0c193ef209ea9d7b9e3c95a522 (diff)
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>
Diffstat (limited to 'src/compiler/nir/nir_lower_indirect_derefs.c')
-rw-r--r--src/compiler/nir/nir_lower_indirect_derefs.c3
1 files changed, 3 insertions, 0 deletions
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;