Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

video_core: Enforce safe memory reads for compute dispatch

Zephyron0071e980b8ff
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index fb2060ca43..aaacccfa90 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -98,19 +98,22 @@ bool DmaPusher::Step() {
&command_headers);
ProcessCommands(headers);
};
+
+ // Only use unsafe reads for non-compute macro operations
if (Settings::IsGPULevelHigh()) {
- if (dma_state.method >= MacroRegistersStart) {
- unsafe_process();
- return true;
- }
- if (subchannel_type[dma_state.subchannel] == Engines::EngineTypes::KeplerCompute &&
- dma_state.method == ComputeInline) {
+ const bool is_compute = (subchannel_type[dma_state.subchannel] ==
+ Engines::EngineTypes::KeplerCompute);
+
+ if (dma_state.method >= MacroRegistersStart && !is_compute) {
unsafe_process();
return true;
}
+
+ // Always use safe reads for compute operations
safe_process();
return true;
}
+
unsafe_process();
}
return true;