From 12f1743d5f3ff5250568703562e7992e916b381d Mon Sep 17 00:00:00 2001 From: raphaelthegreat <47210458+raphaelthegreat@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:30:45 +0300 Subject: [PATCH] control_flow: Don't emit discard for null exports --- src/shader_recompiler/frontend/control_flow_graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index bd289ffb..893df1e9 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -149,7 +149,8 @@ void CFG::LinkBlocks() { block.end_class = EndClass::Branch; } else if (end_inst.opcode == Opcode::S_ENDPGM) { const auto& prev_inst = inst_list[block.end_index - 1]; - if (prev_inst.opcode == Opcode::EXP && prev_inst.control.exp.en == 0) { + if (prev_inst.opcode == Opcode::EXP && prev_inst.control.exp.en == 0 && + prev_inst.control.exp.target != 9) { block.end_class = EndClass::Kill; } else { block.end_class = EndClass::Exit;