Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/Proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gofman <pgofman@codeweavers.com>2021-10-05 20:36:30 +0300
committerPaul Gofman <pgofman@codeweavers.com>2021-10-21 20:25:00 +0300
commitec6effee052fea710885d84db69dfc814c236bd1 (patch)
tree9357d231bab5e8dd2b3d8d28c65a152f4cdebde8
parent3e47499d6f95c1f3606f4c04be440613f3a4f8f8 (diff)
steam_helper: Store OpenXR vulkan extensions in registry.
CW-Bug-ID: #19504
-rw-r--r--steam_helper/steam.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp
index 0c1d95fd..94c20faa 100644
--- a/steam_helper/steam.cpp
+++ b/steam_helper/steam.cpp
@@ -545,6 +545,7 @@ extern "C"
static DWORD WINAPI initialize_vr_data(void *arg)
{
+ int (WINAPI *p__wineopenxr_get_extensions_internal)(char **instance_extensions, char **device_extensions);
vr::IVRClientCore* (*vrclient_VRClientCoreFactory)(const char *name, int *return_code);
uint32_t instance_extensions_count, device_count;
VkPhysicalDevice *phys_devices = NULL;
@@ -554,6 +555,7 @@ static DWORD WINAPI initialize_vr_data(void *arg)
VkApplicationInfo app_info = {};
char *buffer = NULL, *new_buffer;
vr::IVRClientCore* client_core;
+ char *xr_inst_ext, *xr_dev_ext;
vr::IVRCompositor* compositor;
VkInstance vk_instance = NULL;
BOOL vr_initialized = FALSE;
@@ -564,6 +566,7 @@ static DWORD WINAPI initialize_vr_data(void *arg)
const char *env_str;
unsigned int app_id;
unsigned int length;
+ HMODULE hwineopenxr;
void *lib_vrclient;
DWORD hmd_present;
int return_code;
@@ -718,6 +721,40 @@ static DWORD WINAPI initialize_vr_data(void *arg)
}
}
+ if ((hwineopenxr = LoadLibraryA("wineopenxr.dll")))
+ {
+ p__wineopenxr_get_extensions_internal = reinterpret_cast<decltype(p__wineopenxr_get_extensions_internal)>
+ (GetProcAddress(hwineopenxr, "__wineopenxr_get_extensions_internal"));
+ if (p__wineopenxr_get_extensions_internal)
+ {
+ if (!p__wineopenxr_get_extensions_internal(&xr_inst_ext, &xr_dev_ext))
+ {
+ WINE_TRACE("Got XR extensions.\n");
+ if ((status = RegSetValueExA(vr_key, "openxr_vulkan_instance_extensions", 0, REG_SZ,
+ (BYTE *)xr_inst_ext, strlen(xr_inst_ext) + 1)))
+ {
+ WINE_ERR("Could not set openxr_vulkan_instance_extensions value, status %#x.\n", status);
+ return FALSE;
+ }
+ if ((status = RegSetValueExA(vr_key, "openxr_vulkan_device_extensions", 0, REG_SZ,
+ (BYTE *)xr_dev_ext, strlen(xr_dev_ext) + 1)))
+ {
+ WINE_ERR("Could not set openxr_vulkan_device_extensions value, status %#x.\n", status);
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ WINE_ERR("__wineopenxr_get_extensions_internal not found in wineopenxr.dll.\n");
+ }
+ FreeLibrary(hwineopenxr);
+ }
+ else
+ {
+ WINE_WARN("Could not load wineopenxr.dll, err %u.\n", GetLastError());
+ }
+
vr_status = 1;
done: