Skip to content

Commit d939f95

Browse files
committed
Vulkan (Android): hard code path of libvulkan.so, so that users don't need to install vulkan-loader wrapper of termux
1 parent e0fd511 commit d939f95

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/detection/vulkan/vulkan.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@ static void applyDriverName(VkPhysicalDeviceDriverPropertiesKHR* properties, FFs
3939

4040
static const char* detectVulkan(FFVulkanResult* result)
4141
{
42-
FF_LIBRARY_LOAD(vulkan, "dlopen libvulkan"FF_LIBRARY_EXTENSION " failed",
43-
#ifdef __APPLE__
44-
"libMoltenVK"FF_LIBRARY_EXTENSION, -1
45-
#elif defined(_WIN32)
46-
"vulkan-1"FF_LIBRARY_EXTENSION, -1
42+
FF_LIBRARY_LOAD(vulkan, "dlopen libvulkan" FF_LIBRARY_EXTENSION " failed",
43+
#if __ANDROID__
44+
#if UINTPTR_MAX == UINT32_MAX
45+
"/system/lib/"
46+
#else
47+
"/system/lib64/"
48+
#endif
49+
"libvulkan" FF_LIBRARY_EXTENSION, -1
50+
#elif __APPLE__
51+
"libMoltenVK" FF_LIBRARY_EXTENSION, -1
52+
#elif _WIN32
53+
"vulkan-1" FF_LIBRARY_EXTENSION, -1
4754
#else
48-
"libvulkan"FF_LIBRARY_EXTENSION, 2
55+
"libvulkan" FF_LIBRARY_EXTENSION, 2
4956
#endif
5057
)
5158
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(vulkan, vkGetInstanceProcAddr)

0 commit comments

Comments
 (0)