diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-11-02 23:55:43 +0100 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-11-02 23:55:43 +0100 |
| commit | b233b36862d370d73fe517a1e53c34b50c2845f5 (patch) | |
| tree | 95b13cc96186d55e05989946f27782cefbdd37a7 /src/video_core/gpu.cpp | |
| parent | 694bc8df5c8d5b614bdbdbfa43c57a08316f88c2 (diff) | |
| parent | 172aeaa0449d5618cff5753073a5c1741d619689 (diff) | |
Merge branch 'nx2' into fix/room-proxy-recv
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 53f8f063f7..6dbabcb43a 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -210,6 +210,10 @@ struct GPU::Impl { gpu_thread.Run(std::move(func), is_async); } + void MapInOrder(std::function<void()>&& func) { + gpu_thread.Run(std::move(func), is_async, true); + } + /// 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); @@ -228,7 +232,9 @@ struct GPU::Impl { raster_area.start_address, raster_area.end_address, reads.load(std::memory_order_relaxed)); } - const u64 fence = RequestSyncOperation([this, &raster_area]() { + const u64 fence = RequestSyncOperation([this, raster_area]() { + // Apply collected guest writes before downloading GPU data over guest memory. + InvalidateGPUCache(); renderer->ReadRasterizer()->FlushRegion(raster_area.start_address, raster_area.end_address - raster_area.start_address); }); gpu_thread.TickGPU(is_async); @@ -505,6 +511,10 @@ bool GPU::IsAsync() const { return impl->is_async; } +bool GPU::HasSuspendedChannels() const { + return impl->scheduler.HasPendingChannelsAnyThread(); +} + bool GPU::UseNvdec() const { return impl->use_nvdec; } @@ -549,6 +559,10 @@ void GPU::RunInOrder(std::function<void()>&& func) { impl->RunInOrder(std::move(func)); } +void GPU::MapInOrder(std::function<void()>&& func) { + impl->MapInOrder(std::move(func)); +} + void GPU::InvalidateRegion(DAddr addr, u64 size, bool preserve_gpu_writes) { impl->InvalidateRegion(addr, size, preserve_gpu_writes); } |
