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: