panvk: propagate debug info through NIR when BIFROST_MESA_DEBUG=debuginfo is specified

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39554>
This commit is contained in:
Caterina Shablia 2026-01-30 13:22:54 +00:00 committed by Marge Bot
parent 5f5412c1c8
commit 15443c343a
6 changed files with 21 additions and 0 deletions

View file

@ -34,6 +34,7 @@ extern "C" {
#define BIFROST_DBG_NOSSARA 0x4000
#define BIFROST_DBG_STATSABS 0x8000
#define BIFROST_DBG_STATSFULL 0x10000
#define BIFROST_DBG_DEBUGINFO 0x20000
extern unsigned bifrost_debug;

View file

@ -47,6 +47,7 @@ static const struct debug_named_value bifrost_debug_options[] = {
{"nossara", BIFROST_DBG_NOSSARA, "Disable SSA in register allocation"},
{"statsabs", BIFROST_DBG_STATSABS, "Don't normalize statistics"},
{"statsfull", BIFROST_DBG_STATSFULL, "Print verbose statistics"},
{"debuginfo", BIFROST_DBG_DEBUGINFO, "Print debug information"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
@ -67,6 +68,13 @@ bifrost_will_dump_shaders(void)
return bifrost_debug & BIFROST_DBG_SHADERS;
}
bool
bifrost_want_debug_info(void)
{
bifrost_debug = debug_get_option_bifrost_debug();
return bifrost_debug & BIFROST_DBG_DEBUGINFO;
}
static bi_block *emit_cf_list(bi_context *ctx, struct exec_list *list);
static bi_index

View file

@ -70,6 +70,7 @@ void bifrost_lower_texture_nir(nir_shader *nir, unsigned gpu_id);
void bifrost_lower_texture_late_nir(nir_shader *nir, unsigned gpu_id);
bool bifrost_will_dump_shaders(void);
bool bifrost_want_debug_info(void);
void bifrost_compile_shader_nir(nir_shader *nir,
const struct pan_compile_inputs *inputs,

View file

@ -23,6 +23,15 @@ pan_will_dump_shaders(unsigned arch)
return midgard_will_dump_shaders();
}
bool
pan_want_debug_info(unsigned arch)
{
if (arch >= 6)
return bifrost_want_debug_info();
else
return false;
}
const nir_shader_compiler_options *
pan_get_nir_shader_compiler_options(unsigned arch)
{

View file

@ -18,6 +18,7 @@
struct pan_shader_info;
bool pan_will_dump_shaders(unsigned arch);
bool pan_want_debug_info(unsigned arch);
const nir_shader_compiler_options *
pan_get_nir_shader_compiler_options(unsigned arch);

View file

@ -377,6 +377,7 @@ panvk_get_spirv_options(UNUSED struct vk_physical_device *vk_pdev,
.ssbo_addr_format = panvk_buffer_ssbo_addr_format(rs->storage_buffers),
.phys_ssbo_addr_format = nir_address_format_64bit_global,
.shared_addr_format = nir_address_format_32bit_offset,
.debug_info = pan_want_debug_info(PAN_ARCH),
};
}