freedreno/ir3/a6xx: fix atomic shader outputs
authorRob Clark <robdclark@gmail.com>
Tue, 26 Feb 2019 15:06:25 +0000 (10:06 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 26 Feb 2019 18:19:44 +0000 (13:19 -0500)
We also need to put in the output mov.  Possibly we could just fixup the
output register to read it directly from the dummy, but that is more
work and I guess dEQP is probably the only time you encounter this.

Fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.const_literal_fragment

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_a6xx.c

index 3bb9e3496f4fb45cedfb05c83f52cfe03a03ed02..00260a4c5343d00b0eafdc2055022d6720978d41 100644 (file)
@@ -427,6 +427,14 @@ ir3_a6xx_fixup_atomic_dests(struct ir3 *ir, struct ir3_shader_variant *so)
                                        reg->instr = get_atomic_dest_mov(src);
                        }
                }
+
+               /* we also need to fixup shader outputs: */
+               for (unsigned i = 0; i < ir->noutputs; i++) {
+                       if (!ir->outputs[i])
+                               continue;
+                       if (is_atomic(ir->outputs[i]->opc) && (ir->outputs[i]->flags & IR3_INSTR_G))
+                               ir->outputs[i] = get_atomic_dest_mov(ir->outputs[i]);
+               }
        }
 
 }