Validation error reported from VK_LAYER_KHRONOS_validation when creating swapchain
With MANGOHUD=1 set, running a simple Vulkan application with VK_LAYER_KHRONOS_validation enabled will print the following error message from the validation layer when a swapchain is created:
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-01281 ] | MessageID = 0xaddd2685
vkCreateSwapchainKHR(): pCreateInfo->presentMode (VK_PRESENT_MODE_MAILBOX_KHR) is not supported (the following are supported ).
The Vulkan spec states: presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface (https://docs.vulkan.org/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01281)
The swapchain is still created successfully and the spurious error does not appear to have an effect on functionality.
I'm using mangohud 0.8.1 on Arch Linux with Wayland and mesa 25.1.3.
Does this happen because you force mailbox with mangohud?
It happens regardless of the presentation mode selected; if I pick fifo it reports the same error (with fifo specified).
But you are selection a mode?
I'm not sure what you mean, I am passing a mode to vkCreateSwapchainKHR through the presentMode field.
So you're trying to force a presentmode that isn't available for your GPU, I'm not sure what this has to do with mangohud
This message only gets printed with MANGOHUD=1 set, if I set MANGOHUD=0 the message isn't printed. My GPU supports both mailbox and fifo.
To repro this I need to have an application that forces a present mode? Are you also using the vsync option in mangohud? otherwise mangohud should just pass the same present mode
I will try to prepare a minimal reproducible C example and get back to you once I'm done.
Vsync isn't set in my mangohud config
I'm not sure what you mean by forces a present mode, you have to specify a present mode in vkSwapchainCreateInfoKHR
In that case this should be reproducible with vkcube. does it repro for you with vkcube?
After a lot of further investigation, I think this has to do with some kind of interaction between SDL as a vulkan loader, Zig, and Mangohud. It only seems to occur when these three things are combined, and if I remove one variable the error no longer occurs. I'm unsure which of the three is actually the cause; it could be caused by how Zig links to SDL, or by Mangohud assuming C-y things that don't hold true for Zig, or by a bug in SDL's vulkan loader that only shows up in very specific cases.
Here is a repository on which I was able to reproduce this: https://github.com/spanzeri/vkguide-zig
I also have this problem, no matter which present mode I try, mangohud claims it is not supported, including FIFO.
I also have this problem, no matter which present mode I try, mangohud claims it is not supported, including FIFO.
What language/windowing library are you using?
I also have this problem, no matter which present mode I try, mangohud claims it is not supported, including FIFO.
What language/windowing library are you using?
C++, SDL3