steam_helper: Don't hand off Steam appid to OpenVR runtime in initialize_vr_data().

CW-Bug-Id: 19220

Initializing OpenVR with the app's game ID seems to cause problems with
Steam VR runtime stability when the game uses OpenXR. The negative
impact is that if OpenVR is started the initialization will be delayed
for 2 seconds by vrserver waiting for valid appid. But the wait goes
in parallel with main application startup and should not delay things
much, if at all.
This commit is contained in:
Paul Gofman 2021-08-03 20:10:14 +03:00 committed by Andrew Eikum
parent 9cf5ff5cec
commit d2080ad0fd

View File

@ -563,7 +563,6 @@ static DWORD WINAPI initialize_vr_data(void *arg)
int return_code; int return_code;
LSTATUS status; LSTATUS status;
unsigned int i; unsigned int i;
char str[256];
VkResult res; VkResult res;
WINE_TRACE("Starting VR info initialization.\n"); WINE_TRACE("Starting VR info initialization.\n");
@ -587,14 +586,8 @@ static DWORD WINAPI initialize_vr_data(void *arg)
WINE_ERR("Could not get IVRClientCore, error %d.\n", return_code); WINE_ERR("Could not get IVRClientCore, error %d.\n", return_code);
} }
if ((env_str = getenv("SteamGameId")))
app_id = atoi(env_str);
else
app_id = 1245040; /* Proton 5.0 */
/* Without overriding the app_key vrclient waits 2 seconds for a valid appkey before returning. */ /* Without overriding the app_key vrclient waits 2 seconds for a valid appkey before returning. */
sprintf(str, "{ \"app_key\" : \"steam.app.%u\" }", app_id); error = client_core->Init(vr::VRApplication_Background, NULL);
error = client_core->Init(vr::VRApplication_Background, str);
if (error != vr::VRInitError_None) if (error != vr::VRInitError_None)
{ {
if (error == vr::VRInitError_Init_NoServerForBackgroundApp) if (error == vr::VRInitError_Init_NoServerForBackgroundApp)