Browse Source

dma pusher stuff

pull/3306/head
lizzie 3 weeks ago
committed by crueter
parent
commit
c334f7dc5d
  1. 19
      src/video_core/dma_pusher.cpp

19
src/video_core/dma_pusher.cpp

@ -108,25 +108,26 @@ bool DmaPusher::Step() {
void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) { void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) {
for (size_t index = 0; index < commands.size();) { for (size_t index = 0; index < commands.size();) {
auto const command_header = commands[index];
if (dma_state.method_count && dma_state.non_incrementing) {
// Data word of methods command // Data word of methods command
if (dma_state.method_count && dma_state.non_incrementing) {
auto const& command_header = commands[index]; //must ref (MUltiMethod re)
dma_state.dma_word_offset = u32(index * sizeof(u32)); dma_state.dma_word_offset = u32(index * sizeof(u32));
const u32 max_write = u32(std::min<size_t>(index + dma_state.method_count, commands.size()) - index);
const u32 max_write = u32(std::min<std::size_t>(index + dma_state.method_count, commands.size()) - index);
CallMultiMethod(&command_header.argument, max_write); CallMultiMethod(&command_header.argument, max_write);
dma_state.method_count -= max_write; dma_state.method_count -= max_write;
dma_state.is_last_call = true; dma_state.is_last_call = true;
index += max_write; index += max_write;
} else if (dma_state.method_count) { } else if (dma_state.method_count) {
// Data word of methods command
auto const command_header = commands[index]; //can copy
dma_state.dma_word_offset = u32(index * sizeof(u32)); dma_state.dma_word_offset = u32(index * sizeof(u32));
dma_state.is_last_call = dma_state.method_count <= 1; dma_state.is_last_call = dma_state.method_count <= 1;
CallMethod(command_header.argument); CallMethod(command_header.argument);
dma_state.method += size_t(!dma_state.non_incrementing);
dma_state.non_incrementing = dma_increment_once;
--dma_state.method_count;
++index;
dma_state.method += !dma_state.non_incrementing ? 1 : 0;
dma_state.non_incrementing |= dma_increment_once;
dma_state.method_count--;
index++;
} else { } else {
auto const command_header = commands[index]; //can copy
// No command active - this is the first word of a new one // No command active - this is the first word of a new one
switch (command_header.mode) { switch (command_header.mode) {
case SubmissionMode::Increasing: case SubmissionMode::Increasing:
@ -155,7 +156,7 @@ void DmaPusher::ProcessCommands(std::span<const CommandHeader> commands) {
default: default:
break; break;
} }
++index;
index++;
} }
} }
} }

Loading…
Cancel
Save