diff --git a/src/panfrost/compiler/bifrost/bifrost.h b/src/panfrost/compiler/bifrost/bifrost.h index 678d19e9468..d90d7a679a4 100644 --- a/src/panfrost/compiler/bifrost/bifrost.h +++ b/src/panfrost/compiler/bifrost/bifrost.h @@ -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; diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 6f8b2859bf0..9ab15611dcf 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -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 diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.h b/src/panfrost/compiler/bifrost/bifrost_compile.h index ef10c87c17f..0d08e57c29c 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.h +++ b/src/panfrost/compiler/bifrost/bifrost_compile.h @@ -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, diff --git a/src/panfrost/compiler/pan_compiler.c b/src/panfrost/compiler/pan_compiler.c index 49c0e74f81b..c9b13eebb1a 100644 --- a/src/panfrost/compiler/pan_compiler.c +++ b/src/panfrost/compiler/pan_compiler.c @@ -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) { diff --git a/src/panfrost/compiler/pan_compiler.h b/src/panfrost/compiler/pan_compiler.h index b6a1cb5232d..1493266244a 100644 --- a/src/panfrost/compiler/pan_compiler.h +++ b/src/panfrost/compiler/pan_compiler.h @@ -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); diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 27260661950..5d431689be9 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -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), }; }