aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-04-22 03:00:11 -0300
committerGitHub <noreply@github.com>2020-04-22 16:00:11 +1000
commit6bfe4715f05be10c73a788abd8727293a7eca77e (patch)
tree2cb319f53b0c4b846352a9836772c3eff4b1db1d /Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs
parentc46edfab858051e4b800b2705df2c019c1d975cd (diff)
Initial conditional rendering support (#1012)
* Initial conditional rendering support * Properly reset state * Support conditional modes and skeleton a counter cache for future host conditional rendering * Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs
index e89255c8..f4af86f3 100644
--- a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs
+++ b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs
@@ -1,3 +1,5 @@
+using System;
+
namespace Ryujinx.Graphics.Gpu.Memory
{
/// <summary>
@@ -27,7 +29,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
private const ulong PteUnmapped = 0xffffffff_ffffffff;
private const ulong PteReserved = 0xffffffff_fffffffe;
- private ulong[][] _pageTable;
+ private readonly ulong[][] _pageTable;
+
+ public event EventHandler<UnmapEventArgs> MemoryUnmapped;
/// <summary>
/// Creates a new instance of the GPU memory manager.
@@ -181,6 +185,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
SetPte(va + offset, PteUnmapped);
}
+
+ // Event handlers are not expected to be thread safe.
+ MemoryUnmapped?.Invoke(this, new UnmapEventArgs(va, size));
}
}