summaryrefslogtreecommitdiff
path: root/src/video_core/dma_pusher.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-11-27 19:17:33 -0500
committerGravatar bunnei2018-11-27 19:17:33 -0500
commitac74b71d7530452126792c5fa0bf01fe7378ba00 (patch)
tree7db6044f15ded8659aff9fd822d41139c495e171 /src/video_core/dma_pusher.cpp
parentgpu: Move command list profiling to DmaPusher::DispatchCalls. (diff)
downloadyuzu-ac74b71d7530452126792c5fa0bf01fe7378ba00.tar.gz
yuzu-ac74b71d7530452126792c5fa0bf01fe7378ba00.tar.xz
yuzu-ac74b71d7530452126792c5fa0bf01fe7378ba00.zip
dma_pushbuffer: Optimize to avoid loop and copy on Push.
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
-rw-r--r--src/video_core/dma_pusher.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index 23ec97944..63a958f11 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -23,6 +23,8 @@ void DmaPusher::DispatchCalls() {
23 // On entering GPU code, assume all memory may be touched by the ARM core. 23 // On entering GPU code, assume all memory may be touched by the ARM core.
24 gpu.Maxwell3D().dirty_flags.OnMemoryWrite(); 24 gpu.Maxwell3D().dirty_flags.OnMemoryWrite();
25 25
26 dma_pushbuffer_subindex = 0;
27
26 while (Core::System::GetInstance().IsPoweredOn()) { 28 while (Core::System::GetInstance().IsPoweredOn()) {
27 if (!Step()) { 29 if (!Step()) {
28 break; 30 break;
@@ -89,11 +91,17 @@ bool DmaPusher::Step() {
89 } 91 }
90 } else if (ib_enable && !dma_pushbuffer.empty()) { 92 } else if (ib_enable && !dma_pushbuffer.empty()) {
91 // Current pushbuffer empty, but we have more IB entries to read 93 // Current pushbuffer empty, but we have more IB entries to read
92 const CommandListHeader& command_list_header{dma_pushbuffer.front()}; 94 const CommandList& command_list{dma_pushbuffer.front()};
95 const CommandListHeader& command_list_header{command_list[dma_pushbuffer_subindex++]};
93 dma_get = command_list_header.addr; 96 dma_get = command_list_header.addr;
94 dma_put = dma_get + command_list_header.size * sizeof(u32); 97 dma_put = dma_get + command_list_header.size * sizeof(u32);
95 non_main = command_list_header.is_non_main; 98 non_main = command_list_header.is_non_main;
96 dma_pushbuffer.pop(); 99
100 if (dma_pushbuffer_subindex >= command_list.size()) {
101 // We've gone through the current list, remove it from the queue
102 dma_pushbuffer.pop();
103 dma_pushbuffer_subindex = 0;
104 }
97 } else { 105 } else {
98 // Otherwise, pushbuffer empty and IB empty or nonexistent - nothing to do 106 // Otherwise, pushbuffer empty and IB empty or nonexistent - nothing to do
99 return {}; 107 return {};