summaryrefslogtreecommitdiffstats
path: root/src/video_core/dma_pusher.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-03-05 08:01:13 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-01-01 22:43:57 +0100
commitc541559767c3912940ee3d73a122530b3edde9f1 (patch)
tree9924302d2b8e383ce8824ccc219da42417bbc6d4 /src/video_core/dma_pusher.cpp
parentMacroHLE: Implement DrawIndexedIndirect & DrawArraysIndirect. (diff)
downloadyuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar.gz
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar.bz2
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar.lz
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar.xz
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.tar.zst
yuzu-c541559767c3912940ee3d73a122530b3edde9f1.zip
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
-rw-r--r--src/video_core/dma_pusher.cpp9
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) {
if (dma_state.method_count) {
// Data word of methods command
+ dma_state.dma_word_offset = static_cast<u32>(index * sizeof(u32));
if (dma_state.non_incrementing) {
const u32 max_write = static_cast<u32>(
std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index);
- dma_state.dma_word_offset = static_cast<u32>(index * sizeof(u32));
CallMultiMethod(&command_header.argument, max_write);
dma_state.method_count -= max_write;
dma_state.is_last_call = true;
@@ -133,6 +133,8 @@ void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) {
case SubmissionMode::Inline:
dma_state.method = command_header.method;
dma_state.subchannel = command_header.subchannel;
+ dma_state.dma_word_offset = static_cast<u64>(
+ -static_cast<s64>(dma_state.dma_get)); // negate to set address as 0
CallMethod(command_header.arg_count);
dma_state.non_incrementing = true;
dma_increment_once = false;
@@ -165,8 +167,9 @@ void DmaPusher::CallMethod(u32 argument) const {
dma_state.method_count,
});
} else {
- subchannels[dma_state.subchannel]->CallMethod(dma_state.method, argument,
- dma_state.is_last_call);
+ auto subchannel = subchannels[dma_state.subchannel];
+ subchannel->current_dma_segment = dma_state.dma_get + dma_state.dma_word_offset;
+ subchannel->CallMethod(dma_state.method, argument, dma_state.is_last_call);
}
}