diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml
index 5cc0fc13810..4ea4c870060 100644
--- a/src/asahi/lib/cmdbuf.xml
+++ b/src/asahi/lib/cmdbuf.xml
@@ -547,6 +547,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/asahi/lib/decode.c b/src/asahi/lib/decode.c
index f5773af66e9..c87f5cc2d19 100644
--- a/src/asahi/lib/decode.c
+++ b/src/asahi/lib/decode.c
@@ -443,6 +443,7 @@ agxdecode_cmdstream(unsigned cmdbuf_handle, unsigned map_handle, bool verbose)
DUMP_UNPACKED(IOGPU_HEADER, cmd, "IOGPU Header\n");
assert(cmd.attachment_offset_1 == cmd.attachment_offset_2);
+ DUMP_CL(IOGPU_INTERNAL_PIPELINES, ((uint32_t *) cmdbuf->ptr.cpu) + 156, "Internal pipelines");
DUMP_CL(IOGPU_AUX_FRAMEBUFFER, ((uint32_t *) cmdbuf->ptr.cpu) + 220, "Aux Framebuffer");
DUMP_CL(IOGPU_CLEAR_Z_S, ((uint32_t *) cmdbuf->ptr.cpu) + 276, "Clear Z/S");
diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c
index a8c6caba573..f3a72051423 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -79,15 +79,14 @@ demo_cmdbuf(uint64_t *buf, size_t size,
uint64_t unk_buffer = demo_zero(pool, 0x1000);
uint64_t unk_buffer_2 = demo_zero(pool, 0x8000);
- // This is a pipeline bind
- map[156] = 0xffff8002 | (clear_pipeline_textures ? 0x210 : 0);
- map[158] = pipeline_clear | 0x4;
- map[163] = 0x12;
- map[164] = pipeline_store | 0x4;
- map[166] = scissor_ptr & 0xFFFFFFFF;
- map[167] = scissor_ptr >> 32;
- map[168] = unk_buffer & 0xFFFFFFFF;
- map[169] = unk_buffer >> 32;
+ agx_pack(map + 156, IOGPU_INTERNAL_PIPELINES, cfg) {
+ cfg.clear_pipeline_bind = 0xffff8002 | (clear_pipeline_textures ? 0x210 : 0);
+ cfg.clear_pipeline = pipeline_clear;
+ cfg.store_pipeline_bind = 0x12;
+ cfg.store_pipeline = pipeline_store;
+ cfg.scissor_array = scissor_ptr;
+ cfg.unknown_buffer = unk_buffer;
+ }
agx_pack(map + 220, IOGPU_AUX_FRAMEBUFFER, cfg) {
cfg.width = width;