Skip to content

vulkan: Find Vulkan libraries in non-standard locations #14557

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

amolenaar
Copy link

I'm trying to make Vulkan work for GTK on macOS.

On macOS, the Vulkan SDK can be installed in a user's home folder. If not installed system-wide (e.i. in /usr/local), Meson is not able to do a proper version check for Vulkan.

Current behavior

The (obsolete) environment variable VK_SDK_PATH has to be set, or the VULKAN_SDK will not be used at all.

Vulkan version check fails, even if both VK_SDK_PATH and VULKAN_SDK are set:

Dependency vulkan found: NO. Found -1.-1.-1 but need: '>= 1.3'

New behavior

VULKAN_SDK can be set without VK_SDK_PATH

The include path (based on VULKAN_SDK) is now provided to the version-check command, so vulkan.h can be found, and a version check can be done.

@amolenaar amolenaar requested a review from jpakkane as a code owner May 4, 2025 12:13
@amolenaar amolenaar force-pushed the vulkan-non-standard-path branch from f893b2e to bad0f56 Compare May 4, 2025 12:15
@amolenaar amolenaar changed the title vulkan: Fix finding vulkan libraries in non-standard locations vulkan: Find Vulkan libraries in non-standard locations May 4, 2025
@amolenaar amolenaar force-pushed the vulkan-non-standard-path branch from bad0f56 to 000fab9 Compare May 4, 2025 14:11
Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message should include a description of why this fixes the problem.

VULKAN_SDK is the preferred environment variable to point to
the Vulkan installation. With this change the old variable
(VK_SDK_PATH) is made optional.
@amolenaar amolenaar force-pushed the vulkan-non-standard-path branch from 000fab9 to 7e7d4ba Compare May 5, 2025 10:07
@amolenaar
Copy link
Author

Commit message should include a description of why this fixes the problem.

I separated the change in 2 smaller commit, and added a rationale for the change.

@amolenaar amolenaar requested a review from eli-schwartz May 5, 2025 10:09
@amolenaar amolenaar force-pushed the vulkan-non-standard-path branch from 592fcaa to 7905244 Compare May 5, 2025 13:16
amolenaar added 2 commits May 5, 2025 22:57
This change ensures that Vulkan will be found in the path defined by the
VULKAN_SDK env var. This is the case when the Vulkan SDK is not
installed in a well-known location (/usr, /usr/local), but in a user's
home folder.
Add test cases that target the Vulkan system dependeny resolver
explicitly.
@amolenaar amolenaar force-pushed the vulkan-non-standard-path branch 3 times, most recently from 9ad77d1 to 5f65c2b Compare May 6, 2025 07:43
@amolenaar amolenaar requested a review from eli-schwartz May 7, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants