mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 22:20:18 +00:00
Remove unused code
This commit is contained in:
parent
f44ceb043a
commit
5099b77c0f
1 changed files with 0 additions and 59 deletions
|
@ -115,65 +115,6 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<byte> GetSpanMapped(ulong va, int size, bool tracked = false)
|
|
||||||
{
|
|
||||||
bool isContiguous = true;
|
|
||||||
int mappedSize = 0;
|
|
||||||
|
|
||||||
if (ValidateAddress(va) && GetPte(va) != PteUnmapped && Physical.IsMapped(Translate(va)))
|
|
||||||
{
|
|
||||||
ulong endVa = va + (ulong)size;
|
|
||||||
ulong endVaAligned = (endVa + PageMask) & ~PageMask;
|
|
||||||
ulong currentVa = va & ~PageMask;
|
|
||||||
|
|
||||||
int pages = (int)((endVaAligned - currentVa) / PageSize);
|
|
||||||
|
|
||||||
for (int page = 0; page < pages - 1; page++)
|
|
||||||
{
|
|
||||||
ulong nextVa = currentVa + PageSize;
|
|
||||||
ulong nextPa = Translate(nextVa);
|
|
||||||
|
|
||||||
if (!ValidateAddress(nextVa) || GetPte(nextVa) == PteUnmapped || !Physical.IsMapped(nextPa))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Translate(currentVa) + PageSize != nextPa)
|
|
||||||
{
|
|
||||||
isContiguous = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentVa += PageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentVa += PageSize;
|
|
||||||
|
|
||||||
if (currentVa > endVa)
|
|
||||||
{
|
|
||||||
currentVa = endVa;
|
|
||||||
}
|
|
||||||
|
|
||||||
mappedSize = (int)(currentVa - va);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ReadOnlySpan<byte>.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isContiguous)
|
|
||||||
{
|
|
||||||
return Physical.GetSpan(Translate(va), mappedSize, tracked);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Span<byte> data = new byte[mappedSize];
|
|
||||||
|
|
||||||
ReadImpl(va, data, tracked);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads data from a possibly non-contiguous region of GPU mapped memory.
|
/// Reads data from a possibly non-contiguous region of GPU mapped memory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue