R/Ryujinx.Memory/Tracking
riperiperi a16682cfd3
Allow _volatile to be set from MultiRegionHandle checks again (#3830)
* Allow _volatile to be set from MultiRegionHandle checks again

Tracking handles have a `_volatile` flag which indicates that the resource being tracked is modified every time it is used under a new sequence number. This is used to reduce the time spent reprotecting memory for tracking writes to commonly modified buffers, like constant buffers.

This optimisation works by detecting if a buffer is modified every time a check happens. If a buffer is checked but it is not dirty, then that data is likely not modified every sequence number, and should use memory protection for write tracking. If the opposite is the case all the time, it is faster to just assume it's dirty as we'd just be wasting time protecting the memory.

The new MultiRegionBitmap could not notify handles that they had been checked as part of the fast bitmap lookup, so bindings larger than 4096 bytes wouldn't trigger it at all. This meant that they would be subject to a ton of reprotection if they were modified often.

This does mean there are two separate sources for a _volatile set: VolatileOrDirty + _checkCount, and the bitmap check. These shouldn't interfere with each other, though.

This fixes performance regressions from #3775 in Pokemon Sword, and hopefully Yu-Gi-Oh! RUSH DUEL: Dawn of the Battle Royale. May affect other games.

* Fix stupid mistake
2022-11-18 02:54:20 +00:00
..
AbstractRegion.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
BitMap.cs GPU: Use a bitmap to track buffer modified flags. (#3775) 2022-10-29 22:07:37 +00:00
ConcurrentBitmap.cs GPU: Use a bitmap to track buffer modified flags. (#3775) 2022-10-29 22:07:37 +00:00
IMultiRegionHandle.cs POWER - Performance Optimizations With Extensive Ramifications (#2286) 2021-05-24 22:52:44 +02:00
IRegionHandle.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
MemoryTracking.cs GPU: Use a bitmap to track buffer modified flags. (#3775) 2022-10-29 22:07:37 +00:00
MultiRegionHandle.cs Allow _volatile to be set from MultiRegionHandle checks again (#3830) 2022-11-18 02:54:20 +00:00
PreciseRegionSignal.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
RegionHandle.cs Allow _volatile to be set from MultiRegionHandle checks again (#3830) 2022-11-18 02:54:20 +00:00
RegionSignal.cs Memory Read/Write Tracking using Region Handles (#1272) 2020-10-16 17:18:35 -03:00
SmartMultiRegionHandle.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
VirtualRegion.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00