diff --git a/app/src/main/cpp/skyline/gpu/buffer.cpp b/app/src/main/cpp/skyline/gpu/buffer.cpp index b67649e2..4f7f162c 100644 --- a/app/src/main/cpp/skyline/gpu/buffer.cpp +++ b/app/src/main/cpp/skyline/gpu/buffer.cpp @@ -354,8 +354,10 @@ namespace skyline::gpu { return BufferBinding{unifiedMegaBuffer.buffer, unifiedMegaBuffer.offset + offset, size}; } - if (size > MegaBufferingDisableThreshold && sequenceNumber < FrequentlySyncedThresholdHigh) + if (size > MegaBufferingDisableThreshold) { + megaBufferViewAccumulatedSize += size; return {}; + } size_t entryIdx{offset >> megaBufferTableShift}; size_t bufferEntryOffset{entryIdx << megaBufferTableShift}; @@ -409,6 +411,7 @@ namespace skyline::gpu { void Buffer::unlock() { tag = ContextTag{}; AllowAllBackingWrites(); + lastExecutionNumber = 0; mutex.unlock(); } diff --git a/app/src/main/cpp/skyline/gpu/buffer.h b/app/src/main/cpp/skyline/gpu/buffer.h index 4d2493bd..6bb15b51 100644 --- a/app/src/main/cpp/skyline/gpu/buffer.h +++ b/app/src/main/cpp/skyline/gpu/buffer.h @@ -69,7 +69,6 @@ namespace skyline::gpu { static constexpr u32 InitialSequenceNumber{1}; //!< Sequence number that all buffers start off with static constexpr u32 FrequentlySyncedThreshold{6}; //!< Threshold for the sequence number after which the buffer is considered elegible for megabuffering - static constexpr u32 FrequentlySyncedThresholdHigh{16}; //!< Threshold for the sequence number after which the buffer is considered elegible for megabuffering irrespective of view size u32 sequenceNumber{InitialSequenceNumber}; //!< Sequence number that is incremented after all modifications to the host side `backing` buffer, used to prevent redundant copies of the buffer being stored in the megabuffer by views constexpr static vk::DeviceSize MegaBufferingDisableThreshold{1024 * 256}; //!< The threshold at which a view is considered to be too large to be megabuffered (256KiB)