diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-20 08:16:56 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-23 14:52:55 +0200 |
commit | 3fedcc2f6e001f0ed1fd791de4f9692570359eef (patch) | |
tree | 49109516beab33d825cc653d4e885107304da332 /src/video_core/gpu.cpp | |
parent | Merge pull request #3730 from lioncash/time (diff) | |
download | yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.gz yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.bz2 yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.lz yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.xz yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.zst yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/gpu.cpp | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 3b7572d61..54e7876a6 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -209,16 +209,31 @@ void GPU::CallMethod(const MethodCall& method_call) { ASSERT(method_call.subchannel < bound_engines.size()); - if (ExecuteMethodOnEngine(method_call)) { + if (ExecuteMethodOnEngine(method_call.method)) { CallEngineMethod(method_call); } else { CallPullerMethod(method_call); } } -bool GPU::ExecuteMethodOnEngine(const MethodCall& method_call) { - const auto method = static_cast<BufferMethods>(method_call.method); - return method >= BufferMethods::NonPullerMethods; +void GPU::CallMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, u32 methods_pending) { + LOG_TRACE(HW_GPU, "Processing method {:08X} on subchannel {}", method, + subchannel); + + ASSERT(subchannel < bound_engines.size()); + + if (ExecuteMethodOnEngine(method)) { + CallEngineMultiMethod(method, subchannel, base_start, amount, methods_pending); + } else { + for (std::size_t i = 0; i < amount; i++) { + CallPullerMethod({method, base_start[i], subchannel, methods_pending - static_cast<u32>(i)}); + } + } +} + +bool GPU::ExecuteMethodOnEngine(u32 method) { + const auto buffer_method = static_cast<BufferMethods>(method); + return buffer_method >= BufferMethods::NonPullerMethods; } void GPU::CallPullerMethod(const MethodCall& method_call) { @@ -298,6 +313,30 @@ void GPU::CallEngineMethod(const MethodCall& method_call) { } } +void GPU::CallEngineMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, u32 methods_pending) { + const EngineID engine = bound_engines[subchannel]; + + switch (engine) { + case EngineID::FERMI_TWOD_A: + fermi_2d->CallMultiMethod(method, base_start, amount, methods_pending); + break; + case EngineID::MAXWELL_B: + maxwell_3d->CallMultiMethod(method, base_start, amount, methods_pending); + break; + case EngineID::KEPLER_COMPUTE_B: + kepler_compute->CallMultiMethod(method, base_start, amount, methods_pending); + break; + case EngineID::MAXWELL_DMA_COPY_A: + maxwell_dma->CallMultiMethod(method, base_start, amount, methods_pending); + break; + case EngineID::KEPLER_INLINE_TO_MEMORY_B: + kepler_memory->CallMultiMethod(method, base_start, amount, methods_pending); + break; + default: + UNIMPLEMENTED_MSG("Unimplemented engine"); + } +} + void GPU::ProcessBindMethod(const MethodCall& method_call) { // Bind the current subchannel to the desired engine id. LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", method_call.subchannel, |