diff options
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
| -rw-r--r-- | src/video_core/dma_pusher.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 13ff64fa3..5ad40abaa 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp | |||
| @@ -94,10 +94,10 @@ void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) { | |||
| 94 | 94 | ||
| 95 | if (dma_state.method_count) { | 95 | if (dma_state.method_count) { |
| 96 | // Data word of methods command | 96 | // Data word of methods command |
| 97 | dma_state.dma_word_offset = static_cast<u32>(index * sizeof(u32)); | ||
| 97 | if (dma_state.non_incrementing) { | 98 | if (dma_state.non_incrementing) { |
| 98 | const u32 max_write = static_cast<u32>( | 99 | const u32 max_write = static_cast<u32>( |
| 99 | std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index); | 100 | std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index); |
| 100 | dma_state.dma_word_offset = static_cast<u32>(index * sizeof(u32)); | ||
| 101 | CallMultiMethod(&command_header.argument, max_write); | 101 | CallMultiMethod(&command_header.argument, max_write); |
| 102 | dma_state.method_count -= max_write; | 102 | dma_state.method_count -= max_write; |
| 103 | dma_state.is_last_call = true; | 103 | dma_state.is_last_call = true; |
| @@ -133,6 +133,8 @@ void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) { | |||
| 133 | case SubmissionMode::Inline: | 133 | case SubmissionMode::Inline: |
| 134 | dma_state.method = command_header.method; | 134 | dma_state.method = command_header.method; |
| 135 | dma_state.subchannel = command_header.subchannel; | 135 | dma_state.subchannel = command_header.subchannel; |
| 136 | dma_state.dma_word_offset = static_cast<u64>( | ||
| 137 | -static_cast<s64>(dma_state.dma_get)); // negate to set address as 0 | ||
| 136 | CallMethod(command_header.arg_count); | 138 | CallMethod(command_header.arg_count); |
| 137 | dma_state.non_incrementing = true; | 139 | dma_state.non_incrementing = true; |
| 138 | dma_increment_once = false; | 140 | dma_increment_once = false; |
| @@ -165,8 +167,9 @@ void DmaPusher::CallMethod(u32 argument) const { | |||
| 165 | dma_state.method_count, | 167 | dma_state.method_count, |
| 166 | }); | 168 | }); |
| 167 | } else { | 169 | } else { |
| 168 | subchannels[dma_state.subchannel]->CallMethod(dma_state.method, argument, | 170 | auto subchannel = subchannels[dma_state.subchannel]; |
| 169 | dma_state.is_last_call); | 171 | subchannel->current_dma_segment = dma_state.dma_get + dma_state.dma_word_offset; |
| 172 | subchannel->CallMethod(dma_state.method, argument, dma_state.is_last_call); | ||
| 170 | } | 173 | } |
| 171 | } | 174 | } |
| 172 | 175 | ||