diff options
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
| -rw-r--r-- | src/video_core/dma_pusher.cpp | 17 |
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() { | |||
| 56 | 56 | ||
| 57 | if (command_list.prefetch_command_list.size()) { | 57 | if (command_list.prefetch_command_list.size()) { |
| 58 | // Prefetched command list from nvdrv, used for things like synchronization | 58 | // Prefetched command list from nvdrv, used for things like synchronization |
| 59 | command_headers = std::move(command_list.prefetch_command_list); | 59 | ProcessCommands(command_list.prefetch_command_list); |
| 60 | dma_pushbuffer.pop(); | 60 | dma_pushbuffer.pop(); |
| 61 | } else { | 61 | } else { |
| 62 | const CommandListHeader command_list_header{ | 62 | const CommandListHeader command_list_header{ |
| @@ -82,16 +82,21 @@ bool DmaPusher::Step() { | |||
| 82 | memory_manager.ReadBlockUnsafe(dma_get, command_headers.data(), | 82 | memory_manager.ReadBlockUnsafe(dma_get, command_headers.data(), |
| 83 | command_list_header.size * sizeof(u32)); | 83 | command_list_header.size * sizeof(u32)); |
| 84 | } | 84 | } |
| 85 | ProcessCommands(command_headers); | ||
| 85 | } | 86 | } |
| 86 | for (std::size_t index = 0; index < command_headers.size();) { | 87 | |
| 87 | const CommandHeader& command_header = command_headers[index]; | 88 | return true; |
| 89 | } | ||
| 90 | |||
| 91 | void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) { | ||
| 92 | for (std::size_t index = 0; index < commands.size();) { | ||
| 93 | const CommandHeader& command_header = commands[index]; | ||
| 88 | 94 | ||
| 89 | if (dma_state.method_count) { | 95 | if (dma_state.method_count) { |
| 90 | // Data word of methods command | 96 | // Data word of methods command |
| 91 | if (dma_state.non_incrementing) { | 97 | if (dma_state.non_incrementing) { |
| 92 | const u32 max_write = static_cast<u32>( | 98 | const u32 max_write = static_cast<u32>( |
| 93 | std::min<std::size_t>(index + dma_state.method_count, command_headers.size()) - | 99 | std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index); |
| 94 | index); | ||
| 95 | CallMultiMethod(&command_header.argument, max_write); | 100 | CallMultiMethod(&command_header.argument, max_write); |
| 96 | dma_state.method_count -= max_write; | 101 | dma_state.method_count -= max_write; |
| 97 | dma_state.is_last_call = true; | 102 | dma_state.is_last_call = true; |
| @@ -142,8 +147,6 @@ bool DmaPusher::Step() { | |||
| 142 | } | 147 | } |
| 143 | index++; | 148 | index++; |
| 144 | } | 149 | } |
| 145 | |||
| 146 | return true; | ||
| 147 | } | 150 | } |
| 148 | 151 | ||
| 149 | void DmaPusher::SetState(const CommandHeader& command_header) { | 152 | void DmaPusher::SetState(const CommandHeader& command_header) { |