radeonsi: fix printing asm for the first shader of merged shaders for ACO

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 <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35620>
This commit is contained in:
Marek Olšák 2025-06-18 18:13:00 -04:00 committed by Marge Bot
parent 23c3646164
commit d4b742f934

View file

@ -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: