diff options
| author | 2019-09-10 11:55:45 -0400 | |
|---|---|---|
| committer | 2019-09-10 11:55:45 -0400 | |
| commit | c7ec7bc1f5183f580bf34f9e2dfb59c986551f36 (patch) | |
| tree | a141f778eb57f4583acd24cdcd8027bf2f7099ac /src/video_core/engines | |
| parent | Merge pull request #2759 from ReinUsesLisp/compute-images (diff) | |
| parent | maxwell_3d: Avoid moving macro_params (diff) | |
| download | yuzu-c7ec7bc1f5183f580bf34f9e2dfb59c986551f36.tar.gz yuzu-c7ec7bc1f5183f580bf34f9e2dfb59c986551f36.tar.xz yuzu-c7ec7bc1f5183f580bf34f9e2dfb59c986551f36.zip | |
Merge pull request #2810 from ReinUsesLisp/mme-opt
maxwell_3d: Avoid moving macro_params
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index f5158d219..c8c92757a 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -244,7 +244,7 @@ void Maxwell3D::InitDirtySettings() { | |||
| 244 | dirty_pointers[MAXWELL3D_REG_INDEX(polygon_offset_clamp)] = polygon_offset_dirty_reg; | 244 | dirty_pointers[MAXWELL3D_REG_INDEX(polygon_offset_clamp)] = polygon_offset_dirty_reg; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32> parameters) { | 247 | void Maxwell3D::CallMacroMethod(u32 method, std::size_t num_parameters, const u32* parameters) { |
| 248 | // Reset the current macro. | 248 | // Reset the current macro. |
| 249 | executing_macro = 0; | 249 | executing_macro = 0; |
| 250 | 250 | ||
| @@ -252,7 +252,7 @@ void Maxwell3D::CallMacroMethod(u32 method, std::vector<u32> parameters) { | |||
| 252 | const u32 entry = ((method - MacroRegistersStart) >> 1) % macro_positions.size(); | 252 | const u32 entry = ((method - MacroRegistersStart) >> 1) % macro_positions.size(); |
| 253 | 253 | ||
| 254 | // Execute the current macro. | 254 | // Execute the current macro. |
| 255 | macro_interpreter.Execute(macro_positions[entry], std::move(parameters)); | 255 | macro_interpreter.Execute(macro_positions[entry], num_parameters, parameters); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { | 258 | void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { |
| @@ -289,7 +289,8 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { | |||
| 289 | 289 | ||
| 290 | // Call the macro when there are no more parameters in the command buffer | 290 | // Call the macro when there are no more parameters in the command buffer |
| 291 | if (method_call.IsLastCall()) { | 291 | if (method_call.IsLastCall()) { |
| 292 | CallMacroMethod(executing_macro, std::move(macro_params)); | 292 | CallMacroMethod(executing_macro, macro_params.size(), macro_params.data()); |
| 293 | macro_params.clear(); | ||
| 293 | } | 294 | } |
| 294 | return; | 295 | return; |
| 295 | } | 296 | } |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 3b3c82f41..f67a5389f 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1308,9 +1308,10 @@ private: | |||
| 1308 | /** | 1308 | /** |
| 1309 | * Call a macro on this engine. | 1309 | * Call a macro on this engine. |
| 1310 | * @param method Method to call | 1310 | * @param method Method to call |
| 1311 | * @param num_parameters Number of arguments | ||
| 1311 | * @param parameters Arguments to the method call | 1312 | * @param parameters Arguments to the method call |
| 1312 | */ | 1313 | */ |
| 1313 | void CallMacroMethod(u32 method, std::vector<u32> parameters); | 1314 | void CallMacroMethod(u32 method, std::size_t num_parameters, const u32* parameters); |
| 1314 | 1315 | ||
| 1315 | /// Handles writes to the macro uploading register. | 1316 | /// Handles writes to the macro uploading register. |
| 1316 | void ProcessMacroUpload(u32 data); | 1317 | void ProcessMacroUpload(u32 data); |