Remove unused code

This commit is contained in:
gdk 2022-03-22 15:39:33 -03:00
parent f44ceb043a
commit 5099b77c0f

View file

@ -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>