mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 20:00:17 +00:00
Update GetWritableRegion to also support unmapped ranges
This commit is contained in:
parent
921776714b
commit
317681b9be
1 changed files with 7 additions and 5 deletions
|
@ -156,11 +156,13 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
for (int i = 0; i < range.Count; i++)
|
for (int i = 0; i < range.Count; i++)
|
||||||
{
|
{
|
||||||
MemoryRange subrange = range.GetSubRange(i);
|
var currentRange = range.GetSubRange(i);
|
||||||
|
int size = (int)currentRange.Size;
|
||||||
GetSpan(subrange.Address, (int)subrange.Size).CopyTo(memory.Span.Slice(offset, (int)subrange.Size));
|
if (currentRange.Address != MemoryManager.PteUnmapped)
|
||||||
|
{
|
||||||
offset += (int)subrange.Size;
|
GetSpan(currentRange.Address, size).CopyTo(memory.Span.Slice(offset, size));
|
||||||
|
}
|
||||||
|
offset += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new WritableRegion(new MultiRangeWritableBlock(range, this), 0, memory, tracked);
|
return new WritableRegion(new MultiRangeWritableBlock(range, this), 0, memory, tracked);
|
||||||
|
|
Loading…
Reference in a new issue