From 4b3a22fcd46d9aaa281ba1a178aee9891b631a28 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Mon, 26 Dec 2022 13:01:03 +0800 Subject: [PATCH] aco: only ls and ps use store output now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Signed-off-by: Qiang Yu Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 2d0134373c5..cccc628d2da 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -5296,10 +5296,13 @@ load_input_from_temps(isel_context* ctx, nir_intrinsic_instr* instr, Temp dst) void visit_store_output(isel_context* ctx, nir_intrinsic_instr* instr) { - if (ctx->stage == vertex_vs || ctx->stage == tess_eval_vs || ctx->stage == fragment_fs || - ctx->stage == vertex_ngg || ctx->stage == tess_eval_ngg || ctx->stage == mesh_ngg || - (ctx->stage == vertex_tess_control_hs && ctx->shader->info.stage == MESA_SHADER_VERTEX) || - ctx->shader->info.stage == MESA_SHADER_GEOMETRY) { + /* LS pass output to TCS by temp if they have same in/out patch size. */ + bool ls_need_output = ctx->stage == vertex_tess_control_hs && + ctx->shader->info.stage == MESA_SHADER_VERTEX && ctx->tcs_in_out_eq; + + bool ps_need_output = ctx->stage == fragment_fs; + + if (ls_need_output || ps_need_output) { bool stored_to_temps = store_output_to_temps(ctx, instr); if (!stored_to_temps) { isel_err(instr->src[1].ssa->parent_instr, "Unimplemented output offset instruction");