Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vulkan: Fix present mode fallback override #1422

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

amshafer
Copy link
Contributor

@amshafer amshafer commented Sep 9, 2024

We have seen some reports of blank screens on games with Xwayland when vsync is disabled in MangoHud:
https://forums.developer.nvidia.com/t/blank-screens-on-games-with-adaptive-vsync-fifo-relaxed-khr-enabled-driver-550-regression-works-on-535/284442

It doesn't look like MangoHud correctly handles FIFO_RELAXED_KHR not being supported. In overlay_CreateSwapchainKHR, if IsPresentModeSupported returns false (which it will for FIFO_RELAXED on our driver with Xwayland at the moment) it sets HUDElements.cur_present_mode to VK_PRESENT_MODE_FIFO_KHR but it does not update createInfo.presentMode. This could cause swapchain creation to fail since it's trying to use an unsupported present mode.

Does this analysis sound correct or am I misunderstanding how this should work?

Some additional context: earlier this summer we had stopped advertising FIFO_RELAXED_KHR with Xwayland in the NVIDIA driver since we weren't properly handling it and were treating it as regular FIFO, which was a bug. That seems to have triggered this issue. We will be implementing FIFO_RELAXED_KHR properly as we do want to support it on Xwayland, but figured I would report this issue in the meantime.

In overlay_CreateSwapchainKHR, if IsPresentModeSupported returns false (which it will when FIFO_RELAXED is not supported) it sets  HUDElements.cur_present_mode to VK_PRESENT_MODE_FIFO_KHR but it does not update createInfo.presentMode. This can cause swapchain creation to fail since it's trying to use an unsupported present mode.

This updates the createInfo's presentMode as well to prevent this.
@Etaash-mathamsetty
Copy link
Contributor

This looks good to me

@flightlessmango flightlessmango merged commit 2e7e86f into flightlessmango:master Sep 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants