diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 07:47:45 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 07:47:45 -0400 |
| commit | 598bb7750c71ea1378724ddfe9418f27330fa279 (patch) | |
| tree | 3974efea97cc0728dbd49a6526d9933436d788c7 /src/video_core/gpu_thread.cpp | |
| parent | 6b319471ce12853c95f16140ef01f92b2c7b7b16 (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_thread.cpp')
| -rw-r--r-- | src/video_core/gpu_thread.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 97e18df499..793e8e9eeb 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -56,6 +56,8 @@ void ThreadManager::StartThread(VideoCore::RendererBase& renderer, Core::Fronten scheduler.Push(system.GPU(), submit_list->channel, std::move(submit_list->entries)); } else if (std::holds_alternative<GPUTickCommand>(next.data)) { system.GPU().TickWork(); + } else if (auto* run = std::get_if<RunCommand>(&next.data)) { + run->func(); } else if (const auto* flush = std::get_if<FlushRegionCommand>(&next.data)) { renderer.ReadRasterizer()->FlushRegion(flush->addr, flush->size); } else if (const auto* invalidate = std::get_if<InvalidateRegionCommand>(&next.data)) { @@ -89,6 +91,10 @@ void ThreadManager::TickGPU(bool is_async) { PushCommand(GPUTickCommand(), false, is_async); } +void ThreadManager::Run(std::function<void()>&& func, bool is_async) { + PushCommand(RunCommand{std::move(func)}, false, is_async); +} + void ThreadManager::InvalidateRegion(DAddr addr, u64 size) { rasterizer->OnCacheInvalidation(addr, size); } |
