aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 07:47:45 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 07:47:45 -0400
commit598bb7750c71ea1378724ddfe9418f27330fa279 (patch)
tree3974efea97cc0728dbd49a6526d9933436d788c7 /src/video_core/gpu.cpp
parent6b319471ce12853c95f16140ef01f92b2c7b7b16 (diff)
nx2: unmap GPU memory in submission order
NormalUnmapGpuMemory4K and destroying GPU memory are jobs the console's graphics server completes behind the work already submitted. Run the GMMU unmaps on the GPU thread after the command lists queued before them (GPU::RunInOrder) and signal the job's event only then, instead of unmapping and signalling at once while Eden's GPU thread may still be behind. Also EDEN_NX2_FRAMES_AHEAD (experimental): wait for the previous frame's fence at present instead of this one's.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 1621b24125..2a61a66d82 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -206,6 +206,10 @@ struct GPU::Impl {
gpu_thread.SubmitList(channel, std::move(entries), is_async);
}
+ void RunInOrder(std::function<void()>&& func) {
+ gpu_thread.Run(std::move(func), is_async);
+ }
+
/// Notify rasterizer that any caches of the specified region should be flushed to Switch memory
void FlushRegion(DAddr addr, u64 size) {
gpu_thread.FlushRegion(addr, size, is_async);
@@ -530,6 +534,10 @@ void GPU::FlushRegion(DAddr addr, u64 size) {
impl->FlushRegion(addr, size);
}
+void GPU::RunInOrder(std::function<void()>&& func) {
+ impl->RunInOrder(std::move(func));
+}
+
void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) {
impl->InvalidateRegion(addr, size, preserve_gpu_writes);
}