From: Samuel Pitoiset Date: Mon, 28 Aug 2023 13:53:40 +0000 (+0200) Subject: aco: allow separate compilation of NGG shaders X-Git-Tag: upstream/23.3.3~2628 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e104718c9f74549efef558bdf06cffa74811f7c8;p=platform%2Fupstream%2Fmesa.git aco: allow separate compilation of NGG shaders Also prevent to emit a long-jump for VS as NGG without a GS. Signed-off-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 553244d..d8525f0 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -11566,9 +11566,8 @@ select_shader(isel_context& ctx, nir_shader* nir, const bool need_startpgm, cons end_divergent_if(&ctx, ic_merged_wave_info); } - if ((ctx.stage.sw == SWStage::VS && - (ctx.stage.hw == AC_HW_HULL_SHADER || ctx.stage.hw == AC_HW_LEGACY_GEOMETRY_SHADER)) || - (ctx.stage.sw == SWStage::TES && ctx.stage.hw == AC_HW_LEGACY_GEOMETRY_SHADER)) { + if (!ctx.program->info.is_monolithic && + (ctx.stage.sw == SWStage::VS || ctx.stage.sw == SWStage::TES)) { assert(program->gfx_level >= GFX9); create_merged_jump_to_epilog(&ctx); ctx.block->kind |= block_kind_export_end; @@ -11759,14 +11758,14 @@ select_program(Program* program, unsigned shader_count, struct nir_shader* const /* Handle separate compilation of VS+TCS and {VS,TES}+GS on GFX9+. */ if (!ctx.program->info.is_monolithic) { assert(ctx.program->gfx_level >= GFX9); - if ((ctx.stage.sw == SWStage::VS && (ctx.stage.hw == AC_HW_HULL_SHADER || - ctx.stage.hw == AC_HW_LEGACY_GEOMETRY_SHADER)) || - (ctx.stage.sw == SWStage::TES && ctx.stage.hw == AC_HW_LEGACY_GEOMETRY_SHADER)) { + if (ctx.stage.sw == SWStage::VS || ctx.stage.sw == SWStage::TES) { check_merged_wave_info = endif_merged_wave_info = true; } else { - assert(ctx.stage == tess_control_hs || ctx.stage == geometry_gs); - check_merged_wave_info = endif_merged_wave_info = true; - need_barrier = true; + const bool ngg_gs = + ctx.stage.hw == AC_HW_NEXT_GEN_GEOMETRY_SHADER && ctx.stage.sw == SWStage::GS; + assert(ctx.stage == tess_control_hs || ctx.stage == geometry_gs || ngg_gs); + check_merged_wave_info = endif_merged_wave_info = !ngg_gs; + need_barrier = !ngg_gs; } }