build and ship d9vk

This commit is contained in:
Andrew Eikum 2019-06-18 10:01:06 -05:00
parent 22354ec32f
commit f52ecfc6a7
6 changed files with 75 additions and 3 deletions

3
.gitmodules vendored
View file

@ -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/

View file

@ -259,6 +259,7 @@ the Wine prefix. Removing the option will revert to the previous behavior.
| | <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>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>d9vk</tt> | <tt>PROTON_USE_D9VK</tt> | Use Vulkan-based d9vk instead of OpenGL-based wined3d for d3d9. |
| <tt>nod3d11</tt> | <tt>PROTON_NO_D3D11</tt> | Disable <tt>d3d11.dll</tt>, for d3d11 games which can fall back to and run better with d3d9. |
| <tt>nod3d10</tt> | <tt>PROTON_NO_D3D10</tt> | Disable <tt>d3d10.dll</tt> and <tt>dxgi.dll</tt>, for d3d10 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

@ -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

1
d9vk Submodule

@ -0,0 +1 @@
Subproject commit 10e386a0ffe13b85a1bb62ad96847b6409134469

7
proton
View file

@ -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,6 +463,10 @@ with prefix_lock:
make_dxvk_links(basedir + "/dist/lib/wine/dxvk/",
prefix + "drive_c/windows/syswow64")
for f in dxvkfiles:
if f == "d3d9":
if "d9vk" in config_opts:
dlloverrides[f] = "n"
else:
dlloverrides[f] = "n"
if "nod3d11" in config_opts:

View file

@ -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",