From f85b734f66606cd37ef74a3534fdeff4c9a55b3b Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 7 Sep 2018 14:53:30 -0500 Subject: [PATCH] Update DXVK to v0.80 and build as native .so --- build_proton.sh | 83 +++++++++++++++++++---- dxvk | 2 +- proton.in | 57 +++++++++------- vrclient_x64/vrclient_x64/vrclient_main.c | 4 -- 4 files changed, 100 insertions(+), 46 deletions(-) diff --git a/build_proton.sh b/build_proton.sh index b7343ce2..ae354756 100755 --- a/build_proton.sh +++ b/build_proton.sh @@ -290,6 +290,21 @@ function build_wine64 INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $AMD64_WRAPPER make prefix="$TOOLS_DIR64" libdir="$TOOLS_DIR64/lib64" dlldir="$TOOLS_DIR64/lib64/wine" install-dev install-lib rm -f "$DST_DIR"/bin/{msiexec,notepad,regedit,regsvr32,wineboot,winecfg,wineconsole,winedbg,winefile,winemine,winepath} rm -rf "$DST_DIR/share/man/" + + mkdir -p "$TOOLS_DIR64"/lib/pkgconfig/ + cat > "$TOOLS_DIR64"/lib/pkgconfig/proton.pc < "$TOOLS_DIR32"/lib/pkgconfig/proton.pc < "$DST_DIR"/lib64/wine/dxvk/version + #move replaced .dll.sos into a wined3d directory + mkdir -p "$DST_DIR"/lib64/wine/wined3d + for f in "$DST_DIR"/lib64/wine/dxvk/*.dll.so; do + if [ -e "$DST_DIR"/lib64/wine/$(basename $f) ]; then + mv "$DST_DIR"/lib64/wine/$(basename $f) "$DST_DIR"/lib64/wine/wined3d/ + fi + done mkdir -p "$DST_DIR"/lib/wine/dxvk - cp "$TOP/build/dxvk.win32/bin/dxgi.dll" "$DST_DIR"/lib/wine/dxvk/ - cp "$TOP/build/dxvk.win32/bin/d3d11.dll" "$DST_DIR"/lib/wine/dxvk/ + cp "$TOP"/build/dxvk.win32/lib/*.dll.so "$DST_DIR"/lib/wine/dxvk/ git submodule status -- dxvk > "$DST_DIR"/lib/wine/dxvk/version + #move replaced .dll.sos into a wined3d directory + mkdir -p "$DST_DIR"/lib/wine/wined3d + for f in "$DST_DIR"/lib/wine/dxvk/*.dll.so; do + if [ -e "$DST_DIR"/lib/wine/$(basename $f) ]; then + mv "$DST_DIR"/lib/wine/$(basename $f) "$DST_DIR"/lib/wine/wined3d/ + fi + done } @@ -609,9 +662,9 @@ fi case "$BUILD_COMPONENTS" in "all") build_openal - build_dxvk build_wine64 build_wine32 + build_dxvk build_lsteamclient64 build_lsteamclient32 build_vrclient64 @@ -659,8 +712,8 @@ if [ "$PACKAGE" = true ]; then WINEPREFIX="$TOP"/build/dist/share/default_pfx/ $RUNTIME_RUNSH ./build/dist/bin/wine64 wineboot WINEPREFIX="$TOP"/build/dist/share/default_pfx/ $RUNTIME_RUNSH ./build/dist/bin/wineserver -w - cp -a openvr/bin/win32/openvr_api.dll "$TOP"/build/dist/lib/wine/dxvk/openvr_api_dxvk.dll - cp -a openvr/bin/win64/openvr_api.dll "$TOP"/build/dist/lib64/wine/dxvk/openvr_api_dxvk.dll + cp -a openvr/bin/linux32/libopenvr_api.so "$TOP"/build/dist/lib/libopenvr_api_dxvk.so + cp -a openvr/bin/linux64/libopenvr_api.so "$TOP"/build/dist/lib64/libopenvr_api_dxvk.so setup_wine_gecko "2.47" "x86" setup_wine_gecko "2.47" "x86_64" diff --git a/dxvk b/dxvk index a3e75bf2..d3c41c1f 160000 --- a/dxvk +++ b/dxvk @@ -1 +1 @@ -Subproject commit a3e75bf2a9556653bc2f0d3f51fa6af578ee0d92 +Subproject commit d3c41c1fc93af58763400e0b7a0ccd6c5e7a0c26 diff --git a/proton.in b/proton.in index 4b47daa8..5d75009c 100755 --- a/proton.in +++ b/proton.in @@ -48,6 +48,32 @@ def upgrade_pfx(old_ver): log("Detected broken 64-bit-only installation, re-creating prefix.") shutil.rmtree(prefix) + if old_proton_ver == "3.7": + #proton 3.7 used symlinks to install DXVK. this is no longer needed, + #restore to correct wine configuration + log("Fixing up d3d11 symlinks") + + #64-bit + link_dir = prefix + "drive_c/windows/system32" + dll_dir = basedir + "/dist/lib64/wine/fakedlls" + if os.path.lexists(link_dir + "/d3d11.dll"): + os.remove(link_dir + "/d3d11.dll") + if os.path.lexists(link_dir + "/dxgi.dll"): + os.remove(link_dir + "/dxgi.dll") + shutil.copy(dll_dir + "/d3d11.dll", link_dir + "/d3d11.dll") + shutil.copy(dll_dir + "/dxgi.dll", link_dir + "/dxgi.dll") + + #32-bit + link_dir = prefix + "drive_c/windows/syswow64" + dll_dir = basedir + "/dist/lib/wine/fakedlls" + if os.path.lexists(link_dir + "/d3d11.dll"): + os.remove(link_dir + "/d3d11.dll") + if os.path.lexists(link_dir + "/dxgi.dll"): + os.remove(link_dir + "/dxgi.dll") + shutil.copy(dll_dir + "/d3d11.dll", link_dir + "/d3d11.dll") + shutil.copy(dll_dir + "/dxgi.dll", link_dir + "/dxgi.dll") + + def run_wine(args): subprocess.call(args, env=env, stderr=lfile) @@ -167,6 +193,11 @@ check_environment("PROTON_NO_ESYNC", "noesync") if not "noesync" in config_opts: env["WINEESYNC"] = "1" +if "wined3d11" in config_opts: + env["WINEDLLPATH"] = lib64dir + "/wine/wined3d:" + libdir + "/wine/wined3d:" + env["WINEDLLPATH"] +else: + env["WINEDLLPATH"] = lib64dir + "/wine/dxvk:" + libdir + "/wine/dxvk:" + env["WINEDLLPATH"] + lfile = None if "SteamGameId" in env: if env["WINEDEBUG"] != "-all": @@ -221,9 +252,6 @@ with prefix_lock: shutil.copy(basedir + "/dist/lib/wine/fakedlls/vrclient.dll", dst) shutil.copy(basedir + "/dist/lib64/wine/fakedlls/vrclient_x64.dll", dst) - shutil.copy(basedir + "/dist/lib/wine/dxvk/openvr_api_dxvk.dll", prefix + "/drive_c/windows/syswow64/") - shutil.copy(basedir + "/dist/lib64/wine/dxvk/openvr_api_dxvk.dll", prefix + "/drive_c/windows/system32/") - #parse linux openvr config and present it in win32 format to the app. #logic from openvr's CVRPathRegistry_Public::GetPaths @@ -297,29 +325,6 @@ with prefix_lock: except: log("Unable to write VR config! " + str(sys.exc_info()[1])) - def make_dxvk_links(dll_dir, link_dir): - if os.path.lexists(link_dir + "/d3d11.dll"): - os.remove(link_dir + "/d3d11.dll") - if os.path.lexists(link_dir + "/dxgi.dll"): - os.remove(link_dir + "/dxgi.dll") - os.symlink(dll_dir + "/d3d11.dll", link_dir + "/d3d11.dll") - os.symlink(dll_dir + "/dxgi.dll", link_dir + "/dxgi.dll") - - if "wined3d11" in config_opts: - #use gl-based wined3d for d3d11 - make_dxvk_links(basedir + "/dist/lib64/wine/", - prefix + "drive_c/windows/system32") - make_dxvk_links(basedir + "/dist/lib/wine/", - prefix + "drive_c/windows/syswow64") - else: - #use vulkan-based dxvk for d3d11 - make_dxvk_links(basedir + "/dist/lib64/wine/dxvk/", - prefix + "drive_c/windows/system32") - make_dxvk_links(basedir + "/dist/lib/wine/dxvk/", - prefix + "drive_c/windows/syswow64") - dlloverrides["dxgi"] = "n" - dlloverrides["d3d11"] = "n" - if "nod3d11" in config_opts: dlloverrides["d3d11"] = "" if "dxgi" in dlloverrides: diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index 0fc03b09..dc46e7cf 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -650,10 +650,6 @@ static EVRCompositorError ivrcompositor_submit_dxvk( load_vk_unwrappers(); vkdata.m_nImage = (uint64_t)image_handle; - vkdata.m_pDevice = get_native_VkDevice(vkdata.m_pDevice); - vkdata.m_pPhysicalDevice = get_native_VkPhysicalDevice(vkdata.m_pPhysicalDevice); - vkdata.m_pInstance = get_native_VkInstance(vkdata.m_pInstance); - vkdata.m_pQueue = get_native_VkQueue(vkdata.m_pQueue); vkdata.m_nWidth = image_info.extent.width; vkdata.m_nHeight = image_info.extent.height; vkdata.m_nFormat = image_info.format;