summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-07-01 08:02:36 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-07-01 08:02:36 +0000
commit58fd8ddc4c85dfec0c9857f64c30926298cb0635 (patch)
treeb12da00e814a2566e2e239966a7ca211e8f15652
parentcfc645a0fc3bde631194b9632da2fde7aeaa90d6 (diff)
Import Mesa 19.0.8
-rw-r--r--lib/mesa/src/compiler/nir/nir_opt_move_load_ubo.c2
-rw-r--r--lib/mesa/src/compiler/nir/nir_propagate_invariant.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/mesa/src/compiler/nir/nir_opt_move_load_ubo.c b/lib/mesa/src/compiler/nir/nir_opt_move_load_ubo.c
index a32f17044..f36a62a53 100644
--- a/lib/mesa/src/compiler/nir/nir_opt_move_load_ubo.c
+++ b/lib/mesa/src/compiler/nir/nir_opt_move_load_ubo.c
@@ -91,7 +91,7 @@ move_load_ubo(nir_block *block)
}
}
- return false;
+ return progress;
}
bool
diff --git a/lib/mesa/src/compiler/nir/nir_propagate_invariant.c b/lib/mesa/src/compiler/nir/nir_propagate_invariant.c
index 103b2422b..a0cfde678 100644
--- a/lib/mesa/src/compiler/nir/nir_propagate_invariant.c
+++ b/lib/mesa/src/compiler/nir/nir_propagate_invariant.c
@@ -65,12 +65,21 @@ add_cf_node(nir_cf_node *cf, struct set *invariants)
static void
add_var(nir_variable *var, struct set *invariants)
{
- _mesa_set_add(invariants, var);
+ /* Because we pass the result of nir_intrinsic_get_var directly to this
+ * function, it's possible for var to be NULL if, for instance, there's a
+ * cast somewhere in the chain.
+ */
+ if (var != NULL)
+ _mesa_set_add(invariants, var);
}
static bool
var_is_invariant(nir_variable *var, struct set * invariants)
{
+ /* Because we pass the result of nir_intrinsic_get_var directly to this
+ * function, it's possible for var to be NULL if, for instance, there's a
+ * cast somewhere in the chain.
+ */
return var && (var->data.invariant || _mesa_set_search(invariants, var));
}