aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Memory/Tracking/MemoryTracking.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-03-06 14:43:55 +0000
committerGitHub <noreply@github.com>2021-03-06 11:43:55 -0300
commit8d36681bf1eb732307086203f3bbd2509f55c234 (patch)
tree284f442c0e94f41d1070083b5f3012426b307212 /Ryujinx.Memory/Tracking/MemoryTracking.cs
parentbab6eedccfa86bc92d87b65efd965621002b8921 (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.Memory/Tracking/MemoryTracking.cs')
-rw-r--r--Ryujinx.Memory/Tracking/MemoryTracking.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Ryujinx.Memory/Tracking/MemoryTracking.cs b/Ryujinx.Memory/Tracking/MemoryTracking.cs
index aff223e8..6485e566 100644
--- a/Ryujinx.Memory/Tracking/MemoryTracking.cs
+++ b/Ryujinx.Memory/Tracking/MemoryTracking.cs
@@ -74,6 +74,14 @@ namespace Ryujinx.Memory.Tracking
for (int i = 0; i < count; i++)
{
VirtualRegion region = results[i];
+
+ // If the region has been fully remapped, signal that it has been mapped again.
+ bool remapped = _memoryManager.IsRangeMapped(region.Address, region.Size);
+ if (remapped)
+ {
+ region.SignalMappingChanged(true);
+ }
+
region.RecalculatePhysicalChildren();
region.UpdateProtection();
}
@@ -99,6 +107,7 @@ namespace Ryujinx.Memory.Tracking
for (int i = 0; i < count; i++)
{
VirtualRegion region = results[i];
+ region.SignalMappingChanged(false);
region.RecalculatePhysicalChildren();
}
}