diff options
| author | 2023-01-04 21:20:00 -0500 | |
|---|---|---|
| committer | 2023-01-04 21:20:00 -0500 | |
| commit | b78328f19a54964ef6874281d1a4d6b6ad1c34d9 (patch) | |
| tree | 239947ad53a4a06c3641d58c5d6b8daf5b3dc16a /src/video_core/macro/macro.cpp | |
| parent | Merge pull request #9518 from gidoly/revert-9504-pg2 (diff) | |
| parent | yuzu-ui: Add setting for disabling macro HLE (diff) | |
| download | yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.gz yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.tar.xz yuzu-b78328f19a54964ef6874281d1a4d6b6ad1c34d9.zip | |
Merge pull request #9501 from FernandoS27/yfc-rel-2
Yuzu Fried Chicken Part 1.5: MacroHLE Rework and Dynamic State
Diffstat (limited to 'src/video_core/macro/macro.cpp')
| -rw-r--r-- | src/video_core/macro/macro.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp index 505d81c1e..82ad0477d 100644 --- a/src/video_core/macro/macro.cpp +++ b/src/video_core/macro/macro.cpp | |||
| @@ -12,7 +12,9 @@ | |||
| 12 | #include "common/assert.h" | 12 | #include "common/assert.h" |
| 13 | #include "common/fs/fs.h" | 13 | #include "common/fs/fs.h" |
| 14 | #include "common/fs/path_util.h" | 14 | #include "common/fs/path_util.h" |
| 15 | #include "common/microprofile.h" | ||
| 15 | #include "common/settings.h" | 16 | #include "common/settings.h" |
| 17 | #include "video_core/engines/maxwell_3d.h" | ||
| 16 | #include "video_core/macro/macro.h" | 18 | #include "video_core/macro/macro.h" |
| 17 | #include "video_core/macro/macro_hle.h" | 19 | #include "video_core/macro/macro_hle.h" |
| 18 | #include "video_core/macro/macro_interpreter.h" | 20 | #include "video_core/macro/macro_interpreter.h" |
| @@ -21,6 +23,8 @@ | |||
| 21 | #include "video_core/macro/macro_jit_x64.h" | 23 | #include "video_core/macro/macro_jit_x64.h" |
| 22 | #endif | 24 | #endif |
| 23 | 25 | ||
| 26 | MICROPROFILE_DEFINE(MacroHLE, "GPU", "Execute macro HLE", MP_RGB(128, 192, 192)); | ||
| 27 | |||
| 24 | namespace Tegra { | 28 | namespace Tegra { |
| 25 | 29 | ||
| 26 | static void Dump(u64 hash, std::span<const u32> code) { | 30 | static void Dump(u64 hash, std::span<const u32> code) { |
| @@ -40,8 +44,8 @@ static void Dump(u64 hash, std::span<const u32> code) { | |||
| 40 | macro_file.write(reinterpret_cast<const char*>(code.data()), code.size_bytes()); | 44 | macro_file.write(reinterpret_cast<const char*>(code.data()), code.size_bytes()); |
| 41 | } | 45 | } |
| 42 | 46 | ||
| 43 | MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d) | 47 | MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d_) |
| 44 | : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d)} {} | 48 | : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d_)}, maxwell3d{maxwell3d_} {} |
| 45 | 49 | ||
| 46 | MacroEngine::~MacroEngine() = default; | 50 | MacroEngine::~MacroEngine() = default; |
| 47 | 51 | ||
| @@ -59,8 +63,10 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) { | |||
| 59 | if (compiled_macro != macro_cache.end()) { | 63 | if (compiled_macro != macro_cache.end()) { |
| 60 | const auto& cache_info = compiled_macro->second; | 64 | const auto& cache_info = compiled_macro->second; |
| 61 | if (cache_info.has_hle_program) { | 65 | if (cache_info.has_hle_program) { |
| 66 | MICROPROFILE_SCOPE(MacroHLE); | ||
| 62 | cache_info.hle_program->Execute(parameters, method); | 67 | cache_info.hle_program->Execute(parameters, method); |
| 63 | } else { | 68 | } else { |
| 69 | maxwell3d.RefreshParameters(); | ||
| 64 | cache_info.lle_program->Execute(parameters, method); | 70 | cache_info.lle_program->Execute(parameters, method); |
| 65 | } | 71 | } |
| 66 | } else { | 72 | } else { |
| @@ -101,12 +107,15 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) { | |||
| 101 | } | 107 | } |
| 102 | } | 108 | } |
| 103 | 109 | ||
| 104 | if (auto hle_program = hle_macros->GetHLEProgram(cache_info.hash)) { | 110 | auto hle_program = hle_macros->GetHLEProgram(cache_info.hash); |
| 111 | if (!hle_program || Settings::values.disable_macro_hle) { | ||
| 112 | maxwell3d.RefreshParameters(); | ||
| 113 | cache_info.lle_program->Execute(parameters, method); | ||
| 114 | } else { | ||
| 105 | cache_info.has_hle_program = true; | 115 | cache_info.has_hle_program = true; |
| 106 | cache_info.hle_program = std::move(hle_program); | 116 | cache_info.hle_program = std::move(hle_program); |
| 117 | MICROPROFILE_SCOPE(MacroHLE); | ||
| 107 | cache_info.hle_program->Execute(parameters, method); | 118 | cache_info.hle_program->Execute(parameters, method); |
| 108 | } else { | ||
| 109 | cache_info.lle_program->Execute(parameters, method); | ||
| 110 | } | 119 | } |
| 111 | } | 120 | } |
| 112 | } | 121 | } |