diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index b344ecce532..f4b6d059524 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -172,9 +172,14 @@ agx_emit_fragment_out(agx_builder *b, nir_intrinsic_instr *instr) unsigned rt = (loc - FRAG_RESULT_DATA0); /* TODO: Reverse-engineer interactions with MRT */ - agx_writeout(b, 0xC200); - agx_writeout(b, 0x000C); + if (b->shader->did_writeout) { + agx_writeout(b, 0x0004); + } else { + agx_writeout(b, 0xC200); + agx_writeout(b, 0x000C); + } + b->shader->did_writeout = true; return agx_st_tile(b, agx_src_index(&instr->src[0]), b->shader->key->fs.tib_formats[rt]); } diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 030cb26585b..0c45c0e0b60 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -318,6 +318,9 @@ typedef struct { /* For creating temporaries */ unsigned alloc; + /* I don't really understand how writeout ops work yet */ + bool did_writeout; + /* Stats for shader-db */ unsigned loop_count; unsigned spills;