aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-02 16:38:18 +1000
committerBriar <205427297+icybriarr@users.noreply.github.com>2025-04-04 03:40:49 +0200
commit0071e980b8ff7eb5cef94af9146d3e1c49f7908e (patch)
treeb7696ca35a8382f258483753c5baf68e41f78ddb /src
parentd5bb26bf3e0a98382231fe933914cd6bbddbbb61 (diff)
video_core: Enforce safe memory reads for compute dispatch
- Modify DmaPusher to use safe memory reads when handling compute operations at High GPU accuracy - Prevent potential memory corruption issues that could lead to invalid dispatch parameters - Previously, unsafe reads could result in corrupted launch_description data in KeplerCompute::ProcessLaunch, causing invalid vkCmdDispatch calls - By enforcing safe reads specifically for compute operations, we maintain performance for other GPU tasks while ensuring compute dispatch stability This change requires >= High GPU accuracy level to take effect.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/dma_pusher.cpp15
1 files changed, 9 insertions, 6 deletions
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;