summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-10-27 07:58:37 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-11-07 05:44:08 +0100
commit7b069252f8087f76a6ac3c73a7736a663d58e7b2 (patch)
tree70e7db3bafa25d9e0ba3d9f2fff6d5addbe5a142 /src
parentshader/control_flow: Abstract repeated code chunks in BRX tracking (diff)
downloadyuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.gz
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.bz2
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.lz
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.xz
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.zst
yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/control_flow.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp
index 278de4084..7e6364d94 100644
--- a/src/video_core/shader/control_flow.cpp
+++ b/src/video_core/shader/control_flow.cpp
@@ -2,7 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <functional>
#include <list>
#include <map>
#include <set>
@@ -157,11 +156,11 @@ std::optional<std::pair<s32, u64>> GetBRXInfo(const CFGRebuildState& state, u32&
return std::make_pair(instr.brx.GetBranchExtend(), instr.gpr8.Value());
}
-template <typename Result>
-std::optional<Result> TrackInstruction(
- const CFGRebuildState& state, u32& pos,
- std::function<bool(Instruction, const OpCode::Matcher&)>&& test,
- std::function<Result(Instruction, const OpCode::Matcher&)>&& pack) {
+template <typename Result, typename TestCallable, typename PackCallable>
+// requires std::predicate<TestCallable, Instruction, const OpCode::Matcher&>
+// requires std::invocable<PackCallable, Instruction, const OpCode::Matcher&>
+std::optional<Result> TrackInstruction(const CFGRebuildState& state, u32& pos, TestCallable test,
+ PackCallable pack) {
for (; pos >= state.start; --pos) {
if (IsSchedInstruction(pos, state.start)) {
continue;