diff options
author | Iago Toral Quiroga <[email protected]> | 2019-10-11 11:40:38 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-12-16 08:42:37 +0100 |
commit | a6b318ef52cd567e922eaea00b0f6699ceb1dfb2 (patch) | |
tree | 5d8b051cc2e54bf48245c495a7b29e27e5d7bb40 /src/broadcom | |
parent | b636d4ebc72b9c2f99f5214ae428b6cdcb85aab3 (diff) |
v3d: predicate geometry shader outputs inside non-uniform control flow
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/broadcom')
-rw-r--r-- | src/broadcom/compiler/nir_to_vir.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index d49640bf623..e56632590d6 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2021,7 +2021,22 @@ emit_store_output_gs(struct v3d_compile *c, nir_intrinsic_instr *instr) struct qreg offset = vir_ADD(c, vir_uniform_ui(c, base_offset), src_offset); + /* Usually, for VS or FS, we only emit outputs once at program end so + * our VPM writes are never in non-uniform control flow, but this + * is not true for GS, where we are emitting multiple vertices. + */ + if (vir_in_nonuniform_control_flow(c)) { + vir_set_pf(vir_MOV_dest(c, vir_nop_reg(), c->execute), + V3D_QPU_PF_PUSHZ); + } + vir_VPM_WRITE_indirect(c, ntq_get_src(c, instr->src[0], 0), offset); + + if (vir_in_nonuniform_control_flow(c)) { + struct qinst *last_inst = + (struct qinst *)c->cur_block->instructions.prev; + vir_set_cond(last_inst, V3D_QPU_COND_IFA); + } } static void |