Compare commits

...

3 Commits

Author SHA1 Message Date
Andrew Eikum
519651ebb4 wineopenxr: HACK: Don't try to call OpenXR functions if OpenVR is not working 2021-01-13 10:16:39 -06:00
Andrew Eikum
21bbd755d2 update dxvk to v1.7.3-28-g8163eb41 2021-01-13 10:16:39 -06:00
Andrew Eikum
06a66e8c31 update wine 2021-01-11 12:26:56 -06:00
3 changed files with 65 additions and 2 deletions

2
dxvk

@ -1 +1 @@
Subproject commit c1f23643f9c8e7bf8e9d6b3e6f07da29b1ae429d
Subproject commit 85c70ad5db0863ffbc4afee2ca57a6e6e92e8ef6

2
wine

@ -1 +1 @@
Subproject commit ee64c2b291290753eefdca064b89ad86e2e6fcbe
Subproject commit 4b54b614e48d9463e71acf2da899ddd05978a29f

View File

@ -224,6 +224,65 @@ static void parse_extensions(const char *in, uint32_t *out_count,
*out_strs = list;
}
static BOOL HACK_does_openvr_work(void)
{
/* Linux SteamVR's xrCreateInstance will hang forever if SteamVR hasn't
* already been launched by the user. Since that's the only way to tell if
* OpenXR is functioning, let's use OpenVR to tell whether SteamVR is
* functioning before calling xrCreateInstance.
*
* This should be removed when SteamVR's bug is fixed. */
static void *(CDECL *InitInternal)(int *err, int type);
static void (CDECL *ShutdownInternal)(void);
static void *(CDECL *GetGenericInterface)(const char *, int *err);
int error;
HANDLE openvr_api;
void *compositor;
BOOL need_unload = FALSE;
openvr_api = GetModuleHandleW(L"openvr_api.dll");
if(!openvr_api){
openvr_api = LoadLibraryW(L"openvr_api_dxvk.dll");
if(!openvr_api){
WINE_TRACE("no openvr_api_dxvk\n");
return FALSE;
}
need_unload = TRUE;
}
InitInternal = (void *)GetProcAddress(openvr_api, "VR_InitInternal");
ShutdownInternal = (void *)GetProcAddress(openvr_api, "VR_ShutdownInternal");
GetGenericInterface = (void *)GetProcAddress(openvr_api, "VR_GetGenericInterface");
if(!InitInternal || !ShutdownInternal || !GetGenericInterface){
WINE_TRACE("missing openvr function\n");
if(need_unload)
FreeLibrary(openvr_api);
return FALSE;
}
error = 1;
compositor = GetGenericInterface("IVRCompositor_022", &error);
if(!compositor || error != 0){
InitInternal(&error, 3 /* VRApplication_Background */);
if(error == 0 /* VRInitError_None */){
WINE_TRACE("openvr init succeeded\n");
ShutdownInternal();
}else
WINE_TRACE("openvr init failed\n");
}else{
WINE_TRACE("got openvr compositor\n");
}
if(need_unload)
FreeLibrary(openvr_api);
return error == 0 /* VRInitError_None */;
}
XrResult load_host_openxr_loader(void)
{
PFN_xrGetVulkanInstanceExtensionsKHR pxrGetVulkanInstanceExtensionsKHR;
@ -250,6 +309,10 @@ XrResult load_host_openxr_loader(void)
/* already done */
return XR_SUCCESS;
if(!HACK_does_openvr_work()){
return XR_ERROR_INITIALIZATION_FAILED;
}
load_vk_unwrappers();
XrInstanceCreateInfo xrCreateInfo = {