diff options
author | riperiperi <rhy3756547@hotmail.com> | 2021-03-06 14:43:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-06 11:43:55 -0300 |
commit | 8d36681bf1eb732307086203f3bbd2509f55c234 (patch) | |
tree | 284f442c0e94f41d1070083b5f3012426b307212 /Ryujinx.Cpu | |
parent | bab6eedccfa86bc92d87b65efd965621002b8921 (diff) |
Improve handling for unmapped GPU resources (#2083)
* Improve handling for unmapped GPU resources
- Fixed a memory tracking bug that would set protection on empty PTEs
- When a texture's memory is (partially) unmapped, all pool references are forcibly removed and the texture must be rediscovered to draw with it. This will also force the texture discovery to always compare the texture's range for a match.
- RegionHandles now know if they are unmapped, and automatically unset their dirty flag when unmapped.
- Partial texture sync now loads only the region of texture that has been modified. Unmapped memory tracking handles cause dirty flags for a texture group handle to be ignored.
This greatly improves the emulator's stability for newer UE4 games.
* Address feedback, fix MultiRange slice
Fixed an issue where the size of the multi-range slice would be miscalculated.
* Update Ryujinx.Memory/Range/MultiRange.cs (feedback)
Co-authored-by: Mary <thog@protonmail.com>
Co-authored-by: Mary <thog@protonmail.com>
Diffstat (limited to 'Ryujinx.Cpu')
-rw-r--r-- | Ryujinx.Cpu/MemoryManager.cs | 2 | ||||
-rw-r--r-- | Ryujinx.Cpu/Tracking/CpuRegionHandle.cs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Ryujinx.Cpu/MemoryManager.cs b/Ryujinx.Cpu/MemoryManager.cs index 83c288ae..59654e8b 100644 --- a/Ryujinx.Cpu/MemoryManager.cs +++ b/Ryujinx.Cpu/MemoryManager.cs @@ -627,7 +627,7 @@ namespace Ryujinx.Cpu { pte = Volatile.Read(ref pageRef); } - while (Interlocked.CompareExchange(ref pageRef, (pte & invTagMask) | tag, pte) != pte); + while (pte != 0 && Interlocked.CompareExchange(ref pageRef, (pte & invTagMask) | tag, pte) != pte); pageStart++; } diff --git a/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs b/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs index f4391aad..6a530b0e 100644 --- a/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs +++ b/Ryujinx.Cpu/Tracking/CpuRegionHandle.cs @@ -8,6 +8,7 @@ namespace Ryujinx.Cpu.Tracking private readonly RegionHandle _impl; public bool Dirty => _impl.Dirty; + public bool Unmapped => _impl.Unmapped; public ulong Address => _impl.Address; public ulong Size => _impl.Size; public ulong EndAddress => _impl.EndAddress; |