diff options
| author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2024-07-16 21:01:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 17:01:06 -0300 |
| commit | 344f4f52c1117028d08802aff60fbd4d875717b4 (patch) | |
| tree | f8af9e8d2755b4c7396ff78d1aaaf66c6d608fe2 /src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs | |
| parent | eb212aa91b45945d7bfd1ab19571b095edff5cc7 (diff) | |
Remove CommandBufferScoped Dependencies (#6958)
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs b/src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs deleted file mode 100644 index 618a7d48..00000000 --- a/src/Ryujinx.Graphics.Vulkan/SemaphoreHolder.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Silk.NET.Vulkan; -using System; -using System.Threading; -using VkSemaphore = Silk.NET.Vulkan.Semaphore; - -namespace Ryujinx.Graphics.Vulkan -{ - class SemaphoreHolder : IDisposable - { - private readonly Vk _api; - private readonly Device _device; - private VkSemaphore _semaphore; - private int _referenceCount; - private bool _disposed; - - public unsafe SemaphoreHolder(Vk api, Device device) - { - _api = api; - _device = device; - - var semaphoreCreateInfo = new SemaphoreCreateInfo - { - SType = StructureType.SemaphoreCreateInfo, - }; - - api.CreateSemaphore(device, in semaphoreCreateInfo, null, out _semaphore).ThrowOnError(); - - _referenceCount = 1; - } - - public VkSemaphore GetUnsafe() - { - return _semaphore; - } - - public VkSemaphore Get() - { - Interlocked.Increment(ref _referenceCount); - return _semaphore; - } - - public unsafe void Put() - { - if (Interlocked.Decrement(ref _referenceCount) == 0) - { - _api.DestroySemaphore(_device, _semaphore, null); - _semaphore = default; - } - } - - public void Dispose() - { - if (!_disposed) - { - Put(); - _disposed = true; - } - } - } -} |
