aco: remove p_end_with_regs from needs_exact()
authorQiang Yu <yuq825@gmail.com>
Fri, 25 Aug 2023 06:25:20 +0000 (14:25 +0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 Oct 2023 02:36:33 +0000 (02:36 +0000)
ps needs to handle wqm:
1. main part may compute with args from prolog in wqm mode, so
   prolog need to compute these args in wqm mode too.
2. prolog and main part need to end with exact exec, so next
   shader part which inherit previous shader part's exec won't
   do valid job for helper threads

1 need p_end_with_regs to operate in wqm mode and itself can't
be exact, otherwise some move instruction added by it won't be
in wqm mode so helper threads' compute result is not passed to
next shader part as args.

2 is done by p_end_wqm added by finish_program automatically
after p_end_with_regs.

Piglit tests can trigger the problem:

1. gl-2.1-polygon-stipple-fs
  a. ps prolog call discard_if
  b. ps main pass wqm exec to epilog
  c. ps epilog export color for discarded pixel

2. fs-fwidth-color.shader_test
  a. ps prolog need to pass args computed in wqm mode
  b. set p_end_with_regs to exact will end wqm mode before
     the move instructions, so helper threads's result is not
     passed to next shader part

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>

src/amd/compiler/aco_insert_exec_mask.cpp

index 6053874308a601ed09e41de988db2b8fb7f2c672..d20bc29b120db9a9408bd3bba2833936c69038c0 100644 (file)
@@ -89,8 +89,7 @@ needs_exact(aco_ptr<Instruction>& instr)
        * epilog without considering the exec mask.
        */
       return instr->isEXP() || instr->opcode == aco_opcode::p_jump_to_epilog ||
-             instr->opcode == aco_opcode::p_dual_src_export_gfx11 ||
-             instr->opcode == aco_opcode::p_end_with_regs;
+             instr->opcode == aco_opcode::p_dual_src_export_gfx11;
    }
 }