From 5ef99b39a36cdc3787f32d31c507c36d46511f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 2 Oct 2023 21:09:17 +0200 Subject: [PATCH] vrclient: Unwrap vulkan objects outside of vrclient_translate_texture_dxvk. CW-Bug-Id: #22729 --- vrclient_x64/vrclient_x64/vrclient_main.c | 4 ---- vrclient_x64/vrclient_x64/vrcompositor_manual.c | 12 ++++++++---- vrclient_x64/vrclient_x64/vroverlay_manual.c | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index 734cffec..9818ebfb 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -467,10 +467,6 @@ w_Texture_t vrclient_translate_texture_dxvk( const w_Texture_t *texture, w_VRVul dxvk_surface->lpVtbl->GetVulkanImageInfo(dxvk_surface, &image_handle, image_layout, image_info); vkdata->m_nImage = (uint64_t)image_handle; - vkdata->m_pDevice = get_native_VkDevice(vkdata->m_pDevice); - vkdata->m_pPhysicalDevice = get_native_VkPhysicalDevice(vkdata->m_pPhysicalDevice); - vkdata->m_pInstance = get_native_VkInstance(vkdata->m_pInstance); - vkdata->m_pQueue = get_native_VkQueue(vkdata->m_pQueue); vkdata->m_nWidth = image_info->extent.width; vkdata->m_nHeight = image_info->extent.height; vkdata->m_nFormat = image_info->format; diff --git a/vrclient_x64/vrclient_x64/vrcompositor_manual.c b/vrclient_x64/vrclient_x64/vrcompositor_manual.c index 42ccb219..bdf90962 100644 --- a/vrclient_x64/vrclient_x64/vrcompositor_manual.c +++ b/vrclient_x64/vrclient_x64/vrcompositor_manual.c @@ -60,10 +60,10 @@ static void load_compositor_texture_dxvk( uint32_t eye, const w_Texture_t *textu state->texture = vrclient_translate_texture_dxvk( texture, &vkdata, state->dxvk_surface, &state->dxvk_device, &state->image_layout, &image_info ); state->vkdata.m_nImage = vkdata.m_nImage; - state->vkdata.m_pDevice = vkdata.m_pDevice; - state->vkdata.m_pPhysicalDevice = vkdata.m_pPhysicalDevice; - state->vkdata.m_pInstance = vkdata.m_pInstance; - state->vkdata.m_pQueue = vkdata.m_pQueue; + state->vkdata.m_pDevice = get_native_VkDevice( vkdata.m_pDevice ); + state->vkdata.m_pPhysicalDevice = get_native_VkPhysicalDevice( vkdata.m_pPhysicalDevice ); + state->vkdata.m_pInstance = get_native_VkInstance( vkdata.m_pInstance ); + state->vkdata.m_pQueue = get_native_VkQueue( vkdata.m_pQueue ); state->vkdata.m_nQueueFamilyIndex = vkdata.m_nQueueFamilyIndex; state->vkdata.m_nWidth = vkdata.m_nWidth; state->vkdata.m_nHeight = vkdata.m_nHeight; @@ -197,6 +197,10 @@ static const w_Texture_t *set_skybox_override_d3d11_init( const w_Texture_t *tex state->textures[i] = vrclient_translate_texture_dxvk( texture, &state->vkdata[i], dxvk_surface, &dxvk_device, &image_layout, &image_info ); + state->vkdata[i].m_pDevice = get_native_VkDevice( state->vkdata[i].m_pDevice ); + state->vkdata[i].m_pPhysicalDevice = get_native_VkPhysicalDevice( state->vkdata[i].m_pPhysicalDevice ); + state->vkdata[i].m_pInstance = get_native_VkInstance( state->vkdata[i].m_pInstance ); + state->vkdata[i].m_pQueue = get_native_VkQueue( state->vkdata[i].m_pQueue ); if (compositor_data.dxvk_device && dxvk_device != compositor_data.dxvk_device) { diff --git a/vrclient_x64/vrclient_x64/vroverlay_manual.c b/vrclient_x64/vrclient_x64/vroverlay_manual.c index 7618c3da..12fb5126 100644 --- a/vrclient_x64/vrclient_x64/vroverlay_manual.c +++ b/vrclient_x64/vrclient_x64/vroverlay_manual.c @@ -44,6 +44,10 @@ static void load_overlay_texture_dxvk( const w_Texture_t *texture, struct set_ov state->texture = vrclient_translate_texture_dxvk( texture, &state->vkdata, state->dxvk_surface, &state->dxvk_device, &state->image_layout, &image_info ); + state->vkdata.m_pDevice = get_native_VkDevice( state->vkdata.m_pDevice ); + state->vkdata.m_pPhysicalDevice = get_native_VkPhysicalDevice( state->vkdata.m_pPhysicalDevice ); + state->vkdata.m_pInstance = get_native_VkInstance( state->vkdata.m_pInstance ); + state->vkdata.m_pQueue = get_native_VkQueue( state->vkdata.m_pQueue ); state->subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; state->subresources.baseMipLevel = 0;