summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/engines/maxwell_3d.cpp10
-rw-r--r--src/video_core/engines/maxwell_3d.h2
-rw-r--r--src/video_core/macro/macro.cpp2
-rw-r--r--src/video_core/macro/macro.h2
4 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 934a1d6db..0c0a7c1ed 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -115,7 +115,7 @@ void Maxwell3D::InitializeRegisterDefaults() {
115 mme_inline[MAXWELL3D_REG_INDEX(index_array.count)] = true; 115 mme_inline[MAXWELL3D_REG_INDEX(index_array.count)] = true;
116} 116}
117 117
118void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32>&& parameters) { 118void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32>& parameters) {
119 // Reset the current macro. 119 // Reset the current macro.
120 executing_macro = 0; 120 executing_macro = 0;
121 121
@@ -124,7 +124,7 @@ void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32>&& parameters) {
124 ((method - MacroRegistersStart) >> 1) % static_cast<u32>(macro_positions.size()); 124 ((method - MacroRegistersStart) >> 1) % static_cast<u32>(macro_positions.size());
125 125
126 // Execute the current macro. 126 // Execute the current macro.
127 macro_engine->Execute(macro_positions[entry], std::move(parameters)); 127 macro_engine->Execute(macro_positions[entry], parameters);
128 if (mme_draw.current_mode != MMEDrawMode::Undefined) { 128 if (mme_draw.current_mode != MMEDrawMode::Undefined) {
129 FlushMMEInlineDraw(); 129 FlushMMEInlineDraw();
130 } 130 }
@@ -160,7 +160,8 @@ void Maxwell3D::CallMethod(u32 method, u32 method_argument, bool is_last_call) {
160 160
161 // Call the macro when there are no more parameters in the command buffer 161 // Call the macro when there are no more parameters in the command buffer
162 if (is_last_call) { 162 if (is_last_call) {
163 CallMacroMethod(executing_macro, std::move(macro_params)); 163 CallMacroMethod(executing_macro, macro_params);
164 macro_params.clear();
164 } 165 }
165 return; 166 return;
166 } 167 }
@@ -304,7 +305,8 @@ void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount,
304 305
305 // Call the macro when there are no more parameters in the command buffer 306 // Call the macro when there are no more parameters in the command buffer
306 if (amount == methods_pending) { 307 if (amount == methods_pending) {
307 CallMacroMethod(executing_macro, std::move(macro_params)); 308 CallMacroMethod(executing_macro, macro_params);
309 macro_params.clear();
308 } 310 }
309 return; 311 return;
310 } 312 }
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 077bc9841..651f37b4d 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1495,7 +1495,7 @@ private:
1495 * @param num_parameters Number of arguments 1495 * @param num_parameters Number of arguments
1496 * @param parameters Arguments to the method call 1496 * @param parameters Arguments to the method call
1497 */ 1497 */
1498 void CallMacroMethod(u32 method, std::vector<u32>&& parameters); 1498 void CallMacroMethod(u32 method, std::vector<u32>& parameters);
1499 1499
1500 /// Handles writes to the macro uploading register. 1500 /// Handles writes to the macro uploading register.
1501 void ProcessMacroUpload(u32 data); 1501 void ProcessMacroUpload(u32 data);
diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp
index 85a6e5dd4..d05a88479 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, 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 28ca243d1..49fc4d6bc 100644
--- a/src/video_core/macro/macro.h
+++ b/src/video_core/macro/macro.h
@@ -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, 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;