diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 72 |
1 files changed, 47 insertions, 25 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 879ce542a..39e3b66a2 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -280,34 +280,56 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { | |||
| 280 | } | 280 | } |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) { | 283 | void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, |
| 284 | switch (method) { | 284 | u32 methods_pending) { |
| 285 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): | 285 | // Methods after 0xE00 are special, they're actually triggers for some microcode that was |
| 286 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): | 286 | // uploaded to the GPU during initialization. |
| 287 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): | 287 | if (method >= MacroRegistersStart) { |
| 288 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[3]): | 288 | // We're trying to execute a macro |
| 289 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[4]): | 289 | if (executing_macro == 0) { |
| 290 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[5]): | 290 | // A macro call must begin by writing the macro method's register, not its argument. |
| 291 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[6]): | 291 | ASSERT_MSG((method % 2) == 0, |
| 292 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[7]): | 292 | "Can't start macro execution by writing to the ARGS register"); |
| 293 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[8]): | 293 | executing_macro = method; |
| 294 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[9]): | ||
| 295 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[10]): | ||
| 296 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[11]): | ||
| 297 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[12]): | ||
| 298 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[13]): | ||
| 299 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[14]): | ||
| 300 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[15]): { | ||
| 301 | ProcessCBMultiData(method, base_start, amount); | ||
| 302 | break; | ||
| 303 | } | 294 | } |
| 304 | default: { | 295 | |
| 305 | for (std::size_t i = 0; i < amount; i++) { | 296 | for (std::size_t i = 0; i < amount; i++) { |
| 306 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | 297 | macro_params.push_back(base_start[i]); |
| 307 | } | ||
| 308 | } | 298 | } |
| 309 | } | ||
| 310 | 299 | ||
| 300 | // Call the macro when there are no more parameters in the command buffer | ||
| 301 | if (amount == methods_pending) { | ||
| 302 | CallMacroMethod(executing_macro, macro_params.size(), macro_params.data()); | ||
| 303 | macro_params.clear(); | ||
| 304 | } | ||
| 305 | return; | ||
| 306 | } | ||
| 307 | switch (method) { | ||
| 308 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): | ||
| 309 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): | ||
| 310 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): | ||
| 311 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[3]): | ||
| 312 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[4]): | ||
| 313 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[5]): | ||
| 314 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[6]): | ||
| 315 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[7]): | ||
| 316 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[8]): | ||
| 317 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[9]): | ||
| 318 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[10]): | ||
| 319 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[11]): | ||
| 320 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[12]): | ||
| 321 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[13]): | ||
| 322 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[14]): | ||
| 323 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[15]): { | ||
| 324 | ProcessCBMultiData(method, base_start, amount); | ||
| 325 | break; | ||
| 326 | } | ||
| 327 | default: { | ||
| 328 | for (std::size_t i = 0; i < amount; i++) { | ||
| 329 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 330 | } | ||
| 331 | } | ||
| 332 | } | ||
| 311 | } | 333 | } |
| 312 | 334 | ||
| 313 | void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) { | 335 | void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) { |