mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-23 01:20:21 +00:00
* add avalonia support * only lock around skia flush * addressed review * cleanup * add fallback size if avalonia attempts to render but the window size is 0. read desktop scale after enabling dpi check * fix getting window handle on linux. skip render is size is 0
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System;
|
|
using Silk.NET.Vulkan;
|
|
|
|
namespace Ryujinx.Ava.Ui.Vulkan
|
|
{
|
|
internal class VulkanSemaphorePair : IDisposable
|
|
{
|
|
private readonly VulkanDevice _device;
|
|
|
|
public unsafe VulkanSemaphorePair(VulkanDevice device)
|
|
{
|
|
_device = device;
|
|
|
|
var semaphoreCreateInfo = new SemaphoreCreateInfo { SType = StructureType.SemaphoreCreateInfo };
|
|
|
|
_device.Api.CreateSemaphore(_device.InternalHandle, semaphoreCreateInfo, null, out var semaphore).ThrowOnError();
|
|
ImageAvailableSemaphore = semaphore;
|
|
|
|
_device.Api.CreateSemaphore(_device.InternalHandle, semaphoreCreateInfo, null, out semaphore).ThrowOnError();
|
|
RenderFinishedSemaphore = semaphore;
|
|
}
|
|
|
|
internal Semaphore ImageAvailableSemaphore { get; }
|
|
internal Semaphore RenderFinishedSemaphore { get; }
|
|
|
|
public unsafe void Dispose()
|
|
{
|
|
_device.Api.DestroySemaphore(_device.InternalHandle, ImageAvailableSemaphore, null);
|
|
_device.Api.DestroySemaphore(_device.InternalHandle, RenderFinishedSemaphore, null);
|
|
}
|
|
}
|
|
}
|