From e409d9f99ba57cfa4f7e695c8cb7e67f287e80ff Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:11:03 +0200 Subject: [PATCH] undo black kart fix it causes stutters --- aurora-main/lib/dolphin/gx/GXFrameBuffer.cpp | 8 +++----- aurora-main/lib/gfx/common.cpp | 9 ++------- aurora-main/tests/gx_fifo_test.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/aurora-main/lib/dolphin/gx/GXFrameBuffer.cpp b/aurora-main/lib/dolphin/gx/GXFrameBuffer.cpp index d57cc05..abd9f6c 100644 --- a/aurora-main/lib/dolphin/gx/GXFrameBuffer.cpp +++ b/aurora-main/lib/dolphin/gx/GXFrameBuffer.cpp @@ -520,11 +520,9 @@ void GXCopyTex(void* dest, GXBool clear) { clearState.clearAlpha = clear && alphaUpdate; } const auto copyFilter = combined_copy_filter_coefficients(g_gxState.copyFilterVFilter); - // Every GXCopyTex is observable texture data. Reusing a destination in this - // or the previous frame does not guarantee another redraw: menu thumbnail - // scratch targets can be reused and then retained. Depth copies have the - // same requirement. Only display presentation may skip unfinished draws. - const bool persistentCopy = true; + // Skip only recurring color copies so one-shot copies are never lost. + const bool producedConsecutively = handle.revision != 0 && currentFrame - handle.lastProducedFrame <= 1; + const bool persistentCopy = !aurora::gx::is_depth_format(texCopyFmt) && !producedConsecutively; aurora::gfx::resolve_pass(handle.handle, rect, clearState.clearColor, clearState.clearAlpha, clearState.clearDepth, clearState.clearColorValue, aurora::gx::clear_depth_value(), resolveFmt, &sourceRect.sampleRect, g_gxState.texCopyHalfScale, ©Filter, forceOpaqueAlpha, diff --git a/aurora-main/lib/gfx/common.cpp b/aurora-main/lib/gfx/common.cpp index 4c3f31d..dd19d88 100644 --- a/aurora-main/lib/gfx/common.cpp +++ b/aurora-main/lib/gfx/common.cpp @@ -1259,11 +1259,6 @@ void split_staging_batch() { retained[i].assign(buffers[i]->data(), buffers[i]->data() + g_suspendedEfbBytes[i]); } } - // GXCopyTex can capture the ordinary EFB as well as an explicit offscreen - // target. Its command may arrive in the next batch, after this prefix has - // already been submitted. Preserve every prefix; target kind cannot tell - // us whether the guest will later retain these pixels in a texture. - for (auto& pass : g_renderPasses) pass.requireReadyPipelines = true; auto encoder = g_device.CreateCommandEncoder(); end_batch(encoder); render(encoder); @@ -1614,8 +1609,8 @@ bool bind_pipeline(PipelineRef ref, const wgpu::RenderPassEncoder& pass, Pipelin if (!skip_unready_pipelines()) { pipelineReady = wait_pipeline(ref, pipeline); } else if (requireReady) { - // Texture copies and capacity prefixes must retain complete draw results. - // A future display frame cannot repair a texture that already captured them. + // The pass resolves into a persistent texture (a one-shot bake such as MKW's minimap), so a + // skipped draw would never be re-issued. These run behind loads, not mid-race. pipelineReady = wait_pipeline_for_persistent_pass(ref, pipeline); } else { pipelineReady = try_pipeline(ref, pipeline); diff --git a/aurora-main/tests/gx_fifo_test.cpp b/aurora-main/tests/gx_fifo_test.cpp index a567788..d72ce43 100644 --- a/aurora-main/tests/gx_fifo_test.cpp +++ b/aurora-main/tests/gx_fifo_test.cpp @@ -4267,7 +4267,7 @@ TEST_F(GXFifoTest, CopyTexColorFormatMarksResolvePersistent) { EXPECT_TRUE(records.front().persistentCopy); } -TEST_F(GXFifoTest, RecurringColorCopyPreservesEveryResolve) { +TEST_F(GXFifoTest, RecurringColorCopyKeepsLaterResolveSkippable) { std::array image{}; gxState().pixelFmt = GX_PF_RGBA6_Z24; @@ -4281,7 +4281,7 @@ TEST_F(GXFifoTest, RecurringColorCopyPreservesEveryResolve) { const auto& records = aurora::gfx::testing::resolve_pass_records(); ASSERT_EQ(records.size(), 2u); EXPECT_TRUE(records[0].persistentCopy); - EXPECT_TRUE(records[1].persistentCopy); + EXPECT_FALSE(records[1].persistentCopy); } TEST_F(GXFifoTest, ColorCopyAfterFrameGapRegainsPersistentProtection) { @@ -4301,7 +4301,7 @@ TEST_F(GXFifoTest, ColorCopyAfterFrameGapRegainsPersistentProtection) { EXPECT_TRUE(records[1].persistentCopy); } -TEST_F(GXFifoTest, CopyTexDepthFormatPreservesResolve) { +TEST_F(GXFifoTest, CopyTexDepthFormatKeepsResolveSkippable) { std::array image{}; gxState().pixelFmt = GX_PF_RGBA6_Z24; @@ -4311,7 +4311,7 @@ TEST_F(GXFifoTest, CopyTexDepthFormatPreservesResolve) { const auto& records = aurora::gfx::testing::resolve_pass_records(); ASSERT_EQ(records.size(), 1u); - EXPECT_TRUE(records.front().persistentCopy); + EXPECT_FALSE(records.front().persistentCopy); } TEST_F(GXFifoTest, CopyDispResolveIsNotPersistent) {