perf(VideoCore): Refactor DispatchIndirect

- Added automatic safe or unsafe processing for better emulation accuracy.

ref: 8cae0310e3
This commit is contained in:
EmulationEnjoyer 2024-11-12 21:28:47 +00:00 committed by spectranator
parent 154aab7c4b
commit 247f61e1f9
1 changed files with 6 additions and 12 deletions

View File

@ -76,13 +76,7 @@ bool DmaPusher::Step() {
return true;
}
// Push buffer non-empty, read a word
if (dma_state.method >= MacroRegistersStart) {
if (subchannels[dma_state.subchannel]) {
subchannels[dma_state.subchannel]->current_dirty = memory_manager.IsMemoryDirty(
dma_state.dma_get, command_list_header.size * sizeof(u32));
}
}
// Determine whether to use safe or unsafe processing
const auto safe_process = [&] {
Tegra::Memory::GpuGuestMemory<Tegra::CommandHeader,
Tegra::Memory::GuestMemoryFlags::SafeRead>
@ -90,6 +84,7 @@ bool DmaPusher::Step() {
&command_headers);
ProcessCommands(headers);
};
const auto unsafe_process = [&] {
Tegra::Memory::GpuGuestMemory<Tegra::CommandHeader,
Tegra::Memory::GuestMemoryFlags::UnsafeRead>
@ -97,14 +92,13 @@ bool DmaPusher::Step() {
&command_headers);
ProcessCommands(headers);
};
if (Settings::IsGPULevelHigh()) {
if (dma_state.method >= MacroRegistersStart) {
unsafe_process();
return true;
}
if (Settings::IsGPULevelHigh() || (dma_state.method >= MacroRegistersStart)) {
safe_process();
return true;
}
unsafe_process();
}
return true;