diff --git a/.gitmodules b/.gitmodules
index 2fb73aad..3628f250 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -19,3 +19,6 @@
[submodule "FAudio"]
path = FAudio
url = https://github.com/FNA-XNA/FAudio/
+[submodule "d9vk"]
+ path = d9vk
+ url = https://github.com/ValveSoftware/dxvk/
diff --git a/README.md b/README.md
index 20fd531d..a98d5aa0 100644
--- a/README.md
+++ b/README.md
@@ -259,6 +259,7 @@ the Wine prefix. Removing the option will revert to the previous behavior.
| | PROTON_DUMP_DEBUG_COMMANDS | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. |
| | PROTON_DEBUG_DIR | Root directory for the Proton debug scripts, `/tmp` by default. |
| wined3d | PROTON_USE_WINED3D | 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. |
+| d9vk | PROTON_USE_D9VK | Use Vulkan-based d9vk instead of OpenGL-based wined3d for d3d9. |
| nod3d11 | PROTON_NO_D3D11 | Disable d3d11.dll, for d3d11 games which can fall back to and run better with d3d9. |
| nod3d10 | PROTON_NO_D3D10 | Disable d3d10.dll and dxgi.dll, for d3d10 games which can fall back to and run better with d3d9. |
| noesync | PROTON_NO_ESYNC | Do not use eventfd-based in-process synchronization primitives. |
diff --git a/build/makefile_base.mak b/build/makefile_base.mak
index c3388391..6f0bc91c 100644
--- a/build/makefile_base.mak
+++ b/build/makefile_base.mak
@@ -228,6 +228,10 @@ DXVK := $(SRCDIR)/dxvk
DXVK_OBJ32 := ./obj-dxvk32
DXVK_OBJ64 := ./obj-dxvk64
+D9VK := $(SRCDIR)/d9vk
+D9VK_OBJ32 := ./obj-d9vk32
+D9VK_OBJ64 := ./obj-d9vk64
+
CMAKE := $(SRCDIR)/cmake
CMAKE_OBJ32 := ./obj-cmake32
CMAKE_OBJ64 := ./obj-cmake64
@@ -246,6 +250,7 @@ OBJ_DIRS := $(TOOLS_DIR32) $(TOOLS_DIR64) \
$(WINE_OBJ32) $(WINE_OBJ64) \
$(VRCLIENT_OBJ32) $(VRCLIENT_OBJ64) \
$(DXVK_OBJ32) $(DXVK_OBJ64) \
+ $(D9VK_OBJ32) $(D9VK_OBJ64) \
$(CMAKE_OBJ32) $(CMAKE_OBJ64)
$(OBJ_DIRS):
@@ -366,7 +371,7 @@ $(DIST_FONTS): fonts
ALL_TARGETS += dist
GOAL_TARGETS += dist
-dist: $(DIST_TARGETS) wine vrclient lsteamclient steam dxvk | $(DST_DIR)
+dist: $(DIST_TARGETS) wine vrclient lsteamclient steam dxvk d9vk | $(DST_DIR)
echo `date '+%s'` `GIT_DIR=$(abspath $(SRCDIR)/.git) git describe --tags` > $(DIST_VERSION)
cp $(DIST_VERSION) $(DST_BASE)/
rm -rf $(abspath $(DIST_PREFIX)) && \
@@ -1038,6 +1043,60 @@ dxvk32: $(DXVK_CONFIGURE_FILES32)
cp "$(DXVK_OBJ32)"/bin/d3d10core.dll "$(DST_DIR)"/lib/wine/dxvk/
if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib/wine/dxvk/version; fi
+D9VK_CONFIGURE_FILES32 := $(D9VK_OBJ32)/build.ninja
+D9VK_CONFIGURE_FILES64 := $(D9VK_OBJ64)/build.ninja
+
+# 64bit-configure. Remove coredata file if already configured (due to e.g. makefile changing)
+# sed is used to sub in our special cross compiler
+$(D9VK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(D9VK)/build-win64.txt | $(D9VK_OBJ64)
+ if [ -e "$(abspath $(D9VK_OBJ64))"/build.ninja ]; then \
+ rm -f "$(abspath $(D9VK_OBJ64))"/meson-private/coredata.dat; \
+ fi
+ cd "$(abspath $(D9VK))" && \
+ sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win64.txt > "$(abspath $(D9VK_OBJ64))/proton-build-win64.txt" && \
+ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
+ meson --prefix="$(abspath $(D9VK_OBJ64))" --cross-file "$(abspath $(D9VK_OBJ64))/proton-build-win64.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ64))"
+
+# 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing)
+# sed is used to sub in our special cross compiler
+$(D9VK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(D9VK)/build-win32.txt | $(D9VK_OBJ32)
+ if [ -e "$(abspath $(D9VK_OBJ32))"/build.ninja ]; then \
+ rm -f "$(abspath $(D9VK_OBJ32))"/meson-private/coredata.dat; \
+ fi
+ cd "$(abspath $(D9VK))" && \
+ sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win32.txt > "$(abspath $(D9VK_OBJ32))/proton-build-win32.txt" && \
+ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
+ meson --prefix="$(abspath $(D9VK_OBJ32))" --cross-file "$(abspath $(D9VK_OBJ32))/proton-build-win32.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ32))"
+
+## d9vk goals
+D9VK_TARGETS = d9vk d9vk_configure d9vk32 d9vk64 d9vk_configure32 d9vk_configure64
+
+ALL_TARGETS += $(D9VK_TARGETS)
+GOAL_TARGETS_LIBS += d9vk
+
+.PHONY: $(D9VK_TARGETS)
+
+d9vk_configure: $(D9VK_CONFIGURE_FILES32) $(D9VK_CONFIGURE_FILES64)
+
+d9vk_configure64: $(D9VK_CONFIGURE_FILES64)
+
+d9vk_configure32: $(D9VK_CONFIGURE_FILES32)
+
+d9vk: d9vk32 d9vk64
+
+d9vk64: $(D9VK_CONFIGURE_FILES64)
+ env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(D9VK_OBJ64)" install
+ mkdir -p "$(DST_DIR)/lib64/wine/dxvk"
+ cp "$(D9VK_OBJ64)"/bin/d3d9.dll "$(DST_DIR)"/lib64/wine/dxvk
+ if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- d9vk ) > "$(DST_DIR)"/lib64/wine/dxvk/d9vk_version; fi
+
+
+d9vk32: $(D9VK_CONFIGURE_FILES32)
+ env PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" ninja -C "$(D9VK_OBJ32)" install
+ mkdir -p "$(DST_DIR)"/lib/wine/dxvk
+ cp "$(D9VK_OBJ32)"/bin/d3d9.dll "$(DST_DIR)"/lib/wine/dxvk/
+ if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- d9vk ) > "$(DST_DIR)"/lib/wine/dxvk/d9vk_version; fi
+
endif # NO_DXVK
# TODO Tests
diff --git a/d9vk b/d9vk
new file mode 160000
index 00000000..10e386a0
--- /dev/null
+++ b/d9vk
@@ -0,0 +1 @@
+Subproject commit 10e386a0ffe13b85a1bb62ad96847b6409134469
diff --git a/proton b/proton
index 935c32e0..bc49cdd2 100755
--- a/proton
+++ b/proton
@@ -263,6 +263,7 @@ if "wined3d11" in config_opts:
if not check_environment("PROTON_USE_WINED3D", "wined3d"):
check_environment("PROTON_USE_WINED3D11", "wined3d")
+check_environment("PROTON_USE_D9VK", "d9vk")
check_environment("PROTON_NO_D3D11", "nod3d11")
check_environment("PROTON_NO_D3D10", "nod3d10")
check_environment("PROTON_NO_ESYNC", "noesync")
@@ -440,7 +441,7 @@ with prefix_lock:
except (ValueError, OSError):
log("Unable to write VR config! " + str(sys.exc_info()[1]))
- dxvkfiles = ("d3d11", "d3d10", "d3d10core", "d3d10_1", "dxgi")
+ dxvkfiles = ("d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9", "dxgi")
def make_dxvk_links(dll_dir, link_dir):
for f in dxvkfiles:
dst = link_dir + "/" + f + ".dll"
@@ -462,7 +463,11 @@ with prefix_lock:
make_dxvk_links(basedir + "/dist/lib/wine/dxvk/",
prefix + "drive_c/windows/syswow64")
for f in dxvkfiles:
- dlloverrides[f] = "n"
+ if f == "d3d9":
+ if "d9vk" in config_opts:
+ dlloverrides[f] = "n"
+ else:
+ dlloverrides[f] = "n"
if "nod3d11" in config_opts:
dlloverrides["d3d11"] = ""
diff --git a/user_settings.sample.py b/user_settings.sample.py
index 355704d1..58dc649e 100755
--- a/user_settings.sample.py
+++ b/user_settings.sample.py
@@ -21,6 +21,9 @@ user_settings = {
#Use OpenGL-based wined3d for d3d11 and d3d10 instead of Vulkan-based DXVK
# "PROTON_USE_WINED3D": "1",
+ #Use Vulkan-based D9VK instead of OpenGL-based wined3d for d3d9.
+# "PROTON_USE_D9VK": "1",
+
#Disable d3d11 entirely
# "PROTON_NO_D3D11": "1",