[wsi] Refactor platform system to support multiple WSI implementations#3738
Merged
Conversation
This was referenced Dec 8, 2023
Open
Contributor
Author
|
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.
doitsujin
reviewed
May 13, 2024
doitsujin
left a comment
Owner
There was a problem hiding this comment.
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.
Contributor
Author
|
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. |
doitsujin
approved these changes
May 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_WSIDRIVERenvironment variable.Supercedes #3736
Part of #3451
Fixes #3321
Obsoletes #3324