Mesa (master): nir/propagate_invariant: Skip unknown vars
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 18 19:13:41 UTC 2018
Module: Mesa
Branch: master
Commit: 8410cf66d776aa832f666bc50dad460dd577bf27
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8410cf66d776aa832f666bc50dad460dd577bf27
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Thu Dec 13 14:06:48 2018 -0600
nir/propagate_invariant: Skip unknown vars
If we can't find the variable from the deref, just assume it isn't
invariant and continue on. This can happen if, for instance, we're
writing to a deref that points into an SSBO.
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
---
src/compiler/nir/nir_propagate_invariant.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_propagate_invariant.c b/src/compiler/nir/nir_propagate_invariant.c
index eb858f50f0..7e253492ba 100644
--- a/src/compiler/nir/nir_propagate_invariant.c
+++ b/src/compiler/nir/nir_propagate_invariant.c
@@ -71,7 +71,7 @@ add_var(nir_variable *var, struct set *invariants)
static bool
var_is_invariant(nir_variable *var, struct set * invariants)
{
- return var->data.invariant || _mesa_set_search(invariants, var);
+ return var && (var->data.invariant || _mesa_set_search(invariants, var));
}
static void
More information about the mesa-commit
mailing list