diff options
| author | 2019-10-27 03:58:37 -0300 | |
|---|---|---|
| committer | 2019-11-07 01:44:08 -0300 | |
| commit | 7b069252f8087f76a6ac3c73a7736a663d58e7b2 (patch) | |
| tree | 70e7db3bafa25d9e0ba3d9f2fff6d5addbe5a142 /src | |
| parent | shader/control_flow: Abstract repeated code chunks in BRX tracking (diff) | |
| download | yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.gz yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.tar.xz yuzu-7b069252f8087f76a6ac3c73a7736a663d58e7b2.zip | |
shader/control_flow: Use callable template instead of std::function
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/shader/control_flow.cpp | 11 |
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 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <functional> | ||
| 6 | #include <list> | 5 | #include <list> |
| 7 | #include <map> | 6 | #include <map> |
| 8 | #include <set> | 7 | #include <set> |
| @@ -157,11 +156,11 @@ std::optional<std::pair<s32, u64>> GetBRXInfo(const CFGRebuildState& state, u32& | |||
| 157 | return std::make_pair(instr.brx.GetBranchExtend(), instr.gpr8.Value()); | 156 | return std::make_pair(instr.brx.GetBranchExtend(), instr.gpr8.Value()); |
| 158 | } | 157 | } |
| 159 | 158 | ||
| 160 | template <typename Result> | 159 | template <typename Result, typename TestCallable, typename PackCallable> |
| 161 | std::optional<Result> TrackInstruction( | 160 | // requires std::predicate<TestCallable, Instruction, const OpCode::Matcher&> |
| 162 | const CFGRebuildState& state, u32& pos, | 161 | // requires std::invocable<PackCallable, Instruction, const OpCode::Matcher&> |
| 163 | std::function<bool(Instruction, const OpCode::Matcher&)>&& test, | 162 | std::optional<Result> TrackInstruction(const CFGRebuildState& state, u32& pos, TestCallable test, |
| 164 | std::function<Result(Instruction, const OpCode::Matcher&)>&& pack) { | 163 | PackCallable pack) { |
| 165 | for (; pos >= state.start; --pos) { | 164 | for (; pos >= state.start; --pos) { |
| 166 | if (IsSchedInstruction(pos, state.start)) { | 165 | if (IsSchedInstruction(pos, state.start)) { |
| 167 | continue; | 166 | continue; |