Repository: godot
Issue: Boost errors when running OpenXR / Vulkan with an AMD GPU
Labels: bug,platform:windows,topic:thirdparty,topic:xr,crash

### Godot version

v4.0.alpha.custom_build.4bbe7f0b9

### System information

Windows 10 Pro 21H2 19044.1766; SteamVR 1.22.13; AMD Radeon RX 580 Series, 22.10.17.01-220517a-379774C-AMD-Software-Adrenalin-Edition; AMD Windows Driver 30.0.21017.1000; Vulkan API Version 1.3.212; Vulkan Driver Version 2.0.226

### Issue description

Godot alpha 10 VR game crashes on frame one, using the basic example from https://docs.godotengine.org/en/latest/tutorials/xr/setting_up_xr.html

This could be because I'm using a Quest 1, but this crash happens on both Oculus Link and Virtual Desktop. This is using all default settings, and running on a Vulkan backend and SteamVR with no addons or startup programs.

The collected logs are below, and the renderdoc of the first frame vulkan attempts to render is attached: [vulkan_crash.zip](https://github.com/godotengine/godot/files/8936398/vulkan_crash.zip)

## GODOT LOG
```
================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.0.alpha.custom_build (4bbe7f0b98de72d6dd77d5ade4b761de375bcf66)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[1] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[2] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[3] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[4] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[5] boost::serialization::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >::singleton<boost::serialization::extended_type_info_typeid<_SC_FLOAT_CONST> >
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] RenderingDeviceVulkan::_draw_list_render_pass_begin (e:\users\facade\documents\github\godot\drivers\vulkan\rendering_device_vulkan.cpp:7005)
[11] RenderingDeviceVulkan::draw_list_begin (e:\users\facade\documents\github\godot\drivers\vulkan\rendering_device_vulkan.cpp:7129)
[12] RendererRD::CopyEffects::copy_to_fb_rect (e:\users\facade\documents\github\godot\servers\rendering\renderer_rd\effects\copy_effects.cpp:379)
[13] OpenXRVulkanExtension::copy_render_target_to_image (e:\users\facade\documents\github\godot\modules\openxr\extensions\openxr_vulkan_extension.cpp:458)
[14] OpenXRAPI::post_draw_viewport (e:\users\facade\documents\github\godot\modules\openxr\openxr_api.cpp:1499)
[15] OpenXRInterface::post_draw_viewport (e:\users\facade\documents\github\godot\modules\openxr\openxr_interface.cpp:721)
[16] RendererViewport::draw_viewports (e:\users\facade\documents\github\godot\servers\rendering\renderer_viewport.cpp:644)
[17] RenderingServerDefault::_draw (e:\users\facade\documents\github\godot\servers\rendering\rendering_server_default.cpp:92)
[18] RenderingServerDefault::draw (e:\users\facade\documents\github\godot\servers\rendering\rendering_server_default.cpp:387)
[19] Main::iteration (e:\users\facade\documents\github\godot\main\main.cpp:2780)
[20] OS_Windows::run (e:\users\facade\documents\github\godot\platform\windows\os_windows.cpp:777)
[21] widechar_main (e:\users\facade\documents\github\godot\platform\windows\godot_windows.cpp:175)
[22] _main (e:\users\facade\documents\github\godot\platform\windows\godot_windows.cpp:197)
[23] main (e:\users\facade\documents\github\godot\platform\windows\godot_windows.cpp:211)
[24] WinMain (e:\users\facade\documents\github\godot\platform\windows\godot_windows.cpp:225)
[25] __scrt_common_main_seh (d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[26] BaseThreadInitThunk
-- END OF BACKTRACE --
================================================================
```


## STEAMVR LOG
```
Sun Jun 19 2022 14:40:24.155 - Connecting client (SteamVR_Namespace) app container status: 1
Sun Jun 19 2022 14:40:24.155 - CSharedResourceNamespaceServer sent namespace data: 14116
CSharedResourceNamespaceClient::Init(): received namespace data 14116
Client (VR_ServerPipe_14116) app container state: 1
Sun Jun 19 2022 14:40:24.157 - Connecting client (VR_ServerPipe_14116) app container status: 1
Sun Jun 19 2022 14:40:24.157 - New Connect message from E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe (VRApplication_OpenXRInstance) (Args: --path E:/Users/facade/Documents/Github/godot-alpha-test) 15224 
Sun Jun 19 2022 14:40:24.163 - Creating Builtin AppInfo for E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe (VRApplication_OpenXRInstance). , Godot Alpha Test, 15224
Sun Jun 19 2022 14:40:24.163 - AppInfoManager.ProcessConnected BEGIN 15224 E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe 9 system.generated.godot.windows.tools.64.exe
Sun Jun 19 2022 14:40:24.169 - SetApplicationPid appkey=system.generated.godot.windows.tools.64.exe pid=15224, external transition
Sun Jun 19 2022 14:40:24.169 - SetApplicationPid: Setting app system.generated.godot.windows.tools.64.exe PID to 15224
Sun Jun 19 2022 14:40:24.169 - AppInfoManager.ProcessConnected END
Sun Jun 19 2022 14:40:24.170 - Using existing HMD oculus.1PASH5D1P17365
Sun Jun 19 2022 14:40:24.170 - Processing message VRMsg_Connect from godot.windows.tools.64 (15224) took 0.0122 seconds
Received success response from vrserver connect
Not looking for a good app key because Steam didn't start this app
App key after connect message:system.generated.godot.windows.tools.64.exe
Optional vulkan instance extension is unavailable: VK_NV_external_memory_capabilities
Optional vulkan instance extension is unavailable: VK_NV_external_memory_capabilities
Optional vulkan instance extension is unavailable: VK_NV_external_memory_capabilities
Sun Jun 19 2022 14:40:29.857 - OpenProcess failed for pid = 1388. Error: Access is denied.
 (5)
Warning: Provided input path (/user/hand/left/input/system/click) is not valid for this interaction profile (/interaction_profiles/htc/vive_cosmos_controller)
Initializing CVulkanVRRenderer
Debug markers: enabled
Initialized Vulkan transfer ring buffer, mapped at offset 0x0000015487E80000.
Sun Jun 19 2022 14:40:30.687 - StartSceneApplicationTransitionFromProcess( 15224, E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe, system.generated.godot.windows.tools.64.exe)
Sun Jun 19 2022 14:40:30.687 - AppInfoManager.ProcessConnected BEGIN 15224 E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe 10 system.generated.godot.windows.tools.64.exe
Changing app type from VRApplication_OpenXRInstance to VRApplication_OpenXRScene
Sun Jun 19 2022 14:40:30.693 - SetApplicationPid appkey=system.generated.godot.windows.tools.64.exe pid=15224, external transition
Sun Jun 19 2022 14:40:30.693 - SetApplicationPid: Setting app system.generated.godot.windows.tools.64.exe PID to 15224
Sun Jun 19 2022 14:40:30.693 - AppInfoManager.ProcessConnected END
Sun Jun 19 2022 14:40:30.693 - Processing message VRMsg_ChangeAppType from godot.windows.tools.64 (15224) took 0.00615 seconds
Successfully changed app type
Client (VR_CompositorPipe_14116) app container state: 1
Sun Jun 19 2022 14:40:30.696 - Connecting client (VR_CompositorPipe_14116) app container status: 1
Sun Jun 19 2022 14:40:30.696 - External connection from E:\Users\facade\Documents\Github\godot\bin\godot.windows.tools.64.exe 15224
Received success response from vrcompositor connect
Initializing the limited version of CVRCompositorClient
VR Dashboard executable already running.
Transitioning XrSession from XR_SESSION_STATE_IDLE to XR_SESSION_STATE_IDLE
Transitioning XrSession from XR_SESSION_STATE_IDLE to XR_SESSION_STATE_READY
Sun Jun 19 2022 14:40:30.725 - Unable to find input profile for vive_cosmos_controller in SetXrInputConfig
Sun Jun 19 2022 14:40:30.725 - Unable to find input profile for khr_simple_controller in SetXrInputConfig
Sun Jun 19 2022 14:40:30.728 - Unable to find input profile for holographic_controller in SetXrInputConfig
Sun Jun 19 2022 14:40:30.729 - Invalid input type click for controller (/user/hand/left/input/menu)
Sun Jun 19 2022 14:40:30.729 - Invalid input type click for controller (/user/hand/right/input/system)
Sun Jun 19 2022 14:40:30.733 - Unable to find input profile for hpmotioncontroller in SetXrInputConfig
Sun Jun 19 2022 14:40:30.734 - Processing message VRMsg_Input_SetXrInputConfig from godot.windows.tools.64 (15224) took 0.00952 seconds
Sun Jun 19 2022 14:40:31.106 - Capturing Scene Focus
Sun Jun 19 2022 14:40:35.543 - Delaying SteamVR Home launch because system.generated.godot.windows.tools.64.exe ran for only 4.850321 seconds
Sun Jun 19 2022 14:40:35.626 - Closing pipe godot.windows.tools.64 (15224) because it was broken from the other end
Sun Jun 19 2022 14:40:35.626 - Process godot.windows.tools.64 (15224) disconnected (Thread(0x000002D4D004F000/0x000)
Sun Jun 19 2022 14:40:35.626 - AppInfoManager.ProcessQuit processid=15224 eLaunchingApp=LaunchingApp_None
Sun Jun 19 2022 14:40:35.626 - AppInfoManager.ProcessQuit: Clearing application system.generated.godot.windows.tools.64.exe PID was 15224
Sun Jun 19 2022 14:40:35.626 - AppInfoManager.ProcessQuit: Clearing application system.generated.godot.windows.tools.64.exe PID because 15224 has exited
Sun Jun 19 2022 14:40:35.719 - Closing pipe godot.windows.tools.64 (15224) because it was broken from the other end
Sun Jun 19 2022 14:40:35.719 - Process godot.windows.tools.64 (15224) disconnected (Thread(0x000002737BFA9D80/0x000)
Sun Jun 19 2022 14:40:35.719 - Lost pipe connection from godot.windows.tools.64 (15224)
Sun Jun 19 2022 14:40:35.719 - ######################################################################
Sun Jun 19 2022 14:40:35.719 - Cumulative stats for pid: 15224
Sun Jun 19 2022 14:40:35.719 - Total..................   335 presents.    0 dropped.    4 reprojected
Sun Jun 19 2022 14:40:35.719 - Startup................   335 presents.    0 dropped.    4 reprojected
Sun Jun 19 2022 14:40:35.719 - Loading...  0 total....     0 presents.    0 dropped.    0 reprojected
Sun Jun 19 2022 14:40:35.719 - Timed out.  0 total....     0 presents.    0 dropped.    0 reprojected
Sun Jun 19 2022 14:40:35.719 - ######################################################################
Sun Jun 19 2022 14:40:35.719 - Total dropped frames: 0
Sun Jun 19 2022 14:40:41.291 - Clearing dashboard transform because timed out
Sun Jun 19 2022 14:40:45.551 - Timer to signal start of home app and to show the dashboard has completed after 10.000000 seconds

```

### Steps to reproduce

Using a Quest 1, either start Oculus Link with it plugged into the computer or Virtual Desktop over wifi. (ALVR never starts rendering, and does not generate a stack trace.) Run the project attached with Godot 4 alpha 10, either the official build or a debug build.

### Minimal reproduction project

[godot-alpha-test.zip](https://github.com/godotengine/godot/files/8936383/godot-alpha-test.zip)