summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-04-20 02:16:56 -0400
committerGravatar Fernando Sahmkow2020-04-23 08:52:55 -0400
commit3fedcc2f6e001f0ed1fd791de4f9692570359eef (patch)
tree49109516beab33d825cc653d4e885107304da332 /src/video_core/gpu.cpp
parentMerge pull request #3730 from lioncash/time (diff)
downloadyuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.gz
yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.tar.xz
yuzu-3fedcc2f6e001f0ed1fd791de4f9692570359eef.zip
DMAPusher: Propagate multimethod writes into the engines.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp47
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) {
209 209
210 ASSERT(method_call.subchannel < bound_engines.size()); 210 ASSERT(method_call.subchannel < bound_engines.size());
211 211
212 if (ExecuteMethodOnEngine(method_call)) { 212 if (ExecuteMethodOnEngine(method_call.method)) {
213 CallEngineMethod(method_call); 213 CallEngineMethod(method_call);
214 } else { 214 } else {
215 CallPullerMethod(method_call); 215 CallPullerMethod(method_call);
216 } 216 }
217} 217}
218 218
219bool GPU::ExecuteMethodOnEngine(const MethodCall& method_call) { 219void GPU::CallMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, u32 methods_pending) {
220 const auto method = static_cast<BufferMethods>(method_call.method); 220 LOG_TRACE(HW_GPU, "Processing method {:08X} on subchannel {}", method,
221 return method >= BufferMethods::NonPullerMethods; 221 subchannel);
222
223 ASSERT(subchannel < bound_engines.size());
224
225 if (ExecuteMethodOnEngine(method)) {
226 CallEngineMultiMethod(method, subchannel, base_start, amount, methods_pending);
227 } else {
228 for (std::size_t i = 0; i < amount; i++) {
229 CallPullerMethod({method, base_start[i], subchannel, methods_pending - static_cast<u32>(i)});
230 }
231 }
232}
233
234bool GPU::ExecuteMethodOnEngine(u32 method) {
235 const auto buffer_method = static_cast<BufferMethods>(method);
236 return buffer_method >= BufferMethods::NonPullerMethods;
222} 237}
223 238
224void GPU::CallPullerMethod(const MethodCall& method_call) { 239void GPU::CallPullerMethod(const MethodCall& method_call) {
@@ -298,6 +313,30 @@ void GPU::CallEngineMethod(const MethodCall& method_call) {
298 } 313 }
299} 314}
300 315
316void GPU::CallEngineMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, u32 methods_pending) {
317 const EngineID engine = bound_engines[subchannel];
318
319 switch (engine) {
320 case EngineID::FERMI_TWOD_A:
321 fermi_2d->CallMultiMethod(method, base_start, amount, methods_pending);
322 break;
323 case EngineID::MAXWELL_B:
324 maxwell_3d->CallMultiMethod(method, base_start, amount, methods_pending);
325 break;
326 case EngineID::KEPLER_COMPUTE_B:
327 kepler_compute->CallMultiMethod(method, base_start, amount, methods_pending);
328 break;
329 case EngineID::MAXWELL_DMA_COPY_A:
330 maxwell_dma->CallMultiMethod(method, base_start, amount, methods_pending);
331 break;
332 case EngineID::KEPLER_INLINE_TO_MEMORY_B:
333 kepler_memory->CallMultiMethod(method, base_start, amount, methods_pending);
334 break;
335 default:
336 UNIMPLEMENTED_MSG("Unimplemented engine");
337 }
338}
339
301void GPU::ProcessBindMethod(const MethodCall& method_call) { 340void GPU::ProcessBindMethod(const MethodCall& method_call) {
302 // Bind the current subchannel to the desired engine id. 341 // Bind the current subchannel to the desired engine id.
303 LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", method_call.subchannel, 342 LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", method_call.subchannel,