diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c index 352c6f8ff17..45141856057 100644 --- a/src/compiler/nir/nir_opt_dead_cf.c +++ b/src/compiler/nir/nir_opt_dead_cf.c @@ -285,6 +285,9 @@ dead_cf_block(nir_block *block) if (nir_src_is_const(following_if->condition)) { opt_constant_if(following_if, nir_src_as_bool(following_if->condition)); return true; + } else if (nir_src_is_undef(following_if->condition)) { + opt_constant_if(following_if, false); + return true; } if (node_is_dead(&following_if->cf_node)) {