-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
dependencies/ui.py: Improve Vulkan detection on Windows #15263
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
base: master
Are you sure you want to change the base?
Conversation
dcbaker
left a comment
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.
A couple of small nits here, but otherwise this looks good to me.
4bac250 to
a68c46a
Compare
dcbaker
left a comment
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.
Thanks! this is looking really good, I'm still hoping to get this in for 1.10, and I have one small thing I think can be improved here.
mesonbuild/dependencies/ui.py
Outdated
| unsupported_target_arch = True | ||
|
|
||
| if unsupported_target_arch: | ||
| raise DependencyException('Target architecture \'%s\' is not supported for this Vulkan SDK.' % host_cpu) |
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.
| raise DependencyException('Target architecture \'%s\' is not supported for this Vulkan SDK.' % host_cpu) | |
| raise DependencyException(f'Target architecture \'{host_cpu}\' is not supported for this Vulkan SDK.') |
We prefer f-strings for simple substitutions or str.format() for complex ones.
Ah, you thought of more error cases than I did, I only noticed the build_cpu being unsupported I think it would be simpler to set lib_dir to some initial sentinel value like lib_dir = '' and then check for that at the end for the error condition.
There now exists a Windows Vulkan SDK for ARM64, and the latest Vulkan SDKs for x64 Windows also provides ARM64 libraries and binaries for cross-builds (and vice-versa). So, now we have the following in the Vulkan SDKs: * Bin-ARM64 and Lib-ARM64 in x64 Windows SDKs that contains ARM64 Vulkan binaries and libraries. * Bin-X64 and Lib-X64 in ARM64 Windows SDKs that contains x64 Vulkan binaries and libraries * SDKs after 1.4.x (or so) no longer ships 32-bit Windows binaries and libraries. This updates the Vulkan detection logic to account for these differences so that the correct library is picked up upon linking on Windows, especially when cross-compiling ARM64 binaries on x64 Windows, and vice versa, while maintaining compatibility with native and 32-bit builds.
a68c46a to
e498ce5
Compare
There now exists a Windows Vulkan SDK for ARM64, and the latest Vulkan SDKs for x64 Windows also provides ARM64 libraries and binaries for cross-builds (and vice-versa).
So, now we have the following in the Vulkan SDKs:
This updates the Vulkan detection logic to account for these differences so that the correct library is picked up upon linking on Windows, especially when cross-compiling ARM64 binaries on x64 Windows, and vice versa, while maintaining compatibility with native and 32-bit builds.
With blessings, thank you!