-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Vulkan: Add macros to avoid compilation issues with missing symbols in Vulkan 1.0 #111094
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: Add macros to avoid compilation issues with missing symbols in Vulkan 1.0 #111094
Conversation
… in Vulkan 1.0 Missing symbols: VK_DRIVER_ID_MESA_AGXV VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX
|
Copying my comment from earlier: This is third-party code that comes from the Vulkan SDK. Any changes should be reflected in the corresponding patch file (here: https://github.com/godotengine/godot/tree/master/thirdparty/vulkan/patches) and should be PRed upstream so we minimize our changes from upstream. Since you are seeing a compilation issue though, it really sounds like you may just have an out of date SDK in your tool chain. |
|
I updated the patch file to reflect the changes, I hope it looks correct (first time doing a git diff, and my hashes look a bit shorter). This might be related to an out of date Vulkan SDK in the toolchain, but it is being shipped as the current one in a gaming platform's SDK. I could use the Vulkan headers from the thirdparty directory instead of those provided by the platform's SDK, but I'm not sure if they are fully compatible with the platform's Vulkan drivers. I can keep the fix in my repository, but I thought it might be useful upstream as well. If it's not relevant for others, that's totally fine too. Either way, I'm glad I got to dig into this and learned quite a bit today! |
|
Running into the reported error in compilation and others. It could actually be that the Vulkan stuff in Godot is older than the system one. For instance, I see I tried with a vulkan-loader (and thus headers) matching the version included in Anyway, here were all the errors when using vulkan-loader 1.4.321.0: |
|
@podiki what do you mean when using vulkan-loader 1.4.321.0? All of the Vulkan headers are supplied by Godot in the third-party/Vulkan folder. In what way are you using a Vulkan loader at compile time? Are you pointing to custom Vulkan header files instead of using the matching ones provided? |
|
@clayjohn I think I might know what is happening here. There is a Anyway, I guess that is to say that in the Guix case, it is on our end to be worked out in packaging, though this is a new problem with 4.5 (something must have changed we need to adapt to on the packaging side). That said, we would love if we could further unbundle thirdparty stuff for packaging in general; the current Sorry for hijacking, though maybe this will help with the original issue. Something may have changed from 4.4 where now system vulkan headers are picked up before the Godot ones? Because at least with the packaging in Guix, 4.4 builds fine but 4.5 hits this issue, changing nothing else. Edit: See also #104893 (comment) probably pretty similar (Nix/Guix very similar here), so I think the below guess about |
|
Perhaps f25fc34 which uses |
|
@podiki That's a really good insight. This could definitely be an issue caused by f25fc34. It sounds like a mismatching version of the Vulkan headers. So I guess a better solution would be to figure out why f25fc34 caused a regression here and figure out how to avoid polluting compilation units Any ideas @Repiteo @akien-mga? We now have three places that have regressed in basically the same way:
|
|
I think we might need to revert #104893 and its follow-up(s). The change was promising but it's proving to be unreliable, and I don't have a deep enough understanding of include precedence and shenanigans to fully make sure it's bulletproof. |
|
So, in the end, I conclude this:
It might be even more quirky than adding my macros, but it might be a good idea to either:
|
|
Reverting the change (it worked fine before) is definitely better than adding more hacks with potential pitfalls. |
|
Thanks for the quick responses all! I just wanted to follow up with one thing from the Guix side, as it is actually a bit of an accident we hit this. So far we had disabled volk (via [Edit: Actually, I forgot there needs to be libvulkan found via pkg-config, so vulkan-loader is always in the build environment] Anyway, I think it is good to find this out soon after the commits and in a way that was pretty easy to figure out. Having proper precedence for thirdparty/system libraries would be good. Probably this hasn't been seen more widely because the default has volk enabled. And in Guix we try to unbundle as much as we can. But I would think building on any system where vulkan-loader/headers are a different version and volk is disabled could hit this. Well, as long as the build is properly isolated and does not include the thirdparty stuff from system, it would be fine. I'll work around this in the Guix package for 4.5 one way or another, but feel free to ping to test any changes in building. |
Godot 4.5 has some issues with system files taking precedence over ones included in the "thirdparty" directory; see <godotengine/godot#111094> for discussion. This was further motivation to use the upstream default of enabling volk, unbundling it, and dropping the vulkan-loader input. The volk files are already patched to correctly load libvulkan. * gnu/packages/game-development.scm (godot): Update to 4.5. [source]: Add patch to unbundle libjpeg-turbo. Update snippet to preserve accesskit, grisu2, smaa, and remove volk. [arguments]<#:scons-flags>: Disable builtin libjpeg-turbo and sdl. <#:phases>: In fix-dlopen-paths phase remove libudev and volk patching. Add phase unbundle-volk. [inputs]: Add libjpeg-turbo-3, sdl3, and vulkan-volk. Remove vulkan-loader. * gnu/packages/patches/godot-libjpeg-turbo-unbundle.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I3feb071ecfdb7312e9d6d8c2213a1448481753dc
|
Superseded by #111331. |
Fixes #111088
Added 2 macros to avoid compilation issues with missing symbols in certain Vulkan implementations, in current SDKs.
Missing symbols:
VK_DRIVER_ID_MESA_AGXV
VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX