mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 01:29:48 -06: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:
@ -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>
|
||||
|
Reference in New Issue
Block a user