summaryrefslogtreecommitdiffstats
path: root/src/video_core/dma_pusher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
-rw-r--r--src/video_core/dma_pusher.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index 551929824..9f1b340a9 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -5,6 +5,7 @@
#include "common/microprofile.h"
#include "common/settings.h"
#include "core/core.h"
+#include "core/memory.h"
#include "video_core/dma_pusher.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/gpu.h"
@@ -12,6 +13,8 @@
namespace Tegra {
+constexpr u32 MacroRegistersStart = 0xE00;
+
DmaPusher::DmaPusher(Core::System& system_, GPU& gpu_, MemoryManager& memory_manager_,
Control::ChannelState& channel_state_)
: gpu{gpu_}, system{system_}, memory_manager{memory_manager_}, puller{gpu_, memory_manager_,
@@ -74,25 +77,16 @@ bool DmaPusher::Step() {
}
// Push buffer non-empty, read a word
- command_headers.resize_destructive(command_list_header.size);
- constexpr u32 MacroRegistersStart = 0xE00;
- if (dma_state.method < MacroRegistersStart) {
- if (Settings::IsGPULevelHigh()) {
- memory_manager.ReadBlock(dma_state.dma_get, command_headers.data(),
- command_list_header.size * sizeof(u32));
- } else {
- memory_manager.ReadBlockUnsafe(dma_state.dma_get, command_headers.data(),
- command_list_header.size * sizeof(u32));
- }
- } else {
- const size_t copy_size = command_list_header.size * sizeof(u32);
+ if (dma_state.method >= MacroRegistersStart) {
if (subchannels[dma_state.subchannel]) {
- subchannels[dma_state.subchannel]->current_dirty =
- memory_manager.IsMemoryDirty(dma_state.dma_get, copy_size);
+ subchannels[dma_state.subchannel]->current_dirty = memory_manager.IsMemoryDirty(
+ dma_state.dma_get, command_list_header.size * sizeof(u32));
}
- memory_manager.ReadBlockUnsafe(dma_state.dma_get, command_headers.data(), copy_size);
}
- ProcessCommands(command_headers);
+ Core::Memory::GpuGuestMemory<Tegra::CommandHeader,
+ Core::Memory::GuestMemoryFlags::UnsafeRead>
+ headers(memory_manager, dma_state.dma_get, command_list_header.size, &command_headers);
+ ProcessCommands(headers);
}
return true;