Skip to content

In Avalonia with Vulkan backend prevented throwing an VK_ERROR_OUT_OF_DATE_KHR exception when resizing - #22029

Open
abenedik wants to merge 2 commits into
AvaloniaUI:mainfrom
abenedik:master
Open

In Avalonia with Vulkan backend prevented throwing an VK_ERROR_OUT_OF_DATE_KHR exception when resizing#22029
abenedik wants to merge 2 commits into
AvaloniaUI:mainfrom
abenedik:master

Conversation

@abenedik

Copy link
Copy Markdown
Contributor

When the Avalonia app with Vulkan backend is resized, a VK_ERROR_OUT_OF_DATE_KHR exception may be thrown after the call to vkQueuePresentKHR (in VulkanDisplay.cs).

This may happen when the user is resizing the window and the surface size is changed after calling AcquireNextImageKHR and before calling vkQueuePresentKHR.

The exception is handled in the try...catch block in ServerCompositor.RenderCore method and as far as I know it does not cause any harm to the app. Anyway, the exception prevents calling VisualReadbackUpdatePass and ExecuteServerJobs(_receivedPostTargetJobQueue) in the RenderCore. But I do not know how important that is.

What does the pull request do?

The pull request handles the VK_ERROR_OUT_OF_DATE_KHR, VK_SUBOPTIMAL_KHR and VK_ERROR_SURFACE_LOST_KHR results that are expected when calling vkQueuePresentKHR. This is handled in the same way as after calling AcquireNextImageKHR (in StartPresentation method).

…OR_OUT_OF_DATE_KHR.

This may happen when resizing and the surface size is changed after calling AcquireNextImageKHR and before calling vkQueuePresentKHR.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068615-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Aug 24, 2026
Comment thread src/Avalonia.Vulkan/Interop/VulkanDisplay.cs Outdated
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068682-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants