diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-05-29 01:35:51 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-07-03 00:09:48 +0200 |
commit | 6f7cb69c94bef0795f054d881e061745f69d1eda (patch) | |
tree | cc0bec2fed92a5645886dde773add00c84d8b9f4 /src/video_core/dma_pusher.cpp | |
parent | Merge pull request #10998 from Morph1984/qt-stop-messing-with-me (diff) | |
download | yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar.gz yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar.bz2 yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar.lz yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar.xz yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.tar.zst yuzu-6f7cb69c94bef0795f054d881e061745f69d1eda.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/dma_pusher.cpp | 26 |
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; |