diff --git a/vrclient_x64/vrclient_x64/vrcompositor_manual.c b/vrclient_x64/vrclient_x64/vrcompositor_manual.c index 0bb1876f..68601789 100644 --- a/vrclient_x64/vrclient_x64/vrcompositor_manual.c +++ b/vrclient_x64/vrclient_x64/vrcompositor_manual.c @@ -37,360 +37,312 @@ WINE_DEFAULT_DEBUG_CHANNEL(vrclient); -static EVRCompositorError ivrcompositor_submit_dxvk( EVRCompositorError (*cpp_func)( void *, EVREye, const Texture_t *, const VRTextureBounds_t *, EVRSubmitFlags ), - void *linux_side, EVREye eye, const Texture_t *texture, - const VRTextureBounds_t *bounds, EVRSubmitFlags flags, - unsigned int version, IDXGIVkInteropSurface *dxvk_surface ) +struct submit_state +{ + void *submit; + struct Texture_t texture; + struct VRVulkanTextureArrayData_t vkdata; + union + { + struct + { + struct VRVulkanTextureData_t depth_vkdata; + VRTextureWithPoseAndDepth_t both; + VRTextureWithDepth_t depth; + VRTextureWithPose_t pose; + }; + struct + { + VkImageLayout image_layout; + VkImageSubresourceRange subresources; + IDXGIVkInteropSurface *dxvk_surface; + IDXGIVkInteropDevice *dxvk_device; + }; + }; +}; + +static void load_compositor_texture_dxvk( EVREye eye, const Texture_t *texture, EVRSubmitFlags flags, + struct submit_state *state ) { static const EVRSubmitFlags supported_flags = Submit_LensDistortionAlreadyApplied | Submit_FrameDiscontinuty; - struct VRVulkanTextureArrayData_t vkdata; - IDXGIVkInteropDevice *dxvk_device; - struct Texture_t vktexture; - - VkImageLayout image_layout; VkImageCreateInfo image_info; - VkImageSubresourceRange subresources; + IUnknown *texture_iface; - EVRCompositorError err; + TRACE( "texture = %p\n", texture ); - vktexture = vrclient_translate_texture_dxvk( texture, &vkdata.t, dxvk_surface, &dxvk_device, - &image_layout, &image_info ); + if (!(texture_iface = texture->handle)) + { + WARN( "No D3D11 texture %p.\n", texture ); + return; + } - compositor_data.dxvk_device = dxvk_device; + if (FAILED(texture_iface->lpVtbl->QueryInterface( texture_iface, &IID_IDXGIVkInteropSurface, + (void **)&state->dxvk_surface ))) + { + WARN( "Invalid D3D11 texture %p.\n", texture ); + return; + } + + state->texture = vrclient_translate_texture_dxvk( texture, &state->vkdata.t, state->dxvk_surface, &state->dxvk_device, + &state->image_layout, &image_info ); + + compositor_data.dxvk_device = state->dxvk_device; if (flags & ~supported_flags) FIXME( "Unhandled flags %#x.\n", flags ); if (image_info.arrayLayers > 1) { - vkdata.m_unArrayIndex = eye; - vkdata.m_unArraySize = image_info.arrayLayers; + state->vkdata.m_unArrayIndex = eye; + state->vkdata.m_unArraySize = image_info.arrayLayers; flags |= Submit_VulkanTextureWithArrayData; } - subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - subresources.baseMipLevel = 0; - subresources.levelCount = image_info.mipLevels; - subresources.baseArrayLayer = 0; - subresources.layerCount = image_info.arrayLayers; + state->subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + state->subresources.baseMipLevel = 0; + state->subresources.levelCount = image_info.mipLevels; + state->subresources.baseArrayLayer = 0; + state->subresources.layerCount = image_info.arrayLayers; - dxvk_device->lpVtbl->TransitionSurfaceLayout( dxvk_device, dxvk_surface, &subresources, - image_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ); - dxvk_device->lpVtbl->FlushRenderingCommands( dxvk_device ); - dxvk_device->lpVtbl->LockSubmissionQueue( dxvk_device ); - - err = cpp_func( linux_side, eye, &vktexture, bounds, flags ); - - dxvk_device->lpVtbl->ReleaseSubmissionQueue( dxvk_device ); - dxvk_device->lpVtbl->TransitionSurfaceLayout( dxvk_device, dxvk_surface, &subresources, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, image_layout ); - - dxvk_device->lpVtbl->Release( dxvk_device ); - dxvk_surface->lpVtbl->Release( dxvk_surface ); - return err; + state->dxvk_device->lpVtbl->TransitionSurfaceLayout( state->dxvk_device, state->dxvk_surface, &state->subresources, + state->image_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ); + state->dxvk_device->lpVtbl->FlushRenderingCommands( state->dxvk_device ); + state->dxvk_device->lpVtbl->LockSubmissionQueue( state->dxvk_device ); } -static EVRCompositorError ivrcompositor_submit_vulkan( EVRCompositorError (*cpp_func)( void *, EVREye, const Texture_t *, const VRTextureBounds_t *, EVRSubmitFlags ), - void *linux_side, EVREye eye, const Texture_t *texture, - const VRTextureBounds_t *bounds, - EVRSubmitFlags flags, unsigned int version ) +static void free_compositor_texture_dxvk( struct submit_state *state ) { - struct VRVulkanTextureData_t our_depth_vkdata, *their_vkdata; - struct VRVulkanTextureArrayData_t our_vkdata; - VRTextureWithPoseAndDepth_t our_both; - VRTextureWithDepth_t our_depth; - VRTextureWithPose_t our_pose; - Texture_t our_texture; - const void *tex = texture; + if (!state->dxvk_device) return; + + state->dxvk_device->lpVtbl->ReleaseSubmissionQueue( state->dxvk_device ); + state->dxvk_device->lpVtbl->TransitionSurfaceLayout( state->dxvk_device, state->dxvk_surface, &state->subresources, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, state->image_layout ); + state->dxvk_device->lpVtbl->Release( state->dxvk_device ); + state->dxvk_surface->lpVtbl->Release( state->dxvk_surface ); +} + +static void load_compositor_texture_vulkan( EVREye eye, const Texture_t *texture, EVRSubmitFlags flags, + struct submit_state *state ) +{ + struct VRVulkanTextureData_t *their_vkdata; their_vkdata = texture->handle; - memcpy( &our_vkdata, their_vkdata, flags & Submit_VulkanTextureWithArrayData ? sizeof(struct VRVulkanTextureArrayData_t) - : sizeof(struct VRVulkanTextureData_t) ); + memcpy( &state->vkdata, their_vkdata, flags & Submit_VulkanTextureWithArrayData ? sizeof(struct VRVulkanTextureArrayData_t) + : sizeof(struct VRVulkanTextureData_t) ); - our_vkdata.t.m_pDevice = get_native_VkDevice( our_vkdata.t.m_pDevice ); - our_vkdata.t.m_pPhysicalDevice = get_native_VkPhysicalDevice( our_vkdata.t.m_pPhysicalDevice ); - our_vkdata.t.m_pInstance = get_native_VkInstance( our_vkdata.t.m_pInstance ); - our_vkdata.t.m_pQueue = get_native_VkQueue( our_vkdata.t.m_pQueue ); + state->vkdata.t.m_pDevice = get_native_VkDevice( state->vkdata.t.m_pDevice ); + state->vkdata.t.m_pPhysicalDevice = get_native_VkPhysicalDevice( state->vkdata.t.m_pPhysicalDevice ); + state->vkdata.t.m_pInstance = get_native_VkInstance( state->vkdata.t.m_pInstance ); + state->vkdata.t.m_pQueue = get_native_VkQueue( state->vkdata.t.m_pQueue ); switch (flags & (Submit_TextureWithPose | Submit_TextureWithDepth)) { case 0: - our_texture = *texture; - our_texture.handle = &our_vkdata; - tex = &our_texture; + state->texture = *texture; + state->texture.handle = &state->vkdata; break; case Submit_TextureWithPose: - our_pose = *(VRTextureWithPose_t *)texture; - our_pose.texture.handle = &our_vkdata; - tex = &our_pose; + state->pose = *(VRTextureWithPose_t *)texture; + state->pose.texture.handle = &state->vkdata; + state->submit = &state->pose; break; case Submit_TextureWithDepth: - our_depth = *(VRTextureWithDepth_t *)texture; - - our_depth.texture.handle = &our_vkdata; - - tex = &our_depth; + state->depth = *(VRTextureWithDepth_t *)texture; + state->depth.texture.handle = &state->vkdata; + state->submit = &state->depth; break; case Submit_TextureWithPose | Submit_TextureWithDepth: - our_both = *(VRTextureWithPoseAndDepth_t *)texture; + state->both = *(VRTextureWithPoseAndDepth_t *)texture; + state->both.texture.handle = &state->vkdata; - our_both.texture.handle = &our_vkdata; + their_vkdata = state->both.depth.handle; + state->depth_vkdata = *their_vkdata; + state->depth_vkdata.m_pDevice = get_native_VkDevice( state->depth_vkdata.m_pDevice ); + state->depth_vkdata.m_pPhysicalDevice = get_native_VkPhysicalDevice( state->depth_vkdata.m_pPhysicalDevice ); + state->depth_vkdata.m_pInstance = get_native_VkInstance( state->depth_vkdata.m_pInstance ); + state->depth_vkdata.m_pQueue = get_native_VkQueue( state->depth_vkdata.m_pQueue ); + state->both.depth.handle = &state->depth_vkdata; - their_vkdata = our_both.depth.handle; - our_depth_vkdata = *their_vkdata; - our_depth_vkdata.m_pDevice = get_native_VkDevice( our_depth_vkdata.m_pDevice ); - our_depth_vkdata.m_pPhysicalDevice = get_native_VkPhysicalDevice( our_depth_vkdata.m_pPhysicalDevice ); - our_depth_vkdata.m_pInstance = get_native_VkInstance( our_depth_vkdata.m_pInstance ); - our_depth_vkdata.m_pQueue = get_native_VkQueue( our_depth_vkdata.m_pQueue ); - - our_both.depth.handle = &our_depth_vkdata; - - tex = &our_both; + state->submit = &state->both; break; } - - return cpp_func( linux_side, eye, tex, bounds, flags ); } -static EVRCompositorError ivrcompositor_submit( EVRCompositorError (*cpp_func)( void *, EVREye, const Texture_t *, const VRTextureBounds_t *, EVRSubmitFlags ), - void *linux_side, EVREye eye, const Texture_t *texture, - const VRTextureBounds_t *bounds, EVRSubmitFlags flags, unsigned int version ) -{ - IDXGIVkInteropSurface *dxvk_surface; - IUnknown *texture_iface; - HRESULT hr; - - TRACE( "%p, %#x, %p, %p, %#x\n", linux_side, eye, texture, bounds, flags ); - - compositor_data.handoff_called = FALSE; - - switch (texture->eType) - { - case TextureType_DirectX: - { - TRACE( "D3D11\n" ); - - if (!texture->handle) - { - WARN( "No D3D11 texture %p.\n", texture ); - return cpp_func( linux_side, eye, texture, bounds, flags ); - } - - texture_iface = texture->handle; - - if (SUCCEEDED(hr = texture_iface->lpVtbl->QueryInterface( texture_iface, &IID_IDXGIVkInteropSurface, - (void **)&dxvk_surface ))) - { - return ivrcompositor_submit_dxvk( cpp_func, linux_side, eye, texture, bounds, flags, version, dxvk_surface ); - } - - WARN( "Invalid D3D11 texture %p.\n", texture ); - return cpp_func( linux_side, eye, texture, bounds, flags ); - } - - case TextureType_Vulkan: - return ivrcompositor_submit_vulkan( cpp_func, linux_side, eye, texture, bounds, flags, version ); - - default: - return cpp_func( linux_side, eye, texture, bounds, flags ); - } -} - -static EVRCompositorError ivrcompositor_set_skybox_override_d3d11( EVRCompositorError (*cpp_func)( void *, const Texture_t *textures, uint32_t count ), - void *linux_side, const Texture_t *textures, uint32_t count ) +struct set_skybox_override_state { + Texture_t textures[6]; struct VRVulkanTextureData_t vkdata[6]; +}; + +static const Texture_t *set_skybox_override_d3d11_init( const Texture_t *textures, uint32_t count, struct set_skybox_override_state *state ) +{ IDXGIVkInteropSurface *dxvk_surface; - struct Texture_t vktexture[6]; - EVRCompositorError result; unsigned int i; for (i = 0; i < count; ++i) { const Texture_t *texture = &textures[i]; + VkImageSubresourceRange subresources; + IDXGIVkInteropDevice *dxvk_device; + VkImageCreateInfo image_info; + VkImageLayout image_layout; IUnknown *texture_iface; if (!texture->handle) { ERR( "No D3D11 texture %p.\n", texture ); - return cpp_func( linux_side, textures, count ); + return textures; } if (textures[i].eType != TextureType_DirectX) { FIXME( "Mixing texture types is not supported.\n" ); - return 0; + return textures; } texture_iface = texture->handle; - if (SUCCEEDED(texture_iface->lpVtbl->QueryInterface( texture_iface, &IID_IDXGIVkInteropSurface, - (void **)&dxvk_surface ))) + if (FAILED(texture_iface->lpVtbl->QueryInterface( texture_iface, &IID_IDXGIVkInteropSurface, + (void **)&dxvk_surface ))) { - VkImageSubresourceRange subresources; - IDXGIVkInteropDevice *dxvk_device; - VkImageCreateInfo image_info; - VkImageLayout image_layout; + FIXME( "Unsupported d3d11 texture %p, i %u.\n", texture, i ); + return textures; + } - vktexture[i] = vrclient_translate_texture_dxvk( texture, &vkdata[i], dxvk_surface, - &dxvk_device, &image_layout, &image_info ); - - if (compositor_data.dxvk_device && dxvk_device != compositor_data.dxvk_device) - { - ERR( "Invalid dxvk_device %p, previous %p.\n", dxvk_device, compositor_data.dxvk_device ); - dxvk_surface->lpVtbl->Release( dxvk_surface ); - dxvk_device->lpVtbl->Release( dxvk_device ); - return 0; - } - - compositor_data.dxvk_device = dxvk_device; - - subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - subresources.baseMipLevel = 0; - subresources.levelCount = image_info.mipLevels; - subresources.baseArrayLayer = 0; - subresources.layerCount = image_info.arrayLayers; - - dxvk_device->lpVtbl->TransitionSurfaceLayout( dxvk_device, dxvk_surface, &subresources, image_layout, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ); + state->textures[i] = vrclient_translate_texture_dxvk( texture, &state->vkdata[i], dxvk_surface, + &dxvk_device, &image_layout, &image_info ); + if (compositor_data.dxvk_device && dxvk_device != compositor_data.dxvk_device) + { + ERR( "Invalid dxvk_device %p, previous %p.\n", dxvk_device, compositor_data.dxvk_device ); dxvk_surface->lpVtbl->Release( dxvk_surface ); dxvk_device->lpVtbl->Release( dxvk_device ); - - continue; + return textures; } - FIXME( "Unsupported d3d11 texture %p, i %u.\n", texture, i ); - return 0; + + compositor_data.dxvk_device = dxvk_device; + + subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + subresources.baseMipLevel = 0; + subresources.levelCount = image_info.mipLevels; + subresources.baseArrayLayer = 0; + subresources.layerCount = image_info.arrayLayers; + + dxvk_device->lpVtbl->TransitionSurfaceLayout( dxvk_device, dxvk_surface, &subresources, image_layout, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL ); + + dxvk_surface->lpVtbl->Release( dxvk_surface ); + dxvk_device->lpVtbl->Release( dxvk_device ); } compositor_data.dxvk_device->lpVtbl->FlushRenderingCommands( compositor_data.dxvk_device ); compositor_data.dxvk_device->lpVtbl->LockSubmissionQueue( compositor_data.dxvk_device ); - result = cpp_func( linux_side, vktexture, count ); - - compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); - - TRACE( "result %u.\n", result ); - return result; + return state->textures; } -static EVRCompositorError ivrcompositor_set_skybox_override( EVRCompositorError (*cpp_func)( void *, const Texture_t *textures, uint32_t count ), - void *linux_side, const Texture_t *textures, - uint32_t count, unsigned int version ) +static const Texture_t *set_skybox_override_init( const Texture_t *textures, uint32_t count, struct set_skybox_override_state *state ) { - TRACE( "cpp_func %p, linux_side %p, textures %p, count %u, version %u.\n", cpp_func, linux_side, - textures, count, version ); - if (!count || count > 6) { WARN( "Invalid texture count %u.\n", count ); - return cpp_func( linux_side, textures, count ); + return textures; } if (textures[0].eType == TextureType_DirectX) - return ivrcompositor_set_skybox_override_d3d11( cpp_func, linux_side, textures, count ); + return set_skybox_override_d3d11_init( textures, count, state ); FIXME( "Conversion for type %u is not supported.\n", textures[0].eType ); - return 0; + return textures; } -static void ivrcompositor_post_present_handoff( void (*cpp_func)( void * ), void *linux_side, unsigned int version ) +static void set_skybox_override_done( const Texture_t *textures, uint32_t count ) { - TRACE( "%p\n", linux_side ); + if (!count || count > 6) return; + while (count--) if (!textures[count].handle || textures[count].eType != TextureType_DirectX) return; + compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); +} - if (compositor_data.dxvk_device) +static void post_present_handoff_init( void *linux_side, unsigned int version ) +{ + if (!compositor_data.dxvk_device) return; + compositor_data.dxvk_device->lpVtbl->LockSubmissionQueue( compositor_data.dxvk_device ); + + if (!compositor_data.d3d11_explicit_handoff && version >= 21) { - compositor_data.dxvk_device->lpVtbl->LockSubmissionQueue( compositor_data.dxvk_device ); - - if (!compositor_data.d3d11_explicit_handoff && version >= 21) - { - /* PostPresentHandoff can be used with d3d11 without SetExplicitTimingMode - * (which is Vulkan / d3d12 only), but doing the same with Vulkan results - * in lockups and crashes. */ - cppIVRCompositor_IVRCompositor_021_SetExplicitTimingMode( linux_side, VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff ); - compositor_data.d3d11_explicit_handoff = TRUE; - } + /* PostPresentHandoff can be used with d3d11 without SetExplicitTimingMode + * (which is Vulkan / d3d12 only), but doing the same with Vulkan results + * in lockups and crashes. */ + cppIVRCompositor_IVRCompositor_021_SetExplicitTimingMode( linux_side, VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff ); + compositor_data.d3d11_explicit_handoff = TRUE; } +} - cpp_func( linux_side ); - +static void post_present_handoff_done(void) +{ compositor_data.handoff_called = TRUE; - if (compositor_data.dxvk_device) - compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); + if (!compositor_data.dxvk_device) return; + compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); } -static EVRCompositorError ivrcompositor_wait_get_poses( EVRCompositorError (cpp_func)( void *, TrackedDevicePose_t *, uint32_t, TrackedDevicePose_t *, uint32_t ), - void *linux_side, TrackedDevicePose_t *render_poses, - uint32_t render_pose_count, TrackedDevicePose_t *game_poses, - uint32_t game_pose_count, unsigned int version ) +static void wait_get_poses_init( void *linux_side ) { - EVRCompositorError r; + if (!compositor_data.dxvk_device) return; + compositor_data.dxvk_device->lpVtbl->LockSubmissionQueue( compositor_data.dxvk_device ); - TRACE( "%p, %p, %u, %p, %u\n", linux_side, render_poses, render_pose_count, game_poses, game_pose_count ); - - if (compositor_data.dxvk_device) + if (compositor_data.d3d11_explicit_handoff && !compositor_data.handoff_called) { - compositor_data.dxvk_device->lpVtbl->LockSubmissionQueue( compositor_data.dxvk_device ); - if (compositor_data.d3d11_explicit_handoff && !compositor_data.handoff_called) - { - /* Calling handoff after submit is optional for d3d11 but mandatory for Vulkan - * if explicit timing mode is set. */ - cppIVRCompositor_IVRCompositor_022_PostPresentHandoff( linux_side ); - } + /* Calling handoff after submit is optional for d3d11 but mandatory for Vulkan + * if explicit timing mode is set. */ + cppIVRCompositor_IVRCompositor_022_PostPresentHandoff( linux_side ); } - - r = cpp_func( linux_side, render_poses, render_pose_count, game_poses, game_pose_count ); - - if (compositor_data.dxvk_device) - { - if (compositor_data.d3d11_explicit_handoff) - cppIVRCompositor_IVRCompositor_022_SubmitExplicitTimingData( linux_side ); - - compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); - } - - return r; } -static 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 ) +static void wait_get_poses_done( void *linux_side ) { - uint32_t ret; + if (!compositor_data.dxvk_device) return; - phys_dev = get_native_VkPhysicalDevice( phys_dev ); + if (compositor_data.d3d11_explicit_handoff) + cppIVRCompositor_IVRCompositor_022_SubmitExplicitTimingData( linux_side ); - ret = cpp_func( linux_side, phys_dev, value, bufsize ); - TRACE( "ret %u, value %s.\n", ret, value ); - return ret; + compositor_data.dxvk_device->lpVtbl->ReleaseSubmissionQueue( compositor_data.dxvk_device ); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_009_Submit( struct w_steam_iface *_this, EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_009_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 9 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_009_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_009_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_009_PostPresentHandoff, _this->u_iface, 9 ); + post_present_handoff_init( _this->u_iface, 9 ); + cppIVRCompositor_IVRCompositor_009_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_009_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_009_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 9 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_009_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -398,26 +350,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_010_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_010_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 10 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_010_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_010_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_010_PostPresentHandoff, _this->u_iface, 10 ); + post_present_handoff_init( _this->u_iface, 10 ); + cppIVRCompositor_IVRCompositor_010_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_010_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_010_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 10 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_010_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -425,26 +386,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_011_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_011_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 11 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_011_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_011_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_011_PostPresentHandoff, _this->u_iface, 11 ); + post_present_handoff_init( _this->u_iface, 11 ); + cppIVRCompositor_IVRCompositor_011_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_011_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_011_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 11 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_011_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -452,26 +422,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_012_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_012_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 12 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_012_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_012_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_012_PostPresentHandoff, _this->u_iface, 12 ); + post_present_handoff_init( _this->u_iface, 12 ); + cppIVRCompositor_IVRCompositor_012_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_012_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_012_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 12 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_012_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -479,26 +458,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_013_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_013_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 13 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_013_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_013_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_013_PostPresentHandoff, _this->u_iface, 13 ); + post_present_handoff_init( _this->u_iface, 13 ); + cppIVRCompositor_IVRCompositor_013_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_013_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_013_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 13 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_013_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -506,26 +494,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_014_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_014_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 14 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_014_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_014_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_014_PostPresentHandoff, _this->u_iface, 14 ); + post_present_handoff_init( _this->u_iface, 14 ); + cppIVRCompositor_IVRCompositor_014_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_014_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_014_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 14 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_014_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -533,26 +530,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_015_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_015_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 15 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_015_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_015_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_015_PostPresentHandoff, _this->u_iface, 15 ); + post_present_handoff_init( _this->u_iface, 15 ); + cppIVRCompositor_IVRCompositor_015_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_015_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_015_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 15 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_015_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -562,8 +568,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_016_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_016_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 16 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_016_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -571,26 +579,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_016_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_016_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 16 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_016_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_016_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_016_PostPresentHandoff, _this->u_iface, 16 ); + post_present_handoff_init( _this->u_iface, 16 ); + cppIVRCompositor_IVRCompositor_016_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_016_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_016_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 16 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_016_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -600,8 +617,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_017_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_017_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 17 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_017_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -609,26 +628,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_017_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_017_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 17 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_017_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_017_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_017_PostPresentHandoff, _this->u_iface, 17 ); + post_present_handoff_init( _this->u_iface, 17 ); + cppIVRCompositor_IVRCompositor_017_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_017_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_017_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 17 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_017_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -638,8 +666,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_018_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_018_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 18 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_018_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -647,26 +677,35 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_018_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_018_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 18 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_018_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_018_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_018_PostPresentHandoff, _this->u_iface, 18 ); + post_present_handoff_init( _this->u_iface, 18 ); + cppIVRCompositor_IVRCompositor_018_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_018_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_018_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 18 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_018_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } @@ -676,8 +715,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_019_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_019_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 19 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_019_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -685,37 +726,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_019_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_019_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 19 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_019_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_019_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_019_PostPresentHandoff, _this->u_iface, 19 ); + post_present_handoff_init( _this->u_iface, 19 ); + cppIVRCompositor_IVRCompositor_019_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_019_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_019_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 19 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_019_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 19 ); + _ret = cppIVRCompositor_IVRCompositor_019_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -725,8 +774,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_020_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_020_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 20 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_020_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -734,37 +785,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_020_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_020_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 20 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_020_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_020_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_020_PostPresentHandoff, _this->u_iface, 20 ); + post_present_handoff_init( _this->u_iface, 20 ); + cppIVRCompositor_IVRCompositor_020_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_020_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_020_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 20 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_020_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 20 ); + _ret = cppIVRCompositor_IVRCompositor_020_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -774,8 +833,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_021_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_021_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 21 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_021_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -783,37 +844,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_021_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_021_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 21 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_021_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_021_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_021_PostPresentHandoff, _this->u_iface, 21 ); + post_present_handoff_init( _this->u_iface, 21 ); + cppIVRCompositor_IVRCompositor_021_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_021_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_021_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 21 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_021_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 21 ); + _ret = cppIVRCompositor_IVRCompositor_021_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -823,8 +892,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_022_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_022_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 22 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_022_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -832,37 +903,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_022_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_022_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 22 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_022_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_022_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_022_PostPresentHandoff, _this->u_iface, 22 ); + post_present_handoff_init( _this->u_iface, 22 ); + cppIVRCompositor_IVRCompositor_022_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_022_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_022_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 22 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_022_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 22 ); + _ret = cppIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -872,8 +951,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_024_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_024_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 24 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_024_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -881,37 +962,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_024_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_024_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 24 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_024_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_024_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_024_PostPresentHandoff, _this->u_iface, 24 ); + post_present_handoff_init( _this->u_iface, 24 ); + cppIVRCompositor_IVRCompositor_024_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_024_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_024_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 24 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_024_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_024_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_024_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 24 ); + _ret = cppIVRCompositor_IVRCompositor_024_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -921,8 +1010,10 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_026_WaitGetPoses( s { EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_wait_get_poses( cppIVRCompositor_IVRCompositor_026_WaitGetPoses, _this->u_iface, pRenderPoseArray, - unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 26 ); + wait_get_poses_init( _this->u_iface ); + _ret = cppIVRCompositor_IVRCompositor_026_WaitGetPoses( _this->u_iface, pRenderPoseArray, unRenderPoseArrayCount, + pGamePoseArray, unGamePoseArrayCount ); + wait_get_poses_done( _this->u_iface ); return _ret; } @@ -930,37 +1021,45 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_026_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_026_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 26 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_026_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_026_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_026_PostPresentHandoff, _this->u_iface, 26 ); + post_present_handoff_init( _this->u_iface, 26 ); + cppIVRCompositor_IVRCompositor_026_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_026_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_026_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 26 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_026_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_026_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_026_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 26 ); + _ret = cppIVRCompositor_IVRCompositor_026_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; } @@ -968,36 +1067,44 @@ EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_027_Submit( struct EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t *pBounds, EVRSubmitFlags nSubmitFlags ) { + struct submit_state state = {.texture = *pTexture, .submit = &state.texture}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_submit( cppIVRCompositor_IVRCompositor_027_Submit, _this->u_iface, eEye, - pTexture, pBounds, nSubmitFlags, 27 ); + + compositor_data.handoff_called = FALSE; + if (pTexture->eType == TextureType_DirectX) load_compositor_texture_dxvk( eEye, pTexture, nSubmitFlags, &state ); + if (pTexture->eType == TextureType_Vulkan) load_compositor_texture_vulkan( eEye, pTexture, nSubmitFlags, &state ); + _ret = cppIVRCompositor_IVRCompositor_027_Submit( _this->u_iface, eEye, state.submit, pBounds, nSubmitFlags ); + if (pTexture->eType == TextureType_DirectX) free_compositor_texture_dxvk( &state ); return _ret; } void __thiscall winIVRCompositor_IVRCompositor_027_PostPresentHandoff( struct w_steam_iface *_this ) { TRACE( "%p\n", _this ); - ivrcompositor_post_present_handoff( cppIVRCompositor_IVRCompositor_027_PostPresentHandoff, _this->u_iface, 27 ); + post_present_handoff_init( _this->u_iface, 27 ); + cppIVRCompositor_IVRCompositor_027_PostPresentHandoff( _this->u_iface ); + post_present_handoff_done(); } EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_027_SetSkyboxOverride( struct w_steam_iface *_this, const Texture_t *pTextures, uint32_t unTextureCount ) { + struct set_skybox_override_state state = {0}; EVRCompositorError _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_set_skybox_override( cppIVRCompositor_IVRCompositor_027_SetSkyboxOverride, - _this->u_iface, pTextures, unTextureCount, 27 ); + pTextures = set_skybox_override_init( pTextures, unTextureCount, &state ); + _ret = cppIVRCompositor_IVRCompositor_027_SetSkyboxOverride( _this->u_iface, pTextures, unTextureCount ); + set_skybox_override_done( pTextures, unTextureCount ); return _ret; } uint32_t __thiscall winIVRCompositor_IVRCompositor_027_GetVulkanDeviceExtensionsRequired( struct w_steam_iface *_this, VkPhysicalDevice_T *pPhysicalDevice, char *pchValue, uint32_t unBufferSize ) { + VkPhysicalDevice_T *native_device = get_native_VkPhysicalDevice( pPhysicalDevice ); uint32_t _ret; TRACE( "%p\n", _this ); - _ret = ivrcompositor_get_vulkan_device_extensions_required( cppIVRCompositor_IVRCompositor_027_GetVulkanDeviceExtensionsRequired, - _this->u_iface, pPhysicalDevice, - pchValue, unBufferSize, 27 ); + _ret = cppIVRCompositor_IVRCompositor_027_GetVulkanDeviceExtensionsRequired( _this->u_iface, native_device, pchValue, unBufferSize ); return _ret; }