MoltenVk brief stretching of viewport on resize

As per video below (apologies for the potato quality), I’m seeing a very brief sretchiness applied to the framebuffer during resize events.

Those ImGui panels should remain fixed in place, but instead briefly stretch


I’m curious if this is a common behaviour with MoltenVk or is it something on my end that I’m not accounting for?

I had similar issues on Wayland where it turned out I was failing to set the viewport source dimensions via wp_viewporter_set_source, but I’m not aware of any way to do that with MoltenVk

I’ve seen what appears to be a related issue here, though my issue only occurs briefly during resize events (with the swapchain being recreated continuously)

The VK_KHR_display_swapchain extension is not yet available on MoltenVk, though it does seem the provided VkDisplayPresentInfoKHR would meet my needs in the same way as wp_viewporter_set_source under Wayland.

Though if this is behaviour that is inherent to MoltenVk it might seem this could possibly be resolved within MoltenVk independently of that extension (presuming this is not something I can fix otherwise?)

I do notice the existence of VK_EXT_swapchain_maintenance1
In particular, VkSwapchainPresentScalingCreateInfoEXT

I’ll have a play around and see if it resolves the issue, at first glance it seems appropriate

EDIT: Darn, it seems this extension has a dependency on VK_EXT_surface_maintenance1 which doesn’t appear to be advertised (and indeed produces validation errors when I try to use it in the absence of surface_maintenance1)

It’s odd that MoltenVk advertises swapchain_maintenance1 without also advertising surface_maintenance1. I note that nVidia advertises similarly here

It seems this is in violation of the specification…

If an extension is supported (as queried by vkEnumerateInstanceExtensionProperties or vkEnumerateDeviceExtensionProperties), then required extensions of that extension must also be supported for the same instance or physical device.

Well… it works!

A few things I was doing wrong…
VK_EXT_surface_maintenance1 is advertised… I was looking in the wrong place.
If also has a further dependency on VK_KHR_get_surface_capabilities2. No more validation errors.