From 3249e4625e86c78978e3eb2a464fd8a23fcdfbeb Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 29 Jan 2026 08:02:50 -0800 Subject: [PATCH] freedreno/decode: call show_descriptor() for UBO and SAMPLERs as well With the additional shader info, we can determine when a given descriptor is definitely not a UBO or sampler. Signed-off-by: Rob Clark Part-of: --- src/freedreno/decode/cffdec.c | 20 ++++++++++++++----- src/freedreno/decode/cffdump-desc-handler.lua | 5 +++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/freedreno/decode/cffdec.c b/src/freedreno/decode/cffdec.c index b61f7423bb9..cf732c7852c 100644 --- a/src/freedreno/decode/cffdec.c +++ b/src/freedreno/decode/cffdec.c @@ -1787,17 +1787,27 @@ dump_bindless_descriptors(bool is_compute, int level) unsigned desc_count = length / (16 * sizeof(uint32_t)); for (unsigned desc_idx = 0; desc_idx < desc_count; desc_idx++) { if (memcmp(contents, empty_contents, sizeof(empty_contents))) { - printl(2, "%sUBO[%u]:\n", levels[level + 1], desc_idx); - dump_domain(contents, 2, level + 2, "A6XX_UBO"); + + if (show_descriptor(contents, 2, i + 1, desc_idx, "A6XX_UBO", "DESC_UBO")) { + printl(2, "%sUBO[%u]:\n", levels[level + 1], desc_idx); + dump_domain(contents, 2, level + 2, "A6XX_UBO"); + } if ((6 <= options->info->chip) && (options->info->chip < 8)) { dump_tex_descriptor(contents, i + 1, desc_idx, level, "A6XX_TEX_MEMOBJ"); + + if (show_descriptor(contents, 16, i + 1, desc_idx, "A6XX_TEX_SAMP", "DESC_SAMPLER")) { + printl(2, "%sSAMPLER[%u]:\n", levels[level + 1], desc_idx); + dump_tex_samp(contents, STATE_SRC_BINDLESS, 1, level); + } } else if ((8 <= options->info->chip) && (options->info->chip < 9)) { dump_tex_descriptor(contents, i + 1, desc_idx, level, "A8XX_TEX_MEMOBJ"); - } - printl(2, "%sSAMPLER[%u]:\n", levels[level + 1], desc_idx); - dump_tex_samp(contents, STATE_SRC_BINDLESS, 1, level); + if (show_descriptor(contents, 4, i + 1, desc_idx, "A8XX_TEX_SAMP", "DESC_SAMPLER")) { + printl(2, "%sSAMPLER[%u]:\n", levels[level + 1], desc_idx); + dump_tex_samp(contents, STATE_SRC_BINDLESS, 1, level); + } + } } contents += 16; } diff --git a/src/freedreno/decode/cffdump-desc-handler.lua b/src/freedreno/decode/cffdump-desc-handler.lua index f7a422656be..bc2741a6b20 100644 --- a/src/freedreno/decode/cffdump-desc-handler.lua +++ b/src/freedreno/decode/cffdump-desc-handler.lua @@ -8,6 +8,11 @@ -- If it is ambiguous, be conservative and show the specified decoding. function show_descriptor(desc, type, pkt, base, idx) + if (type == r.desctype.DESC_SAMPLER) or (type == r.desctype.DESC_UBO) then + -- Everything below here only applies to TEX_MEMOBJ descriptors + return true + end + if type == r.desctype.DESC_BUFFER then return r.a6xx_tex_type.A6XX_TEX_BUFFER == desc.TYPE end