Set state to CpuDirty directly in SynchronizeGuest

`SynchronizeGuest` could only set the dirty state to `Clean` which was redundant since calls to it from inside the write trap handler would set it to `CpuDirty` directly after, this fixes that by doing it inside the function when necessary.
This commit is contained in:
PixelyIon
2022-07-13 22:09:09 +05:30
parent 4f6a67af36
commit c1f2445772
4 changed files with 23 additions and 17 deletions

View File

@ -233,9 +233,10 @@ namespace skyline::gpu {
* @brief Synchronizes the guest buffer with the host buffer
* @param skipTrap If true, setting up a CPU trap will be skipped and the dirty state will be Clean/CpuDirty
* @param nonBlocking If true, the call will return immediately if the fence is not signalled, skipping the sync
* @param setDirty If true, the buffer will be marked as CpuDirty rather than Clean
* @note The buffer **must** be locked prior to calling this
*/
void SynchronizeGuest(bool skipTrap = false, bool nonBlocking = false);
void SynchronizeGuest(bool skipTrap = false, bool nonBlocking = false, bool setDirty = false);
/**
* @brief Synchronizes the guest buffer with the host buffer immediately, flushing GPU work if necessary