From d4b742f93441e929e556d695dd70ad0f9c7fb235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 18 Jun 2025 18:13:00 -0400 Subject: [PATCH] radeonsi: fix printing asm for the first shader of merged shaders for ACO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we print asm for merged VS+TCS, we need to record asm for VS even when only TCS is being printed because they are printed together. Reviewed-by: Timur Kristóf Part-of: --- src/gallium/drivers/radeonsi/si_shader_aco.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_aco.c b/src/gallium/drivers/radeonsi/si_shader_aco.c index 1b06c1e21b8..7f13b322a8d 100644 --- a/src/gallium/drivers/radeonsi/si_shader_aco.c +++ b/src/gallium/drivers/radeonsi/si_shader_aco.c @@ -39,12 +39,14 @@ si_aco_compiler_debug(void *private_data, enum aco_compiler_debug_level level, static void si_fill_aco_options(struct si_screen *screen, gl_shader_stage stage, - struct aco_compiler_options *options, + gl_shader_stage next_merged_stage, struct aco_compiler_options *options, struct util_debug_callback *debug) { options->dump_ir = si_can_dump_shader(screen, stage, SI_DUMP_ACO_IR); options->dump_preoptir = si_can_dump_shader(screen, stage, SI_DUMP_INIT_ACO_IR); options->record_asm = si_can_dump_shader(screen, stage, SI_DUMP_ASM) || + (next_merged_stage != MESA_SHADER_NONE && + si_can_dump_shader(screen, next_merged_stage, SI_DUMP_ASM)) || screen->options.debug_disassembly; options->record_ir = screen->record_llvm_ir; options->is_opengl = true; @@ -149,9 +151,17 @@ si_aco_compile_shader(struct si_shader *shader, struct si_linked_shaders *linked { const struct si_shader_selector *sel = shader->selector; nir_shader *nir = linked->consumer.nir; + gl_shader_stage next_merged_stage = MESA_SHADER_NONE; + + if (nir->info.stage <= MESA_SHADER_GEOMETRY) { + if (shader->key.ge.as_ls) + next_merged_stage = MESA_SHADER_TESS_CTRL; + else if (shader->key.ge.as_es) + next_merged_stage = MESA_SHADER_GEOMETRY; + } struct aco_compiler_options options = {0}; - si_fill_aco_options(sel->screen, nir->info.stage, &options, debug); + si_fill_aco_options(sel->screen, nir->info.stage, next_merged_stage, &options, debug); struct aco_shader_info info = {0}; si_fill_aco_shader_info(shader, &info, &linked->consumer.args); @@ -338,7 +348,7 @@ si_aco_build_shader_part(struct si_screen *screen, gl_shader_stage stage, bool p struct si_shader_part *result) { struct aco_compiler_options options = {0}; - si_fill_aco_options(screen, stage, &options, debug); + si_fill_aco_options(screen, stage, MESA_SHADER_NONE, &options, debug); switch (stage) { case MESA_SHADER_FRAGMENT: