diff options
| author | 2019-08-25 01:08:35 -0300 | |
|---|---|---|
| committer | 2019-09-04 01:55:01 -0300 | |
| commit | 701dedcfad3001c1aecb2d714da1e22cc407a5ea (patch) | |
| tree | 990c44e2e99ad830e5b028f3dae0d08961623e2a /src/video_core/engines | |
| parent | Merge pull request #2835 from chris062689/master (diff) | |
| download | yuzu-701dedcfad3001c1aecb2d714da1e22cc407a5ea.tar.gz yuzu-701dedcfad3001c1aecb2d714da1e22cc407a5ea.tar.xz yuzu-701dedcfad3001c1aecb2d714da1e22cc407a5ea.zip | |
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 0184342a0..9e7b50327 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1307,9 +1307,10 @@ private: | |||
| 1307 | /** | 1307 | /** |
| 1308 | * Call a macro on this engine. | 1308 | * Call a macro on this engine. |
| 1309 | * @param method Method to call | 1309 | * @param method Method to call |
| 1310 | * @param num_parameters Number of arguments | ||
| 1310 | * @param parameters Arguments to the method call | 1311 | * @param parameters Arguments to the method call |
| 1311 | */ | 1312 | */ |
| 1312 | void CallMacroMethod(u32 method, std::vector<u32> parameters); | 1313 | void CallMacroMethod(u32 method, std::size_t num_parameters, const u32* parameters); |
| 1313 | 1314 | ||
| 1314 | /// Handles writes to the macro uploading register. | 1315 | /// Handles writes to the macro uploading register. |
| 1315 | void ProcessMacroUpload(u32 data); | 1316 | void ProcessMacroUpload(u32 data); |