mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-26 00:17:10 +02:00
attempt to recreate surface if lost
This commit is contained in:
parent
ba8028d1d0
commit
5b9b17ef24
2 changed files with 20 additions and 1 deletions
|
@ -14,10 +14,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
private const int SurfaceHeight = 720;
|
||||
|
||||
private readonly VulkanRenderer _gd;
|
||||
private readonly SurfaceKHR _surface;
|
||||
private readonly PhysicalDevice _physicalDevice;
|
||||
private readonly Device _device;
|
||||
private SwapchainKHR _swapchain;
|
||||
private SurfaceKHR _surface;
|
||||
|
||||
private Image[] _swapchainImages;
|
||||
private Auto<DisposableImageView>[] _swapchainImageViews;
|
||||
|
@ -84,6 +84,12 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
CreateSwapchain();
|
||||
}
|
||||
|
||||
internal void SetSurface(SurfaceKHR surface)
|
||||
{
|
||||
_surface = surface;
|
||||
RecreateSwapchain();
|
||||
}
|
||||
|
||||
private unsafe void CreateSwapchain()
|
||||
{
|
||||
_gd.SurfaceApi.GetPhysicalDeviceSurfaceCapabilities(_physicalDevice, _surface, out var capabilities);
|
||||
|
@ -313,6 +319,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
RecreateSwapchain();
|
||||
}
|
||||
else if(acquireResult == Result.ErrorSurfaceLostKhr)
|
||||
{
|
||||
_gd.RecreateSurface();
|
||||
}
|
||||
else
|
||||
{
|
||||
acquireResult.ThrowOnError();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue