mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-26 11:05:32 +03:00
Keep track of buffer dirtiness within an execution
This commit is contained in:
parent
6ea1483c9a
commit
2d97b9fc2c
@ -430,6 +430,8 @@ namespace skyline::gpu {
|
||||
if (!guest)
|
||||
return;
|
||||
|
||||
currentExecutionGpuDirty = true;
|
||||
|
||||
if (isDirect)
|
||||
MarkGpuDirtyImplDirect();
|
||||
else
|
||||
@ -648,6 +650,7 @@ namespace skyline::gpu {
|
||||
void Buffer::unlock() {
|
||||
tag = ContextTag{};
|
||||
AllowAllBackingWrites();
|
||||
currentExecutionGpuDirty = false;
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,8 @@ namespace skyline::gpu {
|
||||
} backingImmutability{}; //!< Describes how the buffer backing should be accessed by the current context
|
||||
RecursiveSpinLock stateMutex; //!< Synchronizes access to the dirty state and backing immutability
|
||||
|
||||
bool currentExecutionGpuDirty{}; //!< If the buffer is GPU dirty within the current execution
|
||||
|
||||
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
|
||||
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
|
||||
@ -322,6 +324,13 @@ namespace skyline::gpu {
|
||||
return accumulatedCpuLockCounter >= FrequentlyLockedThreshold;
|
||||
}
|
||||
|
||||
/*
|
||||
* @note The buffer **must** be locked prior to calling this
|
||||
*/
|
||||
bool IsCurrentExecutionGpuDirty() {
|
||||
return currentExecutionGpuDirty;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Waits on a fence cycle if it exists till it's signalled and resets it after
|
||||
* @note The buffer **must** be locked prior to calling this
|
||||
|
Loading…
Reference in New Issue
Block a user