summaryrefslogtreecommitdiff
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.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp
index d7fabe605..0aeda4ce8 100644
--- a/src/video_core/macro/macro.cpp
+++ b/src/video_core/macro/macro.cpp
@@ -2,12 +2,13 @@
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 <cstring>
5#include <optional> 6#include <optional>
7
6#include <boost/container_hash/hash.hpp> 8#include <boost/container_hash/hash.hpp>
9
7#include "common/assert.h" 10#include "common/assert.h"
8#include "common/logging/log.h"
9#include "common/settings.h" 11#include "common/settings.h"
10#include "video_core/engines/maxwell_3d.h"
11#include "video_core/macro/macro.h" 12#include "video_core/macro/macro.h"
12#include "video_core/macro/macro_hle.h" 13#include "video_core/macro/macro_hle.h"
13#include "video_core/macro/macro_interpreter.h" 14#include "video_core/macro/macro_interpreter.h"
@@ -24,8 +25,7 @@ void MacroEngine::AddCode(u32 method, u32 data) {
24 uploaded_macro_code[method].push_back(data); 25 uploaded_macro_code[method].push_back(data);
25} 26}
26 27
27void MacroEngine::Execute(Engines::Maxwell3D& maxwell3d, u32 method, 28void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
28 const std::vector<u32>& parameters) {
29 auto compiled_macro = macro_cache.find(method); 29 auto compiled_macro = macro_cache.find(method);
30 if (compiled_macro != macro_cache.end()) { 30 if (compiled_macro != macro_cache.end()) {
31 const auto& cache_info = compiled_macro->second; 31 const auto& cache_info = compiled_macro->second;
@@ -66,10 +66,9 @@ void MacroEngine::Execute(Engines::Maxwell3D& maxwell3d, u32 method,
66 cache_info.lle_program = Compile(code); 66 cache_info.lle_program = Compile(code);
67 } 67 }
68 68
69 auto hle_program = hle_macros->GetHLEProgram(cache_info.hash); 69 if (auto hle_program = hle_macros->GetHLEProgram(cache_info.hash)) {
70 if (hle_program.has_value()) {
71 cache_info.has_hle_program = true; 70 cache_info.has_hle_program = true;
72 cache_info.hle_program = std::move(hle_program.value()); 71 cache_info.hle_program = std::move(hle_program);
73 cache_info.hle_program->Execute(parameters, method); 72 cache_info.hle_program->Execute(parameters, method);
74 } else { 73 } else {
75 cache_info.lle_program->Execute(parameters, method); 74 cache_info.lle_program->Execute(parameters, method);