aco: do not fix_exports when program has epilog

PS with epilog does not need to fix_exports. And radeonsi use
p_end_with_regs so does not have jump instruction at last.

radeonsi may also have exec restore instruction, so may break
before reach to p_end_with_regs.

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>
This commit is contained in:
Qiang Yu
2023-08-17 15:17:20 +08:00
committed by Marge Bot
parent f97a701d89
commit 6eb0910d45
2 changed files with 3 additions and 11 deletions
+3 -10
View File
@@ -1001,21 +1001,14 @@ fix_exports(asm_context& ctx, std::vector<uint32_t>& out, Program* program)
break;
}
} else {
if (!program->info.has_epilog) {
exp.done = true;
exp.valid_mask = true;
}
exp.done = true;
exp.valid_mask = true;
exported = true;
break;
}
} else if ((*it)->definitions.size() && (*it)->definitions[0].physReg() == exec) {
break;
} else if ((*it)->opcode == aco_opcode::s_setpc_b64) {
/* Do not abort if the main FS has an epilog because it only
* exports MRTZ (if present) and the epilog exports colors.
*/
exported |= program->stage.hw == AC_HW_PIXEL_SHADER && program->info.has_epilog;
/* Do not abort for VS/TES as NGG if they are non-monolithic shaders
* because a jump would be emitted.
*/
@@ -1301,7 +1294,7 @@ emit_program(Program* program, std::vector<uint32_t>& code, std::vector<struct a
asm_context ctx(program, symbols);
/* Prolog has no exports. */
if (!program->is_prolog &&
if (!program->is_prolog && !program->info.has_epilog &&
(program->stage.hw == AC_HW_VERTEX_SHADER || program->stage.hw == AC_HW_PIXEL_SHADER ||
program->stage.hw == AC_HW_NEXT_GEN_GEOMETRY_SHADER))
fix_exports(ctx, code, program);