diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/GpuContext.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/GpuContext.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/GpuContext.cs b/src/Ryujinx.Graphics.Gpu/GpuContext.cs index aaf03ff7..aa0084fd 100644 --- a/src/Ryujinx.Graphics.Gpu/GpuContext.cs +++ b/src/Ryujinx.Graphics.Gpu/GpuContext.cs @@ -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; @@ -164,6 +165,22 @@ namespace Ryujinx.Graphics.Gpu } /// <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> /// <param name="pid">ID of the process that owns <paramref name="cpuMemory"/></param> |