Skip to content

Commit

Permalink
Use patched DXVK
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Apr 13, 2024
1 parent 450ce47 commit 1e14844
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ jobs:
pushd ${{ env.BUILDROOT }}/wine32on64
make install-lib DESTDIR="$GITHUB_WORKSPACE/${{ env.WINE_INSTALLROOT }}"
popd
- name: Install DXVK
run: |
DXVK_URL=$(curl -s https://api.github.com/repos/Gcenx/DXVK-MacOS/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("dxvk-macOS")) | .browser_download_url')
curl -L -o dxvk.tar.gz $DXVK_URL
tar -xzf dxvk.tar.gz --strip-components=1
rm dxvk.tar.gz
- name: Grab Verbs From Winetricks
run: |
Expand All @@ -200,9 +193,7 @@ jobs:
cp -a $(brew --prefix winetricks)/bin/winetricks Libraries
cp -a verbs.txt Libraries
cp -a x32 Libraries/DXVK
cp -a x64 Libraries/DXVK
cp -a DXVK Libraries
- name: Copy External Libs
run: |
Expand Down
Binary file added DXVK/x32/d3d10core.dll
Binary file not shown.
Binary file added DXVK/x32/d3d11.dll
Binary file not shown.
Binary file added DXVK/x32/d3d9.dll
Binary file not shown.
Binary file added DXVK/x32/dxgi.dll
Binary file not shown.
Binary file added DXVK/x64/d3d10core.dll
Binary file not shown.
Binary file added DXVK/x64/d3d11.dll
Binary file not shown.
Binary file added DXVK/x64/d3d9.dll
Binary file not shown.
Binary file added DXVK/x64/dxgi.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion WhiskyWineVersion.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>minor</key>
<integer>1</integer>
<key>patch</key>
<integer>2</integer>
<integer>3</integer>
<key>preRelease</key>
<string></string>
</dict>
Expand Down

8 comments on commit 1e14844

@Gcenx
Copy link

@Gcenx Gcenx commented on 1e14844 Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to include d3d9.dll when it doesn’t work.

@101arrowz
Copy link

@101arrowz 101arrowz commented on 1e14844 Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IsaacMarovitz How were these DLLs created? They don't seem to be the same as @Gcenx's DXVK-MacOS.

EDIT: Seems like only dxgi.dll differs. However, this install works for my CrossOver build while DXVK-MacOS does not. Could you explain what you changed?

@Gcenx
Copy link

@Gcenx Gcenx commented on 1e14844 Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@101arrowz these were provided by me to Isaac via Discord.

While DXVK-macOS provides dxgi dlls there’s no point in using them as DXVK dxgi dlls are mostly useless on macOS.

@101arrowz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info. I would like to know how to modify DXVK-macOS so I could build these DLLs myself, if Isaac is able to share.

@Gcenx
Copy link

@Gcenx Gcenx commented on 1e14844 Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@101arrowz again these dxgi dlls are not required outside of WhiskyWine.

Simply instal DXVK-macOS d3d10core.dll & d3d11.dll into place and set them as native,builtin, do not install DXVK-macOS dxgi.dll as its useless on macOS.

@101arrowz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually building CrossOver 24 from source with GPTk patches (i.e. using Wine 9.0). I tried to test out using DXVK instead of GPTk for the Direct3D libraries but found that DXVK-macOS did not work, because Wine's built-in dxgi.dll and even the GPTk dxgi.dll did not work. Only these DLLs worked, which from some basic RE seems to be because they actually pull in wined3d's dxgi sources and conditionally use wined3d instead of DXVK for the initialization. I am trying to find out how specifically this is done so I can reproduce this from scratch.

@Gcenx
Copy link

@Gcenx Gcenx commented on 1e14844 Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually building CrossOver 24 from source with GPTk patches (i.e. using Wine 9.0).

You're not really building CrossOver-24 just it's wine, theres a number of reasons to not move onto this version at this time as it contains a critical bug.

CrossOver-23.5.0 and later use CodeWeavers own hooks for Apples D3DMetal not Apples GTPK patches.

If you simply wanted to use wine-9.0 with D3DMetal that's already possible with the official winehq macOS packages installed via brew.

I tried to test out using DXVK instead of GPTk for the Direct3D libraries but found that DXVK-macOS did not work, because Wine's built-in dxgi.dll and even the GPTk dxgi.dll did not work. Only these DLLs worked, which from some basic RE seems to be because they actually pull in wined3d's dxgi sources and conditionally use wined3d instead of DXVK for the initialization. I am trying to find out how specifically this is done so I can reproduce this from scratch.

Apple stub dxgi.dll isn't compatible with DXVK, WineD3D nor VKD3D.
DXVK actual dxgi.dll isn't really compatible with macOS so wines dxgi.dll is necessary outside of Apple D3DMetal, that's why directly applying D3DMetal onto wine is the wrong way.

The provided dxgi.dll are simply wine-7.7 dxgi.dll compiled for the mingw target.

@101arrowz
Copy link

@101arrowz 101arrowz commented on 1e14844 Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you simply wanted to use wine-9.0 with D3DMetal that's already possible with the official winehq macOS packages installed via brew.

I was hoping to use Steam etc. which don't work without CX patches. I could just use Whisky but I figured this would be more fun, plus I could try out Wine's WOW64 mode.

CrossOver-23.5.0 and later use CodeWeavers own hooks for Apples D3DMetal not Apples GTPK patches.

Yeah, I discovered that the hard way earlier. I did manage to get it to launch some D3D11 titles by setting the CX-hack environment variables properly.

The provided dxgi.dll are simply wine-7.7 dxgi.dll compiled for the mingw target.

This is surprising, I'm not sure why the dxgi.dll files I compiled aren't working then. I'll investigate this further and report back. (Is there a more convenient place to discuss this?)

Thank you very much for the information by the way!

EDIT: finally figured this out! Apparently you can't have D3DMetal patched in and DXVK installed in the guest OS. I thought I could configure which was enabled via WINEDLLOVERRIDES, but apparently I can only have one of them even visible to CrossOver wine at any given time, probably due to the fact D3DMetal screws with other things.

EDIT 2: I was wrong the first time: you actually can do exactly what I wanted, but you need to make Wine think that its dxgi.dll is not native and then put it into the guest OS. I had to replace the "signature" in [0x40, 0x60) within the file for that to work. If Wine sees that a DLL is signed as a Wine DLL, it will try to load it from the builtin file (i.e. D3DMetal's dxgi.dll) regardless of the configuration you set with WINEDLLOVERRIDES.

Please sign in to comment.