Open itspngu opened 3 years ago
It used to be totally optional and disabled by default (and even forcefully disabled for a while). Looks like we'll need to update the patches we have to get rid of vr dependency code.. Or enforce the option as enabled going forward. I'll take the always enabled route for now until I have time to properly review the changes that broke our patches. Thanks!
Sounded like an optional feature to me so I disabled it, but there's a patch failing somewhere once you do that. Left enabled, everything builds fine - not sure if this needs fixing or I'm just dumb, leaving it here just in case.
Shortened build log
```shell_session $ ./proton-tkg.sh [...] patching file steam_helper/steam.cpp Hunk #1 succeeded at 61 (offset 9 lines). Hunk #2 succeeded at 1343 with fuzz 2 (offset 167 lines). patching file steam_helper/steam.cpp Hunk #1 succeeded at 570 with fuzz 2 (offset 11 lines). Hunk #2 succeeded at 608 (offset 4 lines). patching file steam_helper/steam.cpp Hunk #1 succeeded at 39 (offset 3 lines). Hunk #2 succeeded at 52 with fuzz 1 (offset 3 lines). Hunk #3 FAILED at 419. Hunk #4 FAILED at 1008. Hunk #5 succeeded at 1331 with fuzz 1 (offset 308 lines). Hunk #6 succeeded at 1339 (offset 307 lines). 2 out of 6 hunks FAILED -- saving rejects to file steam_helper/steam.cpp.rej Winemaker 0.8.4 Copyright 2000-2004 François Gougetsteam.cpp.rej
```diff --- steam_helper/steam.cpp +++ steam_helper/steam.cpp @@ -419,349 +410,6 @@ static void setup_vrpaths(void) } } -static BOOL set_vr_status(HKEY key, DWORD value) -{ - LSTATUS status; - - if ((status = RegSetValueExA(key, "state", 0, REG_DWORD, (BYTE *)&value, sizeof(value)))) - { - WINE_ERR("Could not set state value, status %#x.\n", status); - return FALSE; - } - return TRUE; -} - -void* load_vrclient(void) -{ - WCHAR pathW[PATH_MAX]; - char *pathU; - DWORD sz; - -#ifdef _WIN64 - static const char append_path[] = "/bin/linux64/vrclient.so"; -#else - static const char append_path[] = "/bin/vrclient.so"; -#endif - - /* PROTON_VR_RUNTIME is provided by the proton setup script */ - if(!GetEnvironmentVariableW(L"PROTON_VR_RUNTIME", pathW, ARRAY_SIZE(pathW))) - { - WINE_TRACE("Linux OpenVR runtime is not available\n"); - return 0; - } - - sz = WideCharToMultiByte(CP_UNIXCP, 0, pathW, -1, NULL, 0, NULL, NULL); - if(!sz) - { - WINE_ERR("Can't convert path to unixcp! %s\n", wine_dbgstr_w(pathW)); - return NULL; - } - - pathU = (char *)HeapAlloc(GetProcessHeap(), 0, sz + sizeof(append_path)); - - sz = WideCharToMultiByte(CP_UNIXCP, 0, pathW, -1, pathU, sz, NULL, NULL); - if(!sz) - { - WINE_ERR("Can't convert path to unixcp! %s\n", wine_dbgstr_w(pathW)); - return NULL; - } - - strcat(pathU, append_path); - - WINE_TRACE("got openvr runtime path: %s\n", pathU); - - return dlopen(pathU, RTLD_NOW); -} - -static char *strdupA(const char *s) -{ - size_t l = strlen(s) + 1; - char *r = (char *)heap_alloc(l); - memcpy(r, s, l); - return r; -} - -static void parse_extensions(const char *in, uint32_t *out_count, - char ***out_strs) -{ - char *iter, *start; - char **list, *str = strdupA(in); - uint32_t extension_count = 0, o = 0; - - iter = str; - while(*iter){ - if(*iter++ == ' ') - extension_count++; - } - /* count the one ending in NUL */ - if(iter != str) - extension_count++; - if(!extension_count){ - *out_count = 0; - *out_strs = NULL; - return; - } - - list = (char **)heap_alloc(extension_count * sizeof(*list)); - - start = iter = str; - do{ - if(*iter == ' '){ - *iter = 0; - list[o++] = start; - WINE_TRACE("added %s to list\n", list[o-1]); - iter++; - start = iter; - }else if(*iter == 0){ - list[o++] = start; - WINE_TRACE("added %s to list\n", list[o-1]); - break; - }else{ - iter++; - } - }while(1); - - *out_count = extension_count; - *out_strs = list; -} - -extern "C" -{ - VkPhysicalDevice WINAPI __wine_get_native_VkPhysicalDevice(VkPhysicalDevice phys_dev); -}; - -static DWORD WINAPI initialize_vr_data(void *arg) -{ - vr::IVRClientCore* (*vrclient_VRClientCoreFactory)(const char *name, int *return_code); - uint32_t instance_extensions_count, device_count; - VkPhysicalDevice *phys_devices = NULL; - VkPhysicalDeviceProperties prop = {}; - VkInstanceCreateInfo inst_info = {}; - char **instance_extensions = NULL; - VkApplicationInfo app_info = {}; - char *buffer = NULL, *new_buffer; - vr::IVRClientCore* client_core; - vr::IVRCompositor* compositor; - VkInstance vk_instance = NULL; - BOOL vr_initialized = FALSE; - HKEY vr_key = (HKEY)arg; - vr::EVRInitError error; - HMODULE hvulkan = NULL; - DWORD vr_status = ~0u; - const char *env_str; - unsigned int app_id; - unsigned int length; - void *lib_vrclient; - int return_code; - LSTATUS status; - unsigned int i; - VkResult res; - - WINE_TRACE("Starting VR info initialization.\n"); - - if (!(lib_vrclient = load_vrclient())) - { - WINE_ERR("Could not load libopenvr_api.so.\n"); - set_vr_status(vr_key, ~0u); - RegCloseKey(vr_key); - return 0; - } - - if (!(vrclient_VRClientCoreFactory = reinterpret_castSystem info
```shell_session $ inxi CPU: 16-Core (2-Die) AMD Ryzen 9 3950X (-MT MCP MCM-) speed/min/max: 2199/2200/3500 MHz Kernel: 5.14.16-301.fc35.x86_64 x86_64 Up: 3h 6m Mem: 3929.2/32036.9 MiB (12.3%) Storage: 1.86 TiB (43.8% used) Procs: 489 Shell: Bash inxi: 3.3.06 $ gcc -v Using built-in specs. COLLECT_GCC=./git/tkg/mostlyportable-gcc/gcc-mostlyportable-11.2.1-releases-gcc.11.2.0.r409.g32584d02527/bin/gcc COLLECT_LTO_WRAPPER=/home/pngu/git/tkg/mostlyportable-gcc/gcc-mostlyportable-11.2.1-releases-gcc.11.2.0.r409.g32584d02527/bin/../libexec/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none Target: x86_64-linux-gnu Configured with: /home/pngu/git/tkg/mostlyportable-gcc/build/gcc/configure --with-pkgversion=TkG-mostlyportable --disable-bootstrap --enable-languages=c,c++,lto --with-gcc-major-version-only --enable-linker-build-id --disable-libstdcxx-pch --without-included-gettext --enable-libgomp --enable-lto --enable-threads=posix --enable-tls --enable-nls --enable-clocale=gnu --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-target-system-zlib=auto --with-system-zlib --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --enable-multilib --disable-werror --enable-checking=release --with-fpmath=sse --prefix=/tmp/mostlyportable-gcc --with-tune=generic --without-cuda-driver --with-isl=/tmp/mostlyportable-gcc --with-gmp=/tmp/mostlyportable-gcc --with-mpfr=/tmp/mostlyportable-gcc --with-mpc=/tmp/mostlyportable-gcc --enable-offload-targets=nvptx-none --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.1 20211106 (TkG-mostlyportable) $ x86_64-w64-mingw32-gcc -v Using built-in specs. COLLECT_GCC=./git/tkg/mostlyportable-gcc/mingw-mostlyportable-11.2.1-releases-gcc.11.2.0.r409.g32584d02527/bin/x86_64-w64-mingw32-gcc COLLECT_LTO_WRAPPER=/home/pngu/git/tkg/mostlyportable-gcc/mingw-mostlyportable-11.2.1-releases-gcc.11.2.0.r409.g32584d02527/bin/../lib/gcc/x86_64-w64-mingw32/11.2.1/lto-wrapper Target: x86_64-w64-mingw32 Configured with: /home/pngu/git/tkg/mostlyportable-gcc/build/gcc/configure --with-pkgversion=TkG-mostlyportable --target=x86_64-w64-mingw32 --libexecdir=/tmp/mostlyportable-mingw/lib --enable-languages=c,lto,c++,objc,obj-c++ --disable-shared --enable-fully-dynamic-string --enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes --with-system-zlib --enable-cloog-backend=isl --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --with-isl=/tmp/mostlyportable-mingw --with-gmp=/tmp/mostlyportable-mingw --with-mpfr=/tmp/mostlyportable-mingw --with-mpc=/tmp/mostlyportable-mingw --prefix=/tmp/mostlyportable-mingw --disable-sjlj-exceptions --with-dwarf2 --enable-threads=posix Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.1 20211106 (TkG-mostlyportable) ```