From c0f262739662e9a8b15ea2891f2b91bd2a96a44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 10 Sep 2018 17:58:35 +0200 Subject: [PATCH] vrclient: Introduce VRCLIENT_HAVE_DXVK. --- vrclient_x64/vrclient_x64/vrclient_main.c | 15 +++++++-------- vrclient_x64/vrclient_x64/vrclient_private.h | 7 ++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index 00c47bcc..892a41be 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -16,8 +16,7 @@ #include "initguid.h" -#if !defined(__APPLE__) || defined(__x86_64__) -/* 32-bit Mac doesn't support Vulkan and thus DXVK */ +#ifdef VRCLIENT_HAVE_DXVK #include "dxvk-interop.h" #endif @@ -583,7 +582,7 @@ static EVRCompositorError ivrcompositor_submit_wined3d( return 0; } -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK static EVRCompositorError ivrcompositor_submit_dxvk( EVRCompositorError (*cpp_func)(void *, EVREye, Texture_t *, VRTextureBounds_t *, EVRSubmitFlags), void *linux_side, EVREye eye, Texture_t *texture, VRTextureBounds_t *bounds, EVRSubmitFlags flags, @@ -753,7 +752,7 @@ EVRCompositorError ivrcompositor_submit( eye, texture, bounds, flags, version, user_data, wine_texture); } -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK { IDXGIVkInteropSurface *dxvk_surface; @@ -813,14 +812,14 @@ void ivrcompositor_post_present_handoff(void (*cpp_func)(void *), return; } -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK if (user_data->dxvk_device) user_data->dxvk_device->lpVtbl->LockSubmissionQueue(user_data->dxvk_device); #endif cpp_func(linux_side); -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK if (user_data->dxvk_device) user_data->dxvk_device->lpVtbl->ReleaseSubmissionQueue(user_data->dxvk_device); #endif @@ -869,14 +868,14 @@ EVRCompositorError ivrcompositor_wait_get_poses( TRACE("%p, %p, %u, %p, %u\n", linux_side, render_poses, render_pose_count, game_poses, game_pose_count); -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK if (user_data->dxvk_device) user_data->dxvk_device->lpVtbl->LockSubmissionQueue(user_data->dxvk_device); #endif r = cpp_func(linux_side, render_poses, render_pose_count, game_poses, game_pose_count); -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK if (user_data->dxvk_device) user_data->dxvk_device->lpVtbl->ReleaseSubmissionQueue(user_data->dxvk_device); #endif diff --git a/vrclient_x64/vrclient_x64/vrclient_private.h b/vrclient_x64/vrclient_x64/vrclient_private.h index a324463c..18910225 100644 --- a/vrclient_x64/vrclient_x64/vrclient_private.h +++ b/vrclient_x64/vrclient_x64/vrclient_private.h @@ -1,5 +1,10 @@ #include +/* 32-bit Mac doesn't support Vulkan and thus DXVK */ +#if !defined(__APPLE__) || defined(__x86_64__) +#define VRCLIENT_HAVE_DXVK +#endif + /* TODO these should be generated */ typedef struct __winISteamClient winISteamClient; typedef struct __winISteamUser winISteamUser; @@ -57,7 +62,7 @@ struct compositor_data { ID3D11Device *d3d11_device; IWineD3D11Device *wined3d_device; -#if !defined(__APPLE__) || defined(__x86_64__) +#ifdef VRCLIENT_HAVE_DXVK IDXGIVkInteropDevice *dxvk_device; #endif };