1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxvk] Always reference library in VR extension providers

This commit is contained in:
Paul Gofman 2023-06-13 19:01:23 -06:00 committed by Philip Rebohle
parent 2c014fdb34
commit af9bd16b8d
2 changed files with 10 additions and 9 deletions

View File

@ -305,11 +305,14 @@ namespace dxvk {
HMODULE VrInstance::loadLibrary() {
HMODULE handle = nullptr;
if (!(handle = ::GetModuleHandle("openvr_api.dll"))) {
HMODULE handle;
// Use openvr_api.dll only if already loaded in the process (and reference it which GetModuleHandleEx does without
// GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT flag).
if (!::GetModuleHandleEx(0, "openvr_api.dll", &handle))
handle = ::LoadLibrary("openvr_api_dxvk.dll");
m_loadedOvrApi = handle != nullptr;
}
m_loadedOvrApi = handle != nullptr;
return handle;
}

View File

@ -147,11 +147,9 @@ namespace dxvk {
HMODULE DxvkXrProvider::loadLibrary() {
HMODULE handle = nullptr;
if (!(handle = ::GetModuleHandle("wineopenxr.dll"))) {
handle = ::LoadLibrary("wineopenxr.dll");
m_loadedOxrApi = handle != nullptr;
}
HMODULE handle = ::LoadLibrary("wineopenxr.dll");
m_loadedOxrApi = handle != nullptr;
return handle;
}