proton: Use DXVK for d3d10 as well.

This commit is contained in:
Andrew Eikum 2018-10-15 11:40:33 -05:00
parent f7ea4cb866
commit e5f38f9f4c
4 changed files with 28 additions and 16 deletions

View File

@ -181,7 +181,7 @@ the Wine prefix. Removing the option will revert to the previous behavior.
| | <tt>PROTON_LOG</tt> | Convenience method for dumping a useful debug log to `$HOME/steam-$APPID.log`. For more thorough logging, use `user_settings.py`. |
| | <tt>PROTON_DUMP_DEBUG_COMMANDS</tt> | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. |
| | <tt>PROTON_DEBUG_DIR<tt> | Root directory for the Proton debug scripts, `/tmp` by default. |
| <tt>wined3d11</tt> | <tt>PROTON_USE_WINED3D11</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11. |
| <tt>wined3d</tt> | <tt>PROTON_USE_WINED3D</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11 and d3d10. This used to be called `PROTON_USE_WINED3D11`, which is now an alias for this same option. |
| <tt>nod3d11</tt> | <tt>PROTON_NO_D3D11</tt> | Disable <tt>d3d11.dll</tt>, for games which can fall back to and run better with d3d9. |
| <tt>noesync</tt> | <tt>PROTON_NO_ESYNC</tt> | Do not use eventfd-based in-process synchronization primitives. |

View File

@ -871,6 +871,9 @@ dxvk64: $(DXVK_CONFIGURE_FILES64)
mkdir -p "$(DST_DIR)/lib64/wine/dxvk"
cp "$(DXVK_OBJ64)"/bin/dxgi.dll "$(DST_DIR)"/lib64/wine/dxvk
cp "$(DXVK_OBJ64)"/bin/d3d11.dll "$(DST_DIR)"/lib64/wine/dxvk
cp "$(DXVK_OBJ64)"/bin/d3d10.dll "$(DST_DIR)"/lib64/wine/dxvk
cp "$(DXVK_OBJ64)"/bin/d3d10_1.dll "$(DST_DIR)"/lib64/wine/dxvk
cp "$(DXVK_OBJ64)"/bin/d3d10core.dll "$(DST_DIR)"/lib64/wine/dxvk
( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib64/wine/dxvk/version
@ -882,6 +885,9 @@ dxvk32: $(DXVK_CONFIGURE_FILES32)
mkdir -p "$(DST_DIR)"/lib/wine/dxvk
cp "$(DXVK_OBJ32)"/bin/dxgi.dll "$(DST_DIR)"/lib/wine/dxvk/
cp "$(DXVK_OBJ32)"/bin/d3d11.dll "$(DST_DIR)"/lib/wine/dxvk/
cp "$(DXVK_OBJ32)"/bin/d3d10.dll "$(DST_DIR)"/lib/wine/dxvk/
cp "$(DXVK_OBJ32)"/bin/d3d10_1.dll "$(DST_DIR)"/lib/wine/dxvk/
cp "$(DXVK_OBJ32)"/bin/d3d10core.dll "$(DST_DIR)"/lib/wine/dxvk/
( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib/wine/dxvk/version
endif # NO_DXVK

32
proton
View File

@ -188,18 +188,23 @@ if os.path.exists(basedir + "/user_settings.py"):
def check_environment(env_name, config_name):
if not env_name in env:
return
return False
if env[env_name] == "0" or len(env[env_name]) == 0:
config_opts.discard(config_name)
else:
config_opts.add(config_name)
return True
if "STEAM_COMPAT_CONFIG" in os.environ:
config_opts = set(os.environ["STEAM_COMPAT_CONFIG"].split(","))
else:
config_opts = set()
check_environment("PROTON_USE_WINED3D11", "wined3d11")
if "wined3d11" in config_opts:
config_opts.add("wined3d")
if not check_environment("PROTON_USE_WINED3D", "wined3d"):
check_environment("PROTON_USE_WINED3D11", "wined3d")
check_environment("PROTON_NO_D3D11", "nod3d11")
check_environment("PROTON_NO_ESYNC", "noesync")
@ -335,28 +340,29 @@ with prefix_lock:
except (ValueError, OSError):
log("Unable to write VR config! " + str(sys.exc_info()[1]))
dxvkfiles = ("d3d11", "d3d10", "d3d10core", "d3d10_1", "dxgi")
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")
for f in dxvkfiles:
dst = link_dir + "/" + f + ".dll"
src = dll_dir + "/" + f + ".dll"
if os.path.lexists(dst):
os.remove(dst)
os.symlink(src, dst)
if "wined3d11" in config_opts:
#use gl-based wined3d for d3d11
if "wined3d" in config_opts:
#use gl-based wined3d for d3d11 and d3d10
make_dxvk_links(basedir + "/dist/lib64/wine/fakedlls/",
prefix + "drive_c/windows/system32")
make_dxvk_links(basedir + "/dist/lib/wine/fakedlls/",
prefix + "drive_c/windows/syswow64")
else:
#use vulkan-based dxvk for d3d11
#use vulkan-based dxvk for d3d11 and d3d10
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"
for f in dxvkfiles:
dlloverrides[f] = "n"
if "nod3d11" in config_opts:
dlloverrides["d3d11"] = ""

View File

@ -9,8 +9,8 @@ user_settings = {
#Enable DXVK's HUD
# "DXVK_HUD": "devinfo,fps",
#Use wined3d for d3d11 instead of dxvk
# "PROTON_USE_WINED3D11": "1",
#Use gl-based wined3d for d3d11 and d3d10 instead of vulkan-based dxvk
# "PROTON_USE_WINED3D": "1",
#Disable d3d11 entirely
# "PROTON_NO_D3D11": "1",