I tried to build vkd3d for Android and needed a couple of little changes, which turn out to make sense of their own.
From: Giovanni Mascellani gmascellani@codeweavers.com
The latter links the pthread library, but doesn't set the preprocessor state that some toolchains require. The former is the supported way to use pthread.
This allows vkd3d to be compiled with the Android NDK. --- m4/check-pthread.m4 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/m4/check-pthread.m4 b/m4/check-pthread.m4 index 5fa82ecb8..706829d98 100644 --- a/m4/check-pthread.m4 +++ b/m4/check-pthread.m4 @@ -15,7 +15,15 @@ AS_IF([test "x$vkd3d_pthread_found" = "xno"], [PTHREAD_LIBS=""]) LIBS="$vkd3d_libs_saved"])
AS_IF([test "x$vkd3d_pthread_found" != "xyes"], -AC_CHECK_LIB([pthread], [pthread_create], - [PTHREAD_LIBS="-lpthread"], - [AC_MSG_ERROR([libpthread not found.])])) +[vkd3d_libs_saved="$LIBS" +PTHREAD_LIBS="-pthread" +LIBS="$LIBS $PTHREAD_LIBS" + +AC_MSG_CHECKING([checking for pthread_create in $PTHREAD_LIBS]) +AC_TRY_LINK_FUNC([pthread_create], [vkd3d_pthread_found=yes]) +AC_MSG_RESULT([$vkd3d_pthread_found]) + +AS_IF([test "x$vkd3d_pthread_found" = "xno"], [PTHREAD_LIBS=""]) + +LIBS="$vkd3d_libs_saved"]) ])
From: Giovanni Mascellani gmascellani@codeweavers.com
This is nice for the application, which can use our implementation of D3D12CreateDevice() in more environments, and basically free for us, because surface creation is still the application's business. --- libs/vkd3d-utils/vkd3d_utils_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index a2edf4036..966766609 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -70,8 +70,14 @@ HRESULT WINAPI D3D12CreateDeviceVKD3D(IUnknown *adapter, D3D_FEATURE_LEVEL minim }; static const char * const optional_instance_extensions[] = { + "VK_KHR_android_surface", + "VK_KHR_wayland_surface", + "VK_KHR_win32_surface", "VK_KHR_xcb_surface", + "VK_KHR_xlib_surface", + "VK_EXT_metal_surface", "VK_MVK_macos_surface", + "VK_MVK_ios_surface", }; static const char * const device_extensions[] = {
This merge request was approved by Giovanni Mascellani.
We may want to use AX_PTHREAD.
We may want to use AX_PTHREAD.
Yeah. It's not immediately clear to me what the licensing implications for vkd3d would be though.
This merge request was approved by Henri Verbeet.