proton: Use DXVK by default, add PROTON_USE_WINED3D11 switch

This commit is contained in:
Andrew Eikum 2018-05-17 16:37:43 -05:00
parent 417831eeca
commit 3e05e9bb1a
2 changed files with 27 additions and 19 deletions

View File

@ -133,17 +133,18 @@ submodule and directory for details.
----
Runtime Config Options
----
Proton can be tuned at runtime to help certain games run. Options can either
be defined in a comma-separated list stored in the <tt>STEAM_COMPAT_CONFIG</tt>
environment variable when running Proton (the Steam client does this),
or passed through the presence of individual environment variables as documented below.
Proton can be tuned at runtime to help certain games run. The Steam client sets
some options for known games using the <tt>STEAM_COMPAT_CONFIG</tt> variable.
You can override these options using the environment variables described below.
To enable an option, set the variable to a non-<tt>0</tt> value. To disable an
option, set the variable to <tt>0</tt>.
All of the below are runtime options. They do not effect permanent changes to
the Wine prefix. Removing the option will revert to the previous behavior.
| Compat config string | Environment Variable | Description |
| :-------------------- | :----------------------------- | :----------- |
| <tt>dxvk</tt> | <tt>PROTON_USE_DXVK</tt> | Run the game with DXVK instead of wined3d. |
| <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>wined3d11</tt> | <tt>PROTON_USE_WINED3D11</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11. |
| <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. |
<!-- Target: GitHub Flavor Markdown. To test locally: pandoc -f markdown_github -t html README.md -->

33
proton
View File

@ -50,16 +50,21 @@ if not ("STEAM_COMPAT_DATA_PATH" in os.environ):
log("No compat data path?")
sys.exit(1)
def check_environment(env_name, config_name):
if not env_name in os.environ:
return
if os.environ[env_name] == "0" or len(os.environ[env_name]) == 0:
config_opts.remove(config_name)
else:
config_opts.add(config_name)
if "STEAM_COMPAT_CONFIG" in os.environ:
config_opts = os.environ["STEAM_COMPAT_CONFIG"].split(",")
config_opts = set(os.environ["STEAM_COMPAT_CONFIG"].split(","))
else:
config_opts = []
config_opts = set()
if "PROTON_USE_DXVK" in os.environ:
config_opts.append("dxvk")
if "PROTON_NO_D3D11" in os.environ:
config_opts.append("nod3d11")
check_environment("PROTON_USE_WINED3D11", "wined3d11")
check_environment("PROTON_NO_D3D11", "nod3d11")
basedir = os.path.dirname(sys.argv[0])
bindir = basedir + "/dist/bin/"
@ -245,18 +250,20 @@ with prefix_lock:
os.symlink(dll_dir + "/d3d11.dll", link_dir + "/d3d11.dll")
os.symlink(dll_dir + "/dxgi.dll", link_dir + "/dxgi.dll")
if "dxvk" in config_opts:
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"
else:
make_dxvk_links(basedir + "/dist/lib64/wine/",
prefix + "drive_c/windows/system32")
make_dxvk_links(basedir + "/dist/lib/wine/",
prefix + "drive_c/windows/syswow64")
if "nod3d11" in config_opts:
dlloverrides["d3d11"] = ""