From 4bb2a415948f63edc72b9e93bfe4bcfa11bc9fab Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 4 Mar 2023 20:16:37 +0000 Subject: [PATCH] Use usagetracker to determine if pushbuffers need to flush the GPU --- app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp b/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp index 49fe7b94..6e9026a4 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp +++ b/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp @@ -156,10 +156,6 @@ namespace skyline::soc::gm20b { } void ChannelGpfifo::Process(GpEntry gpEntry) { - // Submit if required by the GpEntry, this is needed as some games dynamically generate pushbuffer contents - if (gpEntry.sync == GpEntry::Sync::Wait) - channelCtx.executor.Submit({}, *state.settings->useDirectMemoryImport); - if (!gpEntry.size) { // This is a GPFIFO control entry, all control entries have a zero length and contain no pushbuffers switch (gpEntry.opcode) { @@ -172,6 +168,10 @@ namespace skyline::soc::gm20b { } auto pushBufferMappedRanges{channelCtx.asCtx->gmmu.TranslateRange(gpEntry.Address(), gpEntry.size * sizeof(u32))}; + for (auto range : pushBufferMappedRanges) { + if (channelCtx.executor.usageTracker.dirtyIntervals.Intersect(range)) + channelCtx.executor.Submit({}, true); + auto pushBuffer{[&]() -> span { if (pushBufferMappedRanges.size() == 1) { return pushBufferMappedRanges.front().cast();