-
Notifications
You must be signed in to change notification settings - Fork 898
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
[wsi] Refactor platform system to support multiple WSI implementations #3738
Conversation
Latest push is another rebase - I've got some spare cycles this week so if there's anything that needs to be addressed in this (or the other two) PRs let me know and I'll get it done ASAP! |
This is preparation for loading/unloading WSI backends at runtime, which will be in an upcoming commit.
This ensures that all of the WSI backend logic is in one place rather than two.
…interface. Rather than directly calling functions, the API now calls shared functions that call into a WsiDriver instance, which is allocated and implemented by the backend. Functionally this should be the same, it just has the extra allocation for the function table. This prepares the WSI library for supporting multiple implementations in a single binary.
Removing these link-time dependencies is important for making a single binary that is compatible with either backend, regardless of whether or not each one is currently available to the program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into (finally) getting this merged for the 2.4 release among other stuff, looks good overall, just one concern.
…ction. Since we're not linking to the libraries anymore, it doesn't make much sense to use find_library, and in fact we need to use dependency() in order to get the right CFLAGS for includes, defines, etc, so use that instead. As a result, we can remove the 'SDL2/' folders from the includes, making the SDL includes more correct.
Latest push adjusts the behavior of DXVK_WSIDRIVER, particularly when the variable is unset: When Win32 is available we assume that is the default, when it is not available we throw an explicit error requesting that the variable be set. |
This reorganizes the WSI backend system to support multiple backends in a single binary - this is important for dxvk-native which can support either SDL2 or GLFW. We achieve this by doing the following:
DXVK_WSIDRIVER
environment variable.Supercedes #3736
Part of #3451
Fixes #3321
Obsoletes #3324