aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Synchronization
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Synchronization')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Synchronization/HostSyncFlags.cs30
-rw-r--r--src/Ryujinx.Graphics.Gpu/Synchronization/ISyncActionHandler.cs22
2 files changed, 52 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Synchronization/HostSyncFlags.cs b/src/Ryujinx.Graphics.Gpu/Synchronization/HostSyncFlags.cs
new file mode 100644
index 00000000..42666991
--- /dev/null
+++ b/src/Ryujinx.Graphics.Gpu/Synchronization/HostSyncFlags.cs
@@ -0,0 +1,30 @@
+using System;
+
+namespace Ryujinx.Graphics.Gpu.Synchronization
+{
+ /// <summary>
+ /// Modifier flags for creating host sync.
+ /// </summary>
+ [Flags]
+ internal enum HostSyncFlags
+ {
+ None = 0,
+
+ /// <summary>
+ /// Present if host sync is being created by a syncpoint.
+ /// </summary>
+ Syncpoint = 1 << 0,
+
+ /// <summary>
+ /// Present if the sync should signal as soon as possible.
+ /// </summary>
+ Strict = 1 << 1,
+
+ /// <summary>
+ /// Present will force the sync to be created, even if no actions are eligible.
+ /// </summary>
+ Force = 1 << 2,
+
+ StrictSyncpoint = Strict | Syncpoint
+ }
+}
diff --git a/src/Ryujinx.Graphics.Gpu/Synchronization/ISyncActionHandler.cs b/src/Ryujinx.Graphics.Gpu/Synchronization/ISyncActionHandler.cs
new file mode 100644
index 00000000..d470d2f0
--- /dev/null
+++ b/src/Ryujinx.Graphics.Gpu/Synchronization/ISyncActionHandler.cs
@@ -0,0 +1,22 @@
+namespace Ryujinx.Graphics.Gpu.Synchronization
+{
+ /// <summary>
+ /// This interface indicates that a class can be registered for a sync action.
+ /// </summary>
+ interface ISyncActionHandler
+ {
+ /// <summary>
+ /// Action to be performed when some synchronizing action is reached after modification.
+ /// Generally used to register read/write tracking to flush resources from GPU when their memory is used.
+ /// </summary>
+ /// <param name="syncpoint">True if the action is a guest syncpoint</param>
+ /// <returns>True if the action is to be removed, false otherwise</returns>
+ bool SyncAction(bool syncpoint);
+
+ /// <summary>
+ /// Action to be performed immediately before sync is created.
+ /// </summary>
+ /// <param name="syncpoint">True if the action is a guest syncpoint</param>
+ void SyncPreAction(bool syncpoint) { }
+ }
+}