mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-30 06:26:25 +02:00
Add a separate device memory manager (#6153)
* Add a separate device memory manager * Still need this * Device writes are always tracked * Device writes are always tracked (2) * Rename more instances of gmm to mm
This commit is contained in:
parent
90455a05e6
commit
f241f88558
33 changed files with 555 additions and 157 deletions
|
@ -1,4 +1,5 @@
|
|||
using Ryujinx.Common;
|
||||
using Ryujinx.Graphics.Device;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Gpu.Engine.GPFifo;
|
||||
using Ryujinx.Graphics.Gpu.Memory;
|
||||
|
@ -163,6 +164,22 @@ namespace Ryujinx.Graphics.Gpu
|
|||
return new MemoryManager(physicalMemory);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new device memory manager.
|
||||
/// </summary>
|
||||
/// <param name="pid">ID of the process that owns the memory manager</param>
|
||||
/// <returns>The memory manager</returns>
|
||||
/// <exception cref="ArgumentException">Thrown when <paramref name="pid"/> is invalid</exception>
|
||||
public DeviceMemoryManager CreateDeviceMemoryManager(ulong pid)
|
||||
{
|
||||
if (!PhysicalMemoryRegistry.TryGetValue(pid, out var physicalMemory))
|
||||
{
|
||||
throw new ArgumentException("The PID is invalid or the process was not registered", nameof(pid));
|
||||
}
|
||||
|
||||
return physicalMemory.CreateDeviceMemoryManager();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers virtual memory used by a process for GPU memory access, caching and read/write tracking.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue