e42.uk Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

Surface Resizing in Vulkan

Surface Resizing in Vulkan

Or more accurately how to detect that a surface has been resized when using Vulkan and the Wayland extension (VK_KHR_wayland_surface). In some WSI (Window System Integration) extensions the WSI will provide an error code VK_ERROR_OUT_OF_DATE_KHR or VK_SUBOPTIMAL_KHR upon return of vkQueuePresentKHR. This is not guaranteed though as indicated in Handling resizes explicitly.

The implementation of extension VK_KHR_xcb_surface (x11_present_to_x11_sw) and VK_KHR_wayland_surface (wsi_wl_swapchain_queue_present) in mesa show how the geometry of the surface is only checked by the XCB implementation and not Wayland.

Wayland is an asynchronous protocol and calls to a Wayland compositor are permitted only in certain circumstances, during the call to vkQueuePresentKHR is one of those times but actual detection of a resize event might be difficult since a callback must be registered. I don't see why that would be so much of a problem but maybe there is something I do not know.

References

Quick Links: Techie Stuff | General | Personal | Quick Reference