summaryrefslogtreecommitdiffstats
path: root/src/video_core/macro/macro.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/macro/macro.cpp')
-rw-r--r--src/video_core/macro/macro.cpp19
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 @@
#include "common/assert.h"
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
+#include "common/microprofile.h"
#include "common/settings.h"
+#include "video_core/engines/maxwell_3d.h"
#include "video_core/macro/macro.h"
#include "video_core/macro/macro_hle.h"
#include "video_core/macro/macro_interpreter.h"
@@ -21,6 +23,8 @@
#include "video_core/macro/macro_jit_x64.h"
#endif
+MICROPROFILE_DEFINE(MacroHLE, "GPU", "Execute macro HLE", MP_RGB(128, 192, 192));
+
namespace Tegra {
static void Dump(u64 hash, std::span<const u32> code) {
@@ -40,8 +44,8 @@ static void Dump(u64 hash, std::span<const u32> code) {
macro_file.write(reinterpret_cast<const char*>(code.data()), code.size_bytes());
}
-MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d)
- : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d)} {}
+MacroEngine::MacroEngine(Engines::Maxwell3D& maxwell3d_)
+ : hle_macros{std::make_unique<Tegra::HLEMacro>(maxwell3d_)}, maxwell3d{maxwell3d_} {}
MacroEngine::~MacroEngine() = default;
@@ -59,8 +63,10 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
if (compiled_macro != macro_cache.end()) {
const auto& cache_info = compiled_macro->second;
if (cache_info.has_hle_program) {
+ MICROPROFILE_SCOPE(MacroHLE);
cache_info.hle_program->Execute(parameters, method);
} else {
+ maxwell3d.RefreshParameters();
cache_info.lle_program->Execute(parameters, method);
}
} else {
@@ -101,12 +107,15 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
}
}
- if (auto hle_program = hle_macros->GetHLEProgram(cache_info.hash)) {
+ auto hle_program = hle_macros->GetHLEProgram(cache_info.hash);
+ if (!hle_program || Settings::values.disable_macro_hle) {
+ maxwell3d.RefreshParameters();
+ cache_info.lle_program->Execute(parameters, method);
+ } else {
cache_info.has_hle_program = true;
cache_info.hle_program = std::move(hle_program);
+ MICROPROFILE_SCOPE(MacroHLE);
cache_info.hle_program->Execute(parameters, method);
- } else {
- cache_info.lle_program->Execute(parameters, method);
}
}
}