asahi: Dump all textures&samplers

This confirms the actual size of the texture descriptor -- 24 bytes.
The last 8 bytes have so far only been zeroed. It also confirms we got
the sampler descriptor size right.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17198>
This commit is contained in:
Alyssa Rosenzweig 2022-05-22 23:02:29 -04:00
parent 6d6dd44f82
commit d2fef02cc0
2 changed files with 20 additions and 12 deletions

View File

@ -161,7 +161,7 @@
<field name="Type" size="3" start="7" type="Texture Type"/>
</struct>
<struct name="Render Target" size="16">
<struct name="Render Target" size="24">
<field name="Unknown" size="4" start="0" type="hex" default="0x2"/>
<field name="Layout" size="2" start="4" type="Layout"/>
<field name="Format" size="10" start="6" type="Pixel Format"/>
@ -197,8 +197,7 @@
<value name="Cube" value="6"/>
</enum>
<!-- Payloads follow, right-shifted by 4 because of course -->
<struct name="Texture" size="16">
<struct name="Texture" size="24">
<field name="Dimension" size="4" start="0" type="Texture dimension" default="2D"/>
<field name="Layout" size="2" start="4" type="Layout"/>
<field name="Format" size="10" start="6" type="Pixel Format"/>

View File

@ -359,21 +359,30 @@ agxdecode_pipeline(const uint8_t *map, UNUSED bool verbose)
agx_unpack(agxdecode_dump_stream, map, BIND_TEXTURE, temp);
DUMP_UNPACKED(BIND_TEXTURE, temp, "Bind texture\n");
uint8_t *tex = agxdecode_fetch_gpu_mem(temp.buffer, 64);
/* Texture length seen to be <= 0x18 bytes, samplers only need 8 byte
* alignment */
agx_unpack(agxdecode_dump_stream, tex, TEXTURE, t);
DUMP_CL(TEXTURE, tex, "Texture");
DUMP_CL(RENDER_TARGET, tex, "Render target");
uint8_t *tex = agxdecode_fetch_gpu_mem(temp.buffer,
AGX_TEXTURE_LENGTH * temp.count);
/* Note: samplers only need 8 byte alignment? */
for (unsigned i = 0; i < temp.count; ++i) {
agx_unpack(agxdecode_dump_stream, tex, TEXTURE, t);
DUMP_CL(TEXTURE, tex, "Texture");
DUMP_CL(RENDER_TARGET, tex, "Render target");
tex += AGX_TEXTURE_LENGTH;
}
return AGX_BIND_TEXTURE_LENGTH;
} else if (map[0] == 0x9D) {
agx_unpack(agxdecode_dump_stream, map, BIND_SAMPLER, temp);
DUMP_UNPACKED(BIND_SAMPLER, temp, "Bind sampler\n");
uint8_t *samp = agxdecode_fetch_gpu_mem(temp.buffer, 64);
DUMP_CL(SAMPLER, samp, "Sampler");
hexdump(agxdecode_dump_stream, samp + AGX_SAMPLER_LENGTH, 64 - AGX_SAMPLER_LENGTH, false);
uint8_t *samp = agxdecode_fetch_gpu_mem(temp.buffer,
AGX_SAMPLER_LENGTH * temp.count);
for (unsigned i = 0; i < temp.count; ++i) {
DUMP_CL(SAMPLER, samp, "Sampler");
samp += AGX_SAMPLER_LENGTH;
}
return AGX_BIND_SAMPLER_LENGTH;
} else if (map[0] == 0x1D) {