mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-27 15:35:29 +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)
|
if (!guest)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
currentExecutionGpuDirty = true;
|
||||||
|
|
||||||
if (isDirect)
|
if (isDirect)
|
||||||
MarkGpuDirtyImplDirect();
|
MarkGpuDirtyImplDirect();
|
||||||
else
|
else
|
||||||
@ -648,6 +650,7 @@ namespace skyline::gpu {
|
|||||||
void Buffer::unlock() {
|
void Buffer::unlock() {
|
||||||
tag = ContextTag{};
|
tag = ContextTag{};
|
||||||
AllowAllBackingWrites();
|
AllowAllBackingWrites();
|
||||||
|
currentExecutionGpuDirty = false;
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,8 @@ namespace skyline::gpu {
|
|||||||
} backingImmutability{}; //!< Describes how the buffer backing should be accessed by the current context
|
} backingImmutability{}; //!< Describes how the buffer backing should be accessed by the current context
|
||||||
RecursiveSpinLock stateMutex; //!< Synchronizes access to the dirty state and backing immutability
|
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 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
|
||||||
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
|
||||||
@ -322,6 +324,13 @@ namespace skyline::gpu {
|
|||||||
return accumulatedCpuLockCounter >= FrequentlyLockedThreshold;
|
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
|
* @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
|
* @note The buffer **must** be locked prior to calling this
|
||||||
|
Loading…
Reference in New Issue
Block a user