v3d: Fix assertion failures in debug builds.
authorEric Anholt <eric@anholt.net>
Tue, 16 Jul 2019 18:59:35 +0000 (11:59 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 18 Jul 2019 18:28:56 +0000 (11:28 -0700)
nir_lower_io leaves around deref_var instructions after lowering away
deref intrinsics.  This ends up breaking validation after v3d_nir_lower_io
removes variables not actually being stored by the shader's
store_output()s.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/broadcom/compiler/vir.c

index c18318a62957eb72a7e546eb9fe49414b3769472..04129fa522e5ba04548c4f2336edc76734427979 100644 (file)
@@ -761,6 +761,8 @@ v3d_nir_lower_vs_early(struct v3d_compile *c)
         NIR_PASS_V(c->s, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
                    type_size_vec4,
                    (nir_lower_io_options)0);
+        /* clean up nir_lower_io's deref_var remains */
+        NIR_PASS_V(c->s, nir_opt_dce);
 }
 
 static void