diff options
Diffstat (limited to 'src/video_core/engines/maxwell_3d.cpp')
-rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 8155f6e2e..024c9e43b 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -131,12 +131,10 @@ void Maxwell3D::CallMacroMethod(u32 method, std::size_t num_parameters, const u3 } } -void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { - const u32 method = method_call.method; - +void Maxwell3D::CallMethod(u32 method, u32 method_argument, bool is_last_call) { if (method == cb_data_state.current) { - regs.reg_array[method] = method_call.argument; - ProcessCBData(method_call.argument); + regs.reg_array[method] = method_argument; + ProcessCBData(method_argument); return; } else if (cb_data_state.current != null_cb_data) { FinishCBData(); @@ -159,10 +157,10 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { executing_macro = method; } - macro_params.push_back(method_call.argument); + macro_params.push_back(method_argument); // Call the macro when there are no more parameters in the command buffer - if (method_call.IsLastCall()) { + if (is_last_call) { CallMacroMethod(executing_macro, macro_params.size(), macro_params.data()); macro_params.clear(); } @@ -172,7 +170,7 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { ASSERT_MSG(method < Regs::NUM_REGS, "Invalid Maxwell3D register, increase the size of the Regs structure"); - u32 arg = method_call.argument; + u32 arg = method_argument; // Keep track of the register value in shadow_state when requested. if (shadow_state.shadow_ram_control == Regs::ShadowRamControl::Track || shadow_state.shadow_ram_control == Regs::ShadowRamControl::TrackWithFilter) { @@ -195,7 +193,7 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { break; } case MAXWELL3D_REG_INDEX(shadow_ram_control): { - shadow_state.shadow_ram_control = static_cast<Regs::ShadowRamControl>(method_call.argument); + shadow_state.shadow_ram_control = static_cast<Regs::ShadowRamControl>(method_argument); break; } case MAXWELL3D_REG_INDEX(macros.data): { @@ -278,7 +276,6 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { break; } case MAXWELL3D_REG_INDEX(data_upload): { - const bool is_last_call = method_call.IsLastCall(); upload_state.ProcessData(arg, is_last_call); if (is_last_call) { OnMemoryWrite(); @@ -336,7 +333,7 @@ void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, } default: { for (std::size_t i = 0; i < amount; i++) { - CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); + CallMethod(method, base_start[i], methods_pending - static_cast<u32>(i) <= 1); } } } @@ -366,16 +363,15 @@ void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) { StepInstance(expected_mode, count); } -void Maxwell3D::CallMethodFromMME(const GPU::MethodCall& method_call) { - const u32 method = method_call.method; +void Maxwell3D::CallMethodFromMME(u32 method, u32 method_argument) { if (mme_inline[method]) { - regs.reg_array[method] = method_call.argument; + regs.reg_array[method] = method_argument; if (method == MAXWELL3D_REG_INDEX(vertex_buffer.count) || method == MAXWELL3D_REG_INDEX(index_array.count)) { const MMEDrawMode expected_mode = method == MAXWELL3D_REG_INDEX(vertex_buffer.count) ? MMEDrawMode::Array : MMEDrawMode::Indexed; - StepInstance(expected_mode, method_call.argument); + StepInstance(expected_mode, method_argument); } else if (method == MAXWELL3D_REG_INDEX(draw.vertex_begin_gl)) { mme_draw.instance_mode = (regs.draw.instance_next != 0) || (regs.draw.instance_cont != 0); @@ -387,7 +383,7 @@ void Maxwell3D::CallMethodFromMME(const GPU::MethodCall& method_call) { if (mme_draw.current_mode != MMEDrawMode::Undefined) { FlushMMEInlineDraw(); } - CallMethod(method_call); + CallMethod(method, method_argument, true); } } |