-
Notifications
You must be signed in to change notification settings - Fork 855
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
[d3d9,d3d11] recreate swapchain on VK_SUBOPTIMAL_KHR #4252
Conversation
ce75e9a
to
1a6d154
Compare
Why does this change anything? We already recreate the swap chain if present returns If we need to do this on acquire as well for whatever reason then we should at least ensure that we're not turning the whole thing into an infinite loop if WSI can't give us what we want. |
Yeah I see it now. I'm not too familiar with dxvk but I'll look into why that isn't sufficient. Marking this as draft for now.
I might be misunderstanding this comment, but from my understanding we're still picking the format but the WSI is responsible picking what modifier to use for the client. It would be a WSI bug if it picks a modifier but it's still suboptimal no? |
Looking at the mesa code it seems like present always returns We can definitely land this change in that case. Does this currently affect XWayland and/or Gamescope environments too?
Arguably yes, but Wayland and X11 aren't the only WSI implementations we end up running on even if those are obviously the priority, and we've had weirder issues in the past. I'd prefer to be robust here and do something like |
The vulkan wayland wsi returns suboptimal when the window is fullscreened and not directly scanned out, and there are modifiers available that would allow the window to be directly scanned out. Recreate the swapchain if we receive suboptimal result. This allows us recreate the swapchain to use a modifier that allows direct scan-out under winewayland on wayland compositors.
1a6d154
to
e86a8c6
Compare
Is this worth reporting to mesa?
Not in my testing, no.
Done. Thanks for the help, and also for identifying why this was necessary. |
Would probably be good to clarify why Either way, LGTM. |
I asked and it appears that QueuePresent doesn't propagate suboptimal on X11 either for performance reasons. https://gitlab.freedesktop.org/mesa/mesa/-/commit/2b885b233f7a6300ae88732c179888c02788493d So both x11 and wayland WSI only return suboptimal on AcquireNextImage. |
The vulkan wayland wsi returns suboptimal when the window is fullscreened and not directly scanned out, and there are modifiers available that would allow the window to be directly scanned out. Recreate the swapchain if we receive suboptimal result.
This allows us recreate the swapchain to use a modifier that allows direct scan-out under winewayland on wayland compositors.
I only managed to test it on a couple of games, so this doesn't have the greatest test coverage. I could put it behind a config option if this change is likely to break stuff.