diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 13:48:24 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 13:48:24 -0400 |
| commit | 01effa81ab0e151f8cfd674bf4da952d24645943 (patch) | |
| tree | df3037540d582c4119acef689d4531976cac7f32 /src/video_core/gpu_split.cpp | |
| parent | dfe734dce6aed88038d2fd8f54b06c6b0304cf36 (diff) | |
| parent | ea33ad1865970ee731e5f74dbcc26ca472798afe (diff) | |
Merge branch 'nx2' into nx2-experimental
# Conflicts:
# src/video_core/nx2.h
# src/video_core/renderer_vulkan/vk_texture_cache.cpp
# src/video_core/texture_cache/texture_cache.h
Diffstat (limited to 'src/video_core/gpu_split.cpp')
| -rw-r--r-- | src/video_core/gpu_split.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/video_core/gpu_split.cpp b/src/video_core/gpu_split.cpp index f913ca82ce..ac0d3f25f1 100644 --- a/src/video_core/gpu_split.cpp +++ b/src/video_core/gpu_split.cpp @@ -34,12 +34,14 @@ void Pause() { _mm_pause(); #elif defined(__x86_64__) || defined(__i386__) __builtin_ia32_pause(); +#elif defined(__aarch64__) + asm volatile("yield"); #else std::this_thread::yield(); #endif } -std::atomic<u32> g_back_thread_id{}; +[[maybe_unused]] std::atomic<u32> g_back_thread_id{}; std::atomic<bool> g_back_busy{}; } // Anonymous namespace @@ -88,15 +90,23 @@ void GpuSplit::MaybeStart(Core::System& system_) { return value != nullptr ? value[0] : '2'; }(); const bool wanted = mode == '1' || mode == '2'; - if (active || !wanted || !Tegra::g_nx2_ampere.load(std::memory_order_relaxed)) { + if (!wanted || !Tegra::g_nx2_ampere.load(std::memory_order_relaxed)) { return; } // The front reads command lists straight from guest memory; a read that flushes the caches - // first (safe DMA, accurate GPU) would touch back-owned state. + // first (safe DMA, accurate GPU) would touch back-owned state. The settings can change + // mid-game: hand the engines back to the front (and start again when they allow it). const bool safe_reads = Settings::IsDMALevelDefault() ? Settings::IsGPULevelHigh() : Settings::IsDMALevelSafe(); - if (safe_reads || Settings::IsGPULevelHigh() || - Settings::values.renderer_backend.GetValue() != Settings::RendererBackend::Vulkan) { + const bool allowed = !safe_reads && !Settings::IsGPULevelHigh() && + Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::Vulkan; + if (active && !allowed) { + Drain(); + Stop(); + LOG_INFO(HW_GPU, "GPU thread split: stopped, the accuracy settings need the caches on the front"); + return; + } + if (active || !allowed) { return; } system = &system_; |
