mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 21:11:53 +01:00
Drop size restruction bypass for frequently synced buffers
In cases where large buffers are updated every draw this could seriously increase memory usage beyond 3GB in the megabuffer.
This commit is contained in:
parent
1088ed514c
commit
1d83dadefb
@ -354,8 +354,10 @@ namespace skyline::gpu {
|
|||||||
return BufferBinding{unifiedMegaBuffer.buffer, unifiedMegaBuffer.offset + offset, size};
|
return BufferBinding{unifiedMegaBuffer.buffer, unifiedMegaBuffer.offset + offset, size};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size > MegaBufferingDisableThreshold && sequenceNumber < FrequentlySyncedThresholdHigh)
|
if (size > MegaBufferingDisableThreshold) {
|
||||||
|
megaBufferViewAccumulatedSize += size;
|
||||||
return {};
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
size_t entryIdx{offset >> megaBufferTableShift};
|
size_t entryIdx{offset >> megaBufferTableShift};
|
||||||
size_t bufferEntryOffset{entryIdx << megaBufferTableShift};
|
size_t bufferEntryOffset{entryIdx << megaBufferTableShift};
|
||||||
@ -409,6 +411,7 @@ namespace skyline::gpu {
|
|||||||
void Buffer::unlock() {
|
void Buffer::unlock() {
|
||||||
tag = ContextTag{};
|
tag = ContextTag{};
|
||||||
AllowAllBackingWrites();
|
AllowAllBackingWrites();
|
||||||
|
lastExecutionNumber = 0;
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ namespace skyline::gpu {
|
|||||||
|
|
||||||
static constexpr u32 InitialSequenceNumber{1}; //!< Sequence number that all buffers start off with
|
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 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
|
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)
|
constexpr static vk::DeviceSize MegaBufferingDisableThreshold{1024 * 256}; //!< The threshold at which a view is considered to be too large to be megabuffered (256KiB)
|
||||||
|
Loading…
Reference in New Issue
Block a user