broadcom/vc5: Fix discard_if during control flow.
authorEric Anholt <eric@anholt.net>
Fri, 29 Dec 2017 00:01:09 +0000 (16:01 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 3 Jan 2018 22:31:36 +0000 (14:31 -0800)
I want to do the SETMSF.IFA to discard only if execute == 0 and cond, so
our dest of the PUSHZ needs to be nonzero if execute or !cond are nonzero.

Fixes dEQP-GLES3.functional.shaders.discard.dynamic_loop_dynamic.

src/broadcom/compiler/nir_to_vir.c

index f998f716590997e2d858140f2cd09426a19e969c..208ee1b86a886d45a598d98a6d90470ccccd36e3 100644 (file)
@@ -1753,7 +1753,7 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
                          * the condition so that we can use zero as "executing
                          * and discarding."
                          */
-                        vir_PF(c, vir_AND(c, c->execute, vir_NOT(c, cond)),
+                        vir_PF(c, vir_OR(c, c->execute, vir_NOT(c, cond)),
                                V3D_QPU_PF_PUSHZ);
                         vir_set_cond(vir_SETMSF_dest(c, vir_reg(QFILE_NULL, 0),
                                                      vir_uniform_ui(c, 0)),