MapBufferEx: take page size into account (#873)

Fix #744
This commit is contained in:
Thog 2020-01-12 03:14:27 +01:00 committed by Ac_K
parent e485ee049d
commit 29e8576b0d
3 changed files with 21 additions and 11 deletions

View file

@ -66,12 +66,13 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// </summary>
/// <param name="pa">CPU virtual address to map into</param>
/// <param name="size">Size in bytes of the mapping</param>
/// <param name="alignment">Required alignment of the GPU virtual address in bytes</param>
/// <returns>GPU virtual address where the range was mapped, or an all ones mask in case of failure</returns>
public ulong Map(ulong pa, ulong size)
public ulong MapAllocate(ulong pa, ulong size, ulong alignment)
{
lock (_pageTable)
{
ulong va = GetFreePosition(size);
ulong va = GetFreePosition(size, alignment);
if (va != PteUnmapped)
{