aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Memory/Range/MemoryRange.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-02-22 13:34:16 -0300
committerGitHub <noreply@github.com>2022-02-22 13:34:16 -0300
commit0a24aa6af26cc55c079e265a071a42569d28d2c0 (patch)
treec0652d606c253f3575cf33b592d2ae3d34b71000 /Ryujinx.Memory/Range/MemoryRange.cs
parentc9c65af59edea05e7206a076cb818128c004384e (diff)
Allow textures to have their data partially mapped (#2629)1.1.52
* Allow textures to have their data partially mapped * Explicitly check for invalid memory ranges on the MultiRangeList * Update GetWritableRegion to also support unmapped ranges
Diffstat (limited to 'Ryujinx.Memory/Range/MemoryRange.cs')
-rw-r--r--Ryujinx.Memory/Range/MemoryRange.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Ryujinx.Memory/Range/MemoryRange.cs b/Ryujinx.Memory/Range/MemoryRange.cs
index ba12bae5..33d2439f 100644
--- a/Ryujinx.Memory/Range/MemoryRange.cs
+++ b/Ryujinx.Memory/Range/MemoryRange.cs
@@ -50,6 +50,13 @@ namespace Ryujinx.Memory.Range
ulong otherAddress = other.Address;
ulong otherEndAddress = other.EndAddress;
+ // If any of the ranges if invalid (address + size overflows),
+ // then they are never considered to overlap.
+ if (thisEndAddress < thisAddress || otherEndAddress < otherAddress)
+ {
+ return false;
+ }
+
return thisAddress < otherEndAddress && otherAddress < thisEndAddress;
}