MacroHLE: Refactor MacroHLE system.

This commit is contained in:
Fernando Sahmkow 2022-03-05 08:01:13 +01:00
parent 0f89828073
commit c541559767
11 changed files with 429 additions and 130 deletions

View file

@ -13,6 +13,7 @@
#include "common/fs/fs.h"
#include "common/fs/path_util.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"
@ -40,8 +41,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;
@ -61,6 +62,7 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
if (cache_info.has_hle_program) {
cache_info.hle_program->Execute(parameters, method);
} else {
maxwell3d.RefreshParameters();
cache_info.lle_program->Execute(parameters, method);
}
} else {
@ -106,6 +108,7 @@ void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
cache_info.hle_program = std::move(hle_program);
cache_info.hle_program->Execute(parameters, method);
} else {
maxwell3d.RefreshParameters();
cache_info.lle_program->Execute(parameters, method);
}
}