From f386e16db8c41f2331219548b99546c4ff00c011 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 11 Apr 2018 10:10:22 -0500 Subject: [PATCH] vrclient: Use Vulkan unwrappers in IVRCompositor::GetVulkanDeviceExtensionsRequired --- vrclient_x64/gen_wrapper.py | 4 ++++ vrclient_x64/vrclient_main.c | 12 ++++++++++++ vrclient_x64/vrclient_private.h | 5 +++++ vrclient_x64/winIVRCompositor.c | 8 ++++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/vrclient_x64/gen_wrapper.py b/vrclient_x64/gen_wrapper.py index 585a6b52..47bac6f2 100755 --- a/vrclient_x64/gen_wrapper.py +++ b/vrclient_x64/gen_wrapper.py @@ -147,11 +147,15 @@ def ivrcompositor_wait_get_poses(cppname, method): return "ivrcompositor_wait_get_poses" return None +def ivrcompositor_get_vulkan_device_extensions_required(cppname, method): + return "ivrcompositor_get_vulkan_device_extensions_required" + method_overrides = [ ("IVRSystem", "GetDXGIOutputInfo", ivrsystem_get_dxgi_output_info), ("IVRCompositor", "Submit", ivrcompositor_submit), ("IVRCompositor", "PostPresentHandoff", ivrcompositor_post_present_handoff), ("IVRCompositor", "WaitGetPoses", ivrcompositor_wait_get_poses), + ("IVRCompositor", "GetVulkanDeviceExtensionsRequired", ivrcompositor_get_vulkan_device_extensions_required), ] method_overrides_data = [ diff --git a/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_main.c index 5e97cd37..5ad0f995 100644 --- a/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_main.c @@ -485,3 +485,15 @@ EVRCompositorError ivrcompositor_wait_get_poses( return r; } + +uint32_t ivrcompositor_get_vulkan_device_extensions_required( + uint32_t (*cpp_func)(void *, VkPhysicalDevice_T *, char *, uint32_t), + void *linux_side, VkPhysicalDevice_T *phys_dev, char *value, uint32_t bufsize, + unsigned int version, struct compositor_data *user_data) +{ + load_vk_unwrappers(); + + phys_dev = get_native_VkPhysicalDevice(phys_dev); + + return cpp_func(linux_side, phys_dev, value, bufsize); +} diff --git a/vrclient_x64/vrclient_private.h b/vrclient_x64/vrclient_private.h index 20cf19e4..99c398b6 100644 --- a/vrclient_x64/vrclient_private.h +++ b/vrclient_x64/vrclient_private.h @@ -80,6 +80,11 @@ EVRCompositorError ivrcompositor_wait_get_poses( void *linux_side, TrackedDevicePose_t *render_poses, uint32_t render_pose_count, TrackedDevicePose_t *game_poses, uint32_t game_pose_count, unsigned int version, struct compositor_data *user_data); + +uint32_t ivrcompositor_get_vulkan_device_extensions_required( + uint32_t (*cpp_func)(void *, VkPhysicalDevice_T *, char *, uint32_t), + void *linux_side, VkPhysicalDevice_T *phys_dev, char *value, uint32_t bufsize, + unsigned int version, struct compositor_data *user_data); #endif /* __cplusplus */ #define TRACE WINE_TRACE diff --git a/vrclient_x64/winIVRCompositor.c b/vrclient_x64/winIVRCompositor.c index b1f0669d..750f9a9b 100644 --- a/vrclient_x64/winIVRCompositor.c +++ b/vrclient_x64/winIVRCompositor.c @@ -309,7 +309,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtens uint32_t __thiscall winIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired(winIVRCompositor_IVRCompositor_022 *_this, VkPhysicalDevice_T * pPhysicalDevice, char * pchValue, uint32_t unBufferSize) { TRACE("%p\n", _this); - return cppIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired(_this->linux_side, pPhysicalDevice, pchValue, unBufferSize); + return ivrcompositor_get_vulkan_device_extensions_required(cppIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired, _this->linux_side, pPhysicalDevice, pchValue, unBufferSize, 22, &_this->user_data); } DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_022_SetExplicitTimingMode, 8) @@ -682,7 +682,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtens uint32_t __thiscall winIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired(winIVRCompositor_IVRCompositor_021 *_this, VkPhysicalDevice_T * pPhysicalDevice, char * pchValue, uint32_t unBufferSize) { TRACE("%p\n", _this); - return cppIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired(_this->linux_side, pPhysicalDevice, pchValue, unBufferSize); + return ivrcompositor_get_vulkan_device_extensions_required(cppIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired, _this->linux_side, pPhysicalDevice, pchValue, unBufferSize, 21, &_this->user_data); } DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_021_SetExplicitTimingMode, 5) @@ -1055,7 +1055,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtens uint32_t __thiscall winIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired(winIVRCompositor_IVRCompositor_020 *_this, VkPhysicalDevice_T * pPhysicalDevice, char * pchValue, uint32_t unBufferSize) { TRACE("%p\n", _this); - return cppIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired(_this->linux_side, pPhysicalDevice, pchValue, unBufferSize); + return ivrcompositor_get_vulkan_device_extensions_required(cppIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired, _this->linux_side, pPhysicalDevice, pchValue, unBufferSize, 20, &_this->user_data); } extern vtable_ptr winIVRCompositor_IVRCompositor_020_vtable; @@ -1405,7 +1405,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtens uint32_t __thiscall winIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired(winIVRCompositor_IVRCompositor_019 *_this, VkPhysicalDevice_T * pPhysicalDevice, char * pchValue, uint32_t unBufferSize) { TRACE("%p\n", _this); - return cppIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired(_this->linux_side, pPhysicalDevice, pchValue, unBufferSize); + return ivrcompositor_get_vulkan_device_extensions_required(cppIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired, _this->linux_side, pPhysicalDevice, pchValue, unBufferSize, 19, &_this->user_data); } extern vtable_ptr winIVRCompositor_IVRCompositor_019_vtable;