agx: Make signal_pix instructions explicit
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 30 Mar 2023 02:17:18 +0000 (22:17 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 03:23:04 +0000 (03:23 +0000)
Rather than implicitly packing them with the sample_mask. Again, this is just
changing where they're emitted, no functional changes yet. Bug for bug
compatibility with the old behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

src/asahi/compiler/agx_compile.c
src/asahi/compiler/agx_opcodes.py
src/asahi/compiler/agx_pack.c

index 2f9b05f..ffabb08 100644 (file)
@@ -423,6 +423,7 @@ agx_write_sample_mask_1(agx_builder *b)
        * TODO: interactions with MSAA and gl_SampleMask writes
        */
       agx_sample_mask(b, agx_immediate(1));
+      agx_signal_pix(b, 1);
       b->shader->did_sample_mask = true;
 
       assert(!(b->shader->nir->info.outputs_written &
@@ -668,7 +669,8 @@ agx_emit_discard(agx_builder *b)
    b->shader->did_writeout = true;
 
    b->shader->out->writes_sample_mask = true;
-   return agx_sample_mask(b, agx_immediate(0));
+   agx_sample_mask(b, agx_immediate(0));
+   return agx_signal_pix(b, 1);
 }
 
 static agx_instr *
index 08ece3b..e6f685a 100644 (file)
@@ -329,6 +329,7 @@ op("no_varyings", (0x80000051, 0xFFFFFFFF, 4, _), dests = 0, can_eliminate = Fal
 op("stop", (0x88, 0xFFFF, 2, _), dests = 0, can_eliminate = False)
 op("trap", (0x08, 0xFFFF, 2, _), dests = 0, can_eliminate = False)
 op("wait_pix", (0x48, 0xFF, 4, _), dests = 0, imms = [WRITEOUT], can_eliminate = False)
+op("signal_pix", (0x58, 0xFF, 4, _), dests = 0, imms = [WRITEOUT], can_eliminate = False)
 
 # Sources are the image and the offset within shared memory
 # TODO: Do we need the short encoding?
index 3f81059..4df255f 100644 (file)
@@ -508,19 +508,6 @@ agx_pack_instr(struct util_dynarray *emission, struct util_dynarray *fixups,
 
       unsigned size = 4;
       memcpy(util_dynarray_grow_bytes(emission, 1, size), &raw, size);
-
-      {
-         /* This is actually a separate instruction.
-          *
-          *    signal_pix 1, 0
-          *
-          * We don't model this correctly yet, but we should.
-          */
-         uint32_t raw = 0x158;
-         unsigned size = 4;
-         memcpy(util_dynarray_grow_bytes(emission, 1, size), &raw, size);
-      }
-
       break;
    }