summaryrefslogtreecommitdiffstats
path: root/src/video_core/dma_pusher.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2022-12-07 06:45:06 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2022-12-20 00:08:04 +0100
commit61e4f2d931449e60d8d720862997ac565fce6634 (patch)
tree9bb7071fdf11dbe8a86d25c7f819c66d5dc127f4 /src/video_core/dma_pusher.cpp
parentbuffer_cache: Use Common::ScratchBuffer for ImmediateBuffer usage (diff)
downloadyuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.gz
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.bz2
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.lz
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.xz
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.zst
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.zip
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
-rw-r--r--src/video_core/dma_pusher.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index 9835e3ac1..d1f541bf5 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -56,7 +56,7 @@ bool DmaPusher::Step() {
if (command_list.prefetch_command_list.size()) {
// Prefetched command list from nvdrv, used for things like synchronization
- command_headers = std::move(command_list.prefetch_command_list);
+ ProcessCommands(command_list.prefetch_command_list);
dma_pushbuffer.pop();
} else {
const CommandListHeader command_list_header{
@@ -82,16 +82,21 @@ bool DmaPusher::Step() {
memory_manager.ReadBlockUnsafe(dma_get, command_headers.data(),
command_list_header.size * sizeof(u32));
}
+ ProcessCommands(command_headers);
}
- for (std::size_t index = 0; index < command_headers.size();) {
- const CommandHeader& command_header = command_headers[index];
+
+ return true;
+}
+
+void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) {
+ for (std::size_t index = 0; index < commands.size();) {
+ const CommandHeader& command_header = commands[index];
if (dma_state.method_count) {
// Data word of methods command
if (dma_state.non_incrementing) {
const u32 max_write = static_cast<u32>(
- std::min<std::size_t>(index + dma_state.method_count, command_headers.size()) -
- index);
+ std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index);
CallMultiMethod(&command_header.argument, max_write);
dma_state.method_count -= max_write;
dma_state.is_last_call = true;
@@ -142,8 +147,6 @@ bool DmaPusher::Step() {
}
index++;
}
-
- return true;
}
void DmaPusher::SetState(const CommandHeader& command_header) {