2019-10-13 06:02:07 +00:00
|
|
|
using Ryujinx.Graphics.GAL;
|
2020-07-24 02:53:25 +00:00
|
|
|
using Ryujinx.Graphics.Gpu.Engine.GPFifo;
|
2019-10-13 06:02:07 +00:00
|
|
|
using Ryujinx.Graphics.Gpu.Memory;
|
2021-06-29 17:32:02 +00:00
|
|
|
using Ryujinx.Graphics.Gpu.Shader;
|
2020-04-19 01:25:57 +00:00
|
|
|
using Ryujinx.Graphics.Gpu.Synchronization;
|
2019-10-13 06:02:07 +00:00
|
|
|
using System;
|
2021-06-29 17:32:02 +00:00
|
|
|
using System.Collections.Concurrent;
|
2021-01-17 20:08:06 +00:00
|
|
|
using System.Collections.Generic;
|
2020-11-12 23:15:34 +00:00
|
|
|
using System.Threading;
|
2019-10-13 06:02:07 +00:00
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gpu
|
|
|
|
{
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// GPU emulation context.
|
|
|
|
/// </summary>
|
2019-12-31 22:09:49 +00:00
|
|
|
public sealed class GpuContext : IDisposable
|
2019-10-13 06:02:07 +00:00
|
|
|
{
|
2020-11-12 23:15:34 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Event signaled when the host emulation context is ready to be used by the gpu context.
|
|
|
|
/// </summary>
|
|
|
|
public ManualResetEvent HostInitalized { get; }
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Host renderer.
|
|
|
|
/// </summary>
|
2019-10-13 06:02:07 +00:00
|
|
|
public IRenderer Renderer { get; }
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
2020-07-24 02:53:25 +00:00
|
|
|
/// GPU General Purpose FIFO queue.
|
2019-12-31 20:08:20 +00:00
|
|
|
/// </summary>
|
2020-07-24 02:53:25 +00:00
|
|
|
public GPFifoDevice GPFifo { get; }
|
2019-10-13 06:02:07 +00:00
|
|
|
|
2020-04-19 01:25:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// GPU synchronization manager.
|
|
|
|
/// </summary>
|
|
|
|
public SynchronizationManager Synchronization { get; }
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Presentation window.
|
|
|
|
/// </summary>
|
2019-11-24 02:24:03 +00:00
|
|
|
public Window Window { get; }
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Internal sequence number, used to avoid needless resource data updates
|
|
|
|
/// in the middle of a command buffer before synchronizations.
|
|
|
|
/// </summary>
|
2019-10-13 06:02:07 +00:00
|
|
|
internal int SequenceNumber { get; private set; }
|
|
|
|
|
2021-01-17 20:08:06 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Internal sync number, used to denote points at which host synchronization can be requested.
|
|
|
|
/// </summary>
|
|
|
|
internal ulong SyncNumber { get; private set; }
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-09 16:28:48 +00:00
|
|
|
/// Actions to be performed when a CPU waiting syncpoint or barrier is triggered.
|
2021-01-17 20:08:06 +00:00
|
|
|
/// If there are more than 0 items when this happens, a host sync object will be generated for the given <see cref="SyncNumber"/>,
|
|
|
|
/// and the SyncNumber will be incremented.
|
|
|
|
/// </summary>
|
|
|
|
internal List<Action> SyncActions { get; }
|
|
|
|
|
2022-01-09 16:28:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Actions to be performed when a CPU waiting syncpoint is triggered.
|
|
|
|
/// If there are more than 0 items when this happens, a host sync object will be generated for the given <see cref="SyncNumber"/>,
|
|
|
|
/// and the SyncNumber will be incremented.
|
|
|
|
/// </summary>
|
|
|
|
internal List<Action> SyncpointActions { get; }
|
|
|
|
|
2021-06-23 23:51:41 +00:00
|
|
|
/// <summary>
|
2021-06-29 17:32:02 +00:00
|
|
|
/// Queue with deferred actions that must run on the render thread.
|
2021-06-23 23:51:41 +00:00
|
|
|
/// </summary>
|
2021-06-29 17:32:02 +00:00
|
|
|
internal Queue<Action> DeferredActions { get; }
|
2021-06-23 23:51:41 +00:00
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Registry with physical memories that can be used with this GPU context, keyed by owner process ID.
|
|
|
|
/// </summary>
|
|
|
|
internal ConcurrentDictionary<long, PhysicalMemory> PhysicalMemoryRegistry { get; }
|
2019-10-13 06:02:07 +00:00
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Host hardware capabilities.
|
|
|
|
/// </summary>
|
2022-01-22 18:23:00 +00:00
|
|
|
internal ref Capabilities Capabilities
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (!_capsLoaded)
|
|
|
|
{
|
|
|
|
_caps = Renderer.GetCapabilities();
|
|
|
|
_capsLoaded = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref _caps;
|
|
|
|
}
|
|
|
|
}
|
2019-10-13 06:02:07 +00:00
|
|
|
|
2021-03-03 00:39:36 +00:00
|
|
|
/// <summary>
|
2021-03-22 18:40:07 +00:00
|
|
|
/// Event for signalling shader cache loading progress.
|
2021-03-03 00:39:36 +00:00
|
|
|
/// </summary>
|
2021-06-29 17:32:02 +00:00
|
|
|
public event Action<ShaderCacheState, int, int> ShaderCacheStateChanged;
|
|
|
|
|
2022-01-22 18:23:00 +00:00
|
|
|
private bool _capsLoaded;
|
|
|
|
private Capabilities _caps;
|
2022-01-09 16:28:48 +00:00
|
|
|
private Thread _gpuThread;
|
2021-03-03 00:39:36 +00:00
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new instance of the GPU emulation context.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="renderer">Host renderer</param>
|
2019-10-13 06:02:07 +00:00
|
|
|
public GpuContext(IRenderer renderer)
|
|
|
|
{
|
|
|
|
Renderer = renderer;
|
|
|
|
|
2020-07-24 02:53:25 +00:00
|
|
|
GPFifo = new GPFifoDevice(this);
|
2019-10-13 06:02:07 +00:00
|
|
|
|
2020-04-19 01:25:57 +00:00
|
|
|
Synchronization = new SynchronizationManager();
|
|
|
|
|
2019-11-24 02:24:03 +00:00
|
|
|
Window = new Window(this);
|
|
|
|
|
2020-11-12 23:15:34 +00:00
|
|
|
HostInitalized = new ManualResetEvent(false);
|
2021-01-17 20:08:06 +00:00
|
|
|
|
|
|
|
SyncActions = new List<Action>();
|
2022-01-09 16:28:48 +00:00
|
|
|
SyncpointActions = new List<Action>();
|
2021-06-23 23:51:41 +00:00
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
DeferredActions = new Queue<Action>();
|
|
|
|
|
|
|
|
PhysicalMemoryRegistry = new ConcurrentDictionary<long, PhysicalMemory>();
|
2021-06-23 23:51:41 +00:00
|
|
|
}
|
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new GPU channel.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The GPU channel</returns>
|
2021-06-23 23:51:41 +00:00
|
|
|
public GpuChannel CreateChannel()
|
|
|
|
{
|
|
|
|
return new GpuChannel(this);
|
2020-11-12 23:15:34 +00:00
|
|
|
}
|
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new GPU 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 MemoryManager CreateMemoryManager(long pid)
|
|
|
|
{
|
|
|
|
if (!PhysicalMemoryRegistry.TryGetValue(pid, out var physicalMemory))
|
|
|
|
{
|
|
|
|
throw new ArgumentException("The PID is invalid or the process was not registered", nameof(pid));
|
|
|
|
}
|
|
|
|
|
|
|
|
return new MemoryManager(physicalMemory);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <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>
|
|
|
|
/// <param name="cpuMemory">Virtual memory owned by the process</param>
|
|
|
|
/// <exception cref="ArgumentException">Thrown if <paramref name="pid"/> was already registered</exception>
|
|
|
|
public void RegisterProcess(long pid, Cpu.IVirtualMemoryManagerTracked cpuMemory)
|
|
|
|
{
|
|
|
|
var physicalMemory = new PhysicalMemory(this, cpuMemory);
|
|
|
|
if (!PhysicalMemoryRegistry.TryAdd(pid, physicalMemory))
|
|
|
|
{
|
|
|
|
throw new ArgumentException("The PID was already registered", nameof(pid));
|
|
|
|
}
|
|
|
|
|
|
|
|
physicalMemory.ShaderCache.ShaderCacheStateChanged += ShaderCacheStateUpdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Unregisters a process, indicating that its memory will no longer be used, and that caches can be freed.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="pid">ID of the process</param>
|
|
|
|
public void UnregisterProcess(long pid)
|
|
|
|
{
|
|
|
|
if (PhysicalMemoryRegistry.TryRemove(pid, out var physicalMemory))
|
|
|
|
{
|
|
|
|
physicalMemory.ShaderCache.ShaderCacheStateChanged -= ShaderCacheStateUpdate;
|
|
|
|
physicalMemory.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shader cache state update handler.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="state">Current state of the shader cache load process</param>
|
|
|
|
/// <param name="current">Number of the current shader being processed</param>
|
|
|
|
/// <param name="total">Total number of shaders to process</param>
|
|
|
|
private void ShaderCacheStateUpdate(ShaderCacheState state, int current, int total)
|
|
|
|
{
|
|
|
|
ShaderCacheStateChanged?.Invoke(state, current, total);
|
|
|
|
}
|
|
|
|
|
2020-11-12 23:15:34 +00:00
|
|
|
/// <summary>
|
2020-11-17 21:40:19 +00:00
|
|
|
/// Initialize the GPU shader cache.
|
2020-11-12 23:15:34 +00:00
|
|
|
/// </summary>
|
2020-11-17 21:40:19 +00:00
|
|
|
public void InitializeShaderCache()
|
2020-11-12 23:15:34 +00:00
|
|
|
{
|
|
|
|
HostInitalized.WaitOne();
|
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
foreach (var physicalMemory in PhysicalMemoryRegistry.Values)
|
|
|
|
{
|
|
|
|
physicalMemory.ShaderCache.Initialize();
|
|
|
|
}
|
2019-10-13 06:02:07 +00:00
|
|
|
}
|
|
|
|
|
2022-01-09 16:28:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the current thread as the main GPU thread.
|
|
|
|
/// </summary>
|
|
|
|
public void SetGpuThread()
|
|
|
|
{
|
|
|
|
_gpuThread = Thread.CurrentThread;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks if the current thread is the GPU thread.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>True if the thread is the GPU thread, false otherwise</returns>
|
|
|
|
public bool IsGpuThread()
|
|
|
|
{
|
|
|
|
return _gpuThread == Thread.CurrentThread;
|
|
|
|
}
|
|
|
|
|
Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501)
* Initial Implementation
About as fast as nvidia GL multithreading, can be improved with faster command queuing.
* Struct based command list
Speeds up a bit. Still a lot of time lost to resource copy.
* Do shader init while the render thread is active.
* Introduce circular span pool V1
Ideally should be able to use structs instead of references for storing these spans on commands. Will try that next.
* Refactor SpanRef some more
Use a struct to represent SpanRef, rather than a reference.
* Flush buffers on background thread
* Use a span for UpdateRenderScale.
Much faster than copying the array.
* Calculate command size using reflection
* WIP parallel shaders
* Some minor optimisation
* Only 2 max refs per command now.
The command with 3 refs is gone. :relieved:
* Don't cast on the GPU side
* Remove redundant casts, force sync on window present
* Fix Shader Cache
* Fix host shader save.
* Fixup to work with new renderer stuff
* Make command Run static, use array of delegates as lookup
Profile says this takes less time than the previous way.
* Bring up to date
* Add settings toggle. Fix Muiltithreading Off mode.
* Fix warning.
* Release tracking lock for flushes
* Fix Conditional Render fast path with threaded gal
* Make handle iteration safe when releasing the lock
This is mostly temporary.
* Attempt to set backend threading on driver
Only really works on nvidia before launching a game.
* Fix race condition with BufferModifiedRangeList, exceptions in tracking actions
* Update buffer set commands
* Some cleanup
* Only use stutter workaround when using opengl renderer non-threaded
* Add host-conditional reservation of counter events
There has always been the possibility that conditional rendering could use a query object just as it is disposed by the counter queue. This change makes it so that when the host decides to use host conditional rendering, the query object is reserved so that it cannot be deleted. Counter events can optionally start reserved, as the threaded implementation can reserve them before the backend creates them, and there would otherwise be a short amount of time where the counter queue could dispose the event before a call to reserve it could be made.
* Address Feedback
* Make counter flush tracked again.
Hopefully does not cause any issues this time.
* Wait for FlushTo on the main queue thread.
Currently assumes only one thread will want to FlushTo (in this case, the GPU thread)
* Add SDL2 headless integration
* Add HLE macro commands.
Co-authored-by: Mary <mary@mary.zone>
2021-08-26 22:31:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Processes the queue of shaders that must save their binaries to the disk cache.
|
|
|
|
/// </summary>
|
|
|
|
public void ProcessShaderCacheQueue()
|
|
|
|
{
|
|
|
|
foreach (var physicalMemory in PhysicalMemoryRegistry.Values)
|
|
|
|
{
|
|
|
|
physicalMemory.ShaderCache.ProcessShaderCacheQueue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Advances internal sequence number.
|
|
|
|
/// This forces the update of any modified GPU resource.
|
|
|
|
/// </summary>
|
2019-10-13 06:02:07 +00:00
|
|
|
internal void AdvanceSequence()
|
|
|
|
{
|
|
|
|
SequenceNumber++;
|
|
|
|
}
|
|
|
|
|
2021-01-17 20:08:06 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Registers an action to be performed the next time a syncpoint is incremented.
|
|
|
|
/// This will also ensure a host sync object is created, and <see cref="SyncNumber"/> is incremented.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="action">The action to be performed on sync object creation</param>
|
2022-01-09 16:28:48 +00:00
|
|
|
/// <param name="syncpointOnly">True if the sync action should only run when syncpoints are incremented</param>
|
|
|
|
public void RegisterSyncAction(Action action, bool syncpointOnly = false)
|
2021-01-17 20:08:06 +00:00
|
|
|
{
|
2022-01-09 16:28:48 +00:00
|
|
|
if (syncpointOnly)
|
|
|
|
{
|
|
|
|
SyncpointActions.Add(action);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SyncActions.Add(action);
|
|
|
|
}
|
2021-01-17 20:08:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a host sync object if there are any pending sync actions. The actions will then be called.
|
|
|
|
/// If no actions are present, a host sync object is not created.
|
|
|
|
/// </summary>
|
2022-01-09 16:28:48 +00:00
|
|
|
/// <param name="syncpoint">True if host sync is being created by a syncpoint</param>
|
|
|
|
public void CreateHostSyncIfNeeded(bool syncpoint)
|
2021-01-17 20:08:06 +00:00
|
|
|
{
|
2022-01-09 16:28:48 +00:00
|
|
|
if (SyncActions.Count > 0 || (syncpoint && SyncpointActions.Count > 0))
|
2021-01-17 20:08:06 +00:00
|
|
|
{
|
|
|
|
Renderer.CreateSync(SyncNumber);
|
|
|
|
|
|
|
|
SyncNumber++;
|
|
|
|
|
|
|
|
foreach (Action action in SyncActions)
|
|
|
|
{
|
|
|
|
action();
|
|
|
|
}
|
|
|
|
|
2022-01-09 16:28:48 +00:00
|
|
|
foreach (Action action in SyncpointActions)
|
|
|
|
{
|
|
|
|
action();
|
|
|
|
}
|
|
|
|
|
2021-01-17 20:08:06 +00:00
|
|
|
SyncActions.Clear();
|
2022-01-09 16:28:48 +00:00
|
|
|
SyncpointActions.Clear();
|
2021-01-17 20:08:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-23 23:51:41 +00:00
|
|
|
/// <summary>
|
2021-06-29 17:32:02 +00:00
|
|
|
/// Performs deferred actions.
|
|
|
|
/// This is useful for actions that must run on the render thread, such as resource disposal.
|
2021-06-23 23:51:41 +00:00
|
|
|
/// </summary>
|
2021-06-29 17:32:02 +00:00
|
|
|
internal void RunDeferredActions()
|
2021-06-23 23:51:41 +00:00
|
|
|
{
|
2021-06-29 17:32:02 +00:00
|
|
|
while (DeferredActions.TryDequeue(out Action action))
|
2021-06-23 23:51:41 +00:00
|
|
|
{
|
2021-06-29 17:32:02 +00:00
|
|
|
action();
|
2021-06-23 23:51:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-31 22:09:49 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Disposes all GPU resources currently cached.
|
|
|
|
/// It's an error to push any GPU commands after disposal.
|
|
|
|
/// Additionally, the GPU commands FIFO must be empty for disposal,
|
|
|
|
/// and processing of all commands must have finished.
|
|
|
|
/// </summary>
|
|
|
|
public void Dispose()
|
|
|
|
{
|
2020-01-21 22:23:11 +00:00
|
|
|
Renderer.Dispose();
|
2020-07-24 02:53:25 +00:00
|
|
|
GPFifo.Dispose();
|
2020-11-12 23:15:34 +00:00
|
|
|
HostInitalized.Dispose();
|
POWER - Performance Optimizations With Extensive Ramifications (#2286)
* Refactoring of KMemoryManager class
* Replace some trivial uses of DRAM address with VA
* Get rid of GetDramAddressFromVa
* Abstracting more operations on derived page table class
* Run auto-format on KPageTableBase
* Managed to make TryConvertVaToPa private, few uses remains now
* Implement guest physical pages ref counting, remove manual freeing
* Make DoMmuOperation private and call new abstract methods only from the base class
* Pass pages count rather than size on Map/UnmapMemory
* Change memory managers to take host pointers
* Fix a guest memory leak and simplify KPageTable
* Expose new methods for host range query and mapping
* Some refactoring of MapPagesFromClientProcess to allow proper page ref counting and mapping without KPageLists
* Remove more uses of AddVaRangeToPageList, now only one remains (shared memory page checking)
* Add a SharedMemoryStorage class, will be useful for host mapping
* Sayonara AddVaRangeToPageList, you served us well
* Start to implement host memory mapping (WIP)
* Support memory tracking through host exception handling
* Fix some access violations from HLE service guest memory access and CPU
* Fix memory tracking
* Fix mapping list bugs, including a race and a error adding mapping ranges
* Simple page table for memory tracking
* Simple "volatile" region handle mode
* Update UBOs directly (experimental, rough)
* Fix the overlap check
* Only set non-modified buffers as volatile
* Fix some memory tracking issues
* Fix possible race in MapBufferFromClientProcess (block list updates were not locked)
* Write uniform update to memory immediately, only defer the buffer set.
* Fix some memory tracking issues
* Pass correct pages count on shared memory unmap
* Armeilleure Signal Handler v1 + Unix changes
Unix currently behaves like windows, rather than remapping physical
* Actually check if the host platform is unix
* Fix decommit on linux.
* Implement windows 10 placeholder shared memory, fix a buffer issue.
* Make PTC version something that will never match with master
* Remove testing variable for block count
* Add reference count for memory manager, fix dispose
Can still deadlock with OpenAL
* Add address validation, use page table for mapped check, add docs
Might clean up the page table traversing routines.
* Implement batched mapping/tracking.
* Move documentation, fix tests.
* Cleanup uniform buffer update stuff.
* Remove unnecessary assignment.
* Add unsafe host mapped memory switch
On by default. Would be good to turn this off for untrusted code (homebrew, exefs mods) and give the user the option to turn it on manually, though that requires some UI work.
* Remove C# exception handlers
They have issues due to current .NET limitations, so the meilleure one fully replaces them for now.
* Fix MapPhysicalMemory on the software MemoryManager.
* Null check for GetHostAddress, docs
* Add configuration for setting memory manager mode (not in UI yet)
* Add config to UI
* Fix type mismatch on Unix signal handler code emit
* Fix 6GB DRAM mode.
The size can be greater than `uint.MaxValue` when the DRAM is >4GB.
* Address some feedback.
* More detailed error if backing memory cannot be mapped.
* SetLastError on all OS functions for consistency
* Force pages dirty with UBO update instead of setting them directly.
Seems to be much faster across a few games. Need retesting.
* Rebase, configuration rework, fix mem tracking regression
* Fix race in FreePages
* Set memory managers null after decrementing ref count
* Remove readonly keyword, as this is now modified.
* Use a local variable for the signal handler rather than a register.
* Fix bug with buffer resize, and index/uniform buffer binding.
Should fix flickering in games.
* Add InvalidAccessHandler to MemoryTracking
Doesn't do anything yet
* Call invalid access handler on unmapped read/write.
Same rules as the regular memory manager.
* Make unsafe mapped memory its own MemoryManagerType
* Move FlushUboDirty into UpdateState.
* Buffer dirty cache, rather than ubo cache
Much cleaner, may be reusable for Inline2Memory updates.
* This doesn't return anything anymore.
* Add sigaction remove methods, correct a few function signatures.
* Return empty list of physical regions for size 0.
* Also on AddressSpaceManager
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2021-05-24 20:52:44 +00:00
|
|
|
|
2021-06-29 17:32:02 +00:00
|
|
|
// Has to be disposed before processing deferred actions, as it will produce some.
|
|
|
|
foreach (var physicalMemory in PhysicalMemoryRegistry.Values)
|
|
|
|
{
|
|
|
|
physicalMemory.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
PhysicalMemoryRegistry.Clear();
|
|
|
|
|
|
|
|
RunDeferredActions();
|
2019-12-31 22:09:49 +00:00
|
|
|
}
|
2019-10-13 06:02:07 +00:00
|
|
|
}
|
|
|
|
}
|