Module: Mesa
Branch: main
Commit: 4b3a22fcd46d9aaa281ba1a178aee9891b631a28
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b3a22fcd46d9aaa281ba1a178aee9891b631a28

Author: Qiang Yu <[email protected]>
Date:   Mon Dec 26 13:01:03 2022 +0800

aco: only ls and ps use store output now

Reviewed-by: Timur Kristóf <[email protected]>
Signed-off-by: Qiang Yu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21435>

---

 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");

Reply via email to