Not sure on the details yet but identify and dump the data structure to start.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
in a decimal percentage [0, 100] <field name="Percent" start="5:16" -->
<field name="Percent" start="5:16" size="16" type="uint"/>
</struct>
+
+ <struct name="IOGPU Clear Z/S" size="32">
+ <!-- Encoded like the depth attachment -->
+ <field name="Depth clear value" start="2:0" size="32" type="hex"/>
+ <field name="Stencil clear value" start="3:0" size="8" type="uint"/>
+ <field name="Unk 1" start="3:8" size="8" type="hex" default="3"/>
+ <field name="Unk 2" start="5:8" size="8" type="hex" default="1"/>
+ <field name="Z16 Unorm attachment" start="7:8" size="1" type="bool"/>
+ </struct>
+
</agxml>
DUMP_UNPACKED(IOGPU_HEADER, cmd, "IOGPU Header\n");
assert(cmd.attachment_offset_1 == cmd.attachment_offset_2);
+ DUMP_CL(IOGPU_CLEAR_Z_S, ((uint32_t *) cmdbuf->ptr.cpu) + 276, "Clear Z/S");
+
uint32_t *attachments = (uint32_t *) ((uint8_t *) cmdbuf->ptr.cpu + cmd.attachment_offset_1);
unsigned attachment_count = attachments[3];
for (unsigned i = 0; i < attachment_count; ++i) {
map[226] = unk_buffer_2 & 0xFFFFFFFF;
map[227] = unk_buffer_2 >> 32;
- float depth_clear = 1.0;
- uint8_t stencil_clear = 0;
+ agx_pack(map + 276, IOGPU_CLEAR_Z_S, cfg) {
+ cfg.depth_clear_value = fui(1.0); // 32-bit float
+ cfg.stencil_clear_value = 0;
+ cfg.z16_unorm_attachment = false;
+ }
- map[278] = fui(depth_clear);
- map[279] = (0x3 << 8) | stencil_clear;
- map[282] = 0x1000000;
map[284] = 0xffffffff;
map[285] = 0xffffffff;
map[286] = 0xffffffff;