summaryrefslogtreecommitdiff
path: root/src/video_core/macro
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/macro')
-rw-r--r--src/video_core/macro/macro.cpp2
-rw-r--r--src/video_core/macro/macro.h4
-rw-r--r--src/video_core/macro/macro_interpreter.cpp2
-rw-r--r--src/video_core/macro/macro_interpreter.h2
-rw-r--r--src/video_core/macro/macro_jit_x64.cpp2
-rw-r--r--src/video_core/macro/macro_jit_x64.h5
6 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp
index d05a88479..89077a2d8 100644
--- a/src/video_core/macro/macro.cpp
+++ b/src/video_core/macro/macro.cpp
@@ -15,7 +15,7 @@ void MacroEngine::AddCode(u32 method, u32 data) {
15 uploaded_macro_code[method].push_back(data); 15 uploaded_macro_code[method].push_back(data);
16} 16}
17 17
18void MacroEngine::Execute(u32 method, std::vector<u32>& parameters) { 18void MacroEngine::Execute(u32 method, const std::vector<u32>& parameters) {
19 auto compiled_macro = macro_cache.find(method); 19 auto compiled_macro = macro_cache.find(method);
20 if (compiled_macro != macro_cache.end()) { 20 if (compiled_macro != macro_cache.end()) {
21 compiled_macro->second->Execute(parameters, method); 21 compiled_macro->second->Execute(parameters, method);
diff --git a/src/video_core/macro/macro.h b/src/video_core/macro/macro.h
index 49fc4d6bc..b76ed891f 100644
--- a/src/video_core/macro/macro.h
+++ b/src/video_core/macro/macro.h
@@ -102,7 +102,7 @@ public:
102 * @param code The macro byte code to execute 102 * @param code The macro byte code to execute
103 * @param parameters The parameters of the macro 103 * @param parameters The parameters of the macro
104 */ 104 */
105 virtual void Execute(std::vector<u32>& parameters, u32 method) = 0; 105 virtual void Execute(const std::vector<u32>& parameters, u32 method) = 0;
106}; 106};
107 107
108class MacroEngine { 108class MacroEngine {
@@ -113,7 +113,7 @@ public:
113 void AddCode(u32 method, u32 data); 113 void AddCode(u32 method, u32 data);
114 114
115 // Compiles the macro if its not in the cache, and executes the compiled macro 115 // Compiles the macro if its not in the cache, and executes the compiled macro
116 void Execute(u32 method, std::vector<u32>& parameters); 116 void Execute(u32 method, const std::vector<u32>& parameters);
117 117
118protected: 118protected:
119 virtual std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) = 0; 119 virtual std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) = 0;
diff --git a/src/video_core/macro/macro_interpreter.cpp b/src/video_core/macro/macro_interpreter.cpp
index e63296a21..5edff27aa 100644
--- a/src/video_core/macro/macro_interpreter.cpp
+++ b/src/video_core/macro/macro_interpreter.cpp
@@ -21,7 +21,7 @@ MacroInterpreterImpl::MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d,
21 const std::vector<u32>& code) 21 const std::vector<u32>& code)
22 : maxwell3d(maxwell3d), code(code) {} 22 : maxwell3d(maxwell3d), code(code) {}
23 23
24void MacroInterpreterImpl::Execute(std::vector<u32>& parameters, u32 method) { 24void MacroInterpreterImpl::Execute(const std::vector<u32>& parameters, u32 method) {
25 MICROPROFILE_SCOPE(MacroInterp); 25 MICROPROFILE_SCOPE(MacroInterp);
26 Reset(); 26 Reset();
27 27
diff --git a/src/video_core/macro/macro_interpreter.h b/src/video_core/macro/macro_interpreter.h
index fb923f7b9..90217fc89 100644
--- a/src/video_core/macro/macro_interpreter.h
+++ b/src/video_core/macro/macro_interpreter.h
@@ -29,7 +29,7 @@ private:
29class MacroInterpreterImpl : public CachedMacro { 29class MacroInterpreterImpl : public CachedMacro {
30public: 30public:
31 MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); 31 MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code);
32 void Execute(std::vector<u32>& parameters, u32 method) override; 32 void Execute(const std::vector<u32>& parameters, u32 method) override;
33 33
34private: 34private:
35 /// Resets the execution engine state, zeroing registers, etc. 35 /// Resets the execution engine state, zeroing registers, etc.
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp
index 48501e582..11c1cc3be 100644
--- a/src/video_core/macro/macro_jit_x64.cpp
+++ b/src/video_core/macro/macro_jit_x64.cpp
@@ -47,7 +47,7 @@ MacroJITx64Impl::MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vecto
47 47
48MacroJITx64Impl::~MacroJITx64Impl() = default; 48MacroJITx64Impl::~MacroJITx64Impl() = default;
49 49
50void MacroJITx64Impl::Execute(std::vector<u32>& parameters, u32 method) { 50void MacroJITx64Impl::Execute(const std::vector<u32>& parameters, u32 method) {
51 MICROPROFILE_SCOPE(MacroJitExecute); 51 MICROPROFILE_SCOPE(MacroJitExecute);
52 ASSERT_OR_EXECUTE(program != nullptr, { return; }); 52 ASSERT_OR_EXECUTE(program != nullptr, { return; });
53 JITState state{}; 53 JITState state{};
diff --git a/src/video_core/macro/macro_jit_x64.h b/src/video_core/macro/macro_jit_x64.h
index 729ed7713..6152cb501 100644
--- a/src/video_core/macro/macro_jit_x64.h
+++ b/src/video_core/macro/macro_jit_x64.h
@@ -13,6 +13,7 @@
13#include "video_core/macro/macro.h" 13#include "video_core/macro/macro.h"
14 14
15namespace Tegra { 15namespace Tegra {
16
16namespace Engines { 17namespace Engines {
17class Maxwell3D; 18class Maxwell3D;
18} 19}
@@ -36,7 +37,7 @@ public:
36 MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); 37 MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code);
37 ~MacroJITx64Impl(); 38 ~MacroJITx64Impl();
38 39
39 void Execute(std::vector<u32>& parameters, u32 method) override; 40 void Execute(const std::vector<u32>& parameters, u32 method) override;
40 41
41 void Compile_ALU(Macro::Opcode opcode); 42 void Compile_ALU(Macro::Opcode opcode);
42 void Compile_AddImmediate(Macro::Opcode opcode); 43 void Compile_AddImmediate(Macro::Opcode opcode);
@@ -66,7 +67,7 @@ private:
66 struct JITState { 67 struct JITState {
67 Engines::Maxwell3D* maxwell3d{}; 68 Engines::Maxwell3D* maxwell3d{};
68 std::array<u32, Macro::NUM_MACRO_REGISTERS> registers{}; 69 std::array<u32, Macro::NUM_MACRO_REGISTERS> registers{};
69 u32* parameters{}; 70 const u32* parameters{};
70 u32 carry_flag{}; 71 u32 carry_flag{};
71 }; 72 };
72 static_assert(offsetof(JITState, maxwell3d) == 0, "Maxwell3D is not at 0x0"); 73 static_assert(offsetof(JITState, maxwell3d) == 0, "Maxwell3D is not at 0x0");