From 92ef6650a477563fc7536bbf40caa2f3291749de Mon Sep 17 00:00:00 2001 From: Framer Date: Sun, 8 Nov 2026 00:52:22 +0100 Subject: [PATCH 1/2] experiment: flush Switch 2 DMA image-to-buffer readback for Pokopia photos --- src/video_core/engines/maxwell_dma.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 0b0541799b..defb26c581 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -15,6 +15,7 @@ #include "video_core/engines/maxwell_dma.h" #include "video_core/guest_memory.h" #include "video_core/memory_manager.h" +#include "video_core/nx2.h" #include "video_core/renderer_base.h" #include "video_core/textures/decoders.h" @@ -203,6 +204,21 @@ void MaxwellDMA::CopyBlockLinearToPitch() { copy_info.length_y = regs.line_count; auto& accelerate = rasterizer->AccessAccelerateDMA(); if (accelerate.ImageToBuffer(copy_info, src_operand, dst_operand)) { + // Switch 2 photo captures may read the DMA destination on the CPU before an + // accelerated GPU image-to-buffer copy reaches guest memory. Flush the copied + // region before DMA completion to avoid encoding stale rows. + // + // Experimental port of notsapinho/Eglantine@7dde4f15. Set + // EDEN_NX2_DMA_READBACK_FLUSH=0 to compare against the existing behavior. + static const bool flush_readbacks = [] { + const char* value = std::getenv("EDEN_NX2_DMA_READBACK_FLUSH"); + return value == nullptr || value[0] != '0'; + }(); + if (flush_readbacks && Tegra::g_nx2_ampere.load(std::memory_order_relaxed)) { + memory_manager.FlushRegion(dst_operand.address, + static_cast(dst_operand.pitch) * regs.line_count, + VideoCommon::CacheType::BufferCache); + } return; } From 981b58d83f950ed9b405afc7f1e4fee0ffa647dd Mon Sep 17 00:00:00 2001 From: Framer Date: Sun, 8 Nov 2026 00:58:56 +0100 Subject: [PATCH 2/2] ci: enable read-only Windows test artifacts for GPU experiments --- .github/workflows/fork-windows-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fork-windows-check.yml b/.github/workflows/fork-windows-check.yml index df03d8dde3..97675f7590 100644 --- a/.github/workflows/fork-windows-check.yml +++ b/.github/workflows/fork-windows-check.yml @@ -8,6 +8,8 @@ on: - .github/workflows/fork-windows-check.yml - .github/workflows/build-windows.yml - src/CMakeLists.txt + - src/video_core/** + - src/shader_recompiler/** - src/yuzu/** - src/yuzu_cmd/** - src/qt_common/**