From 8410cf66d776aa832f666bc50dad460dd577bf27 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 13 Dec 2018 14:06:48 -0600 Subject: [PATCH] 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 --- 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 eb858f50f03..7e253492ba8 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 -- 2.30.2