Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vkd3d: Only disable raster based on SO stream if SO is used. #767

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

K0bin
Copy link
Contributor

@K0bin K0bin commented Aug 14, 2021

Diablo 2 Resurrected creates all graphics pipeline with RasterizedStream = D3D12_SO_NO_RASTERIZED_STREAM.
This makes VKD3D-Proton disable rasterization, resulting in a black screen for that game.

Fixes #625

Props to DadSchoorse for pointing me at rasterizerDiscardEnable.

I've modified vkd3d gears to set RasterizedStream = D3D12_SO_NO_RASTERIZED_STREAM and it still rendered on Windows, so I assume it's ignored if the number of SO entries is 0. I don't know how stream output works (besides a super barebones understanding of it) so I'm not sure if that's the correct solution. As usual, the Microsoft docs aren't exactly in-depth about it.
It's certainly better than the current behavior though.

Signed-off-by: Robin Kertels <robin.kertels@gmail.com>
@catrielmuller
Copy link

@K0bin , I tested you branch and doesn't work on my end. Same behavior, all screen black however the mouse pointer it's rendered correctly.

Log: https://gist.github.com/catrielmuller/92dc2860d02597a4c2823c9306a1b7d0

LMK if I can help you to test another thing.

@K0bin
Copy link
Contributor Author

K0bin commented Aug 14, 2021

Are you sure you installed it correctly? Other people have confirmed that it works.

@catrielmuller
Copy link

@K0bin Sorry, was my bad, Lutris override the Libs when you change the config, I created a new DXVK forlder to use from there and now the Issue gone. I will test the rest of the game. Thanks

@3331
Copy link

3331 commented Aug 14, 2021

Game started and is running perfectly fine so far.

@AlexBurdu
Copy link

How can someone not familiar with these frameworks make use of the fix to play d2 resurrected?

@K0bin
Copy link
Contributor Author

K0bin commented Aug 14, 2021

@AlexBurdu Download the build here: https://github.com/HansKristian-Work/vkd3d-proton/actions/runs/1130860939 and install that into your Wine prefix using the setup script.

@AlexBurdu
Copy link

Many thanks! (I've been struggling a bit with compiling the project and all its dependencies for the past hour or so)

@catrielmuller
Copy link

@K0bin have some frame drops, however it's working now, Thanks

https://youtu.be/QWHtH4y9pjk

@K0bin
Copy link
Contributor Author

K0bin commented Aug 14, 2021

That's just a sound issue, isnt it? The frame time graph looks pretty good, no major spikes there.

If you do have some graphics related stutter, it's most likely caused by the game itself and also happens on Windows.

@AlexBurdu
Copy link

I'm also using Lutris and indeed it overrides the files with some symlinks. I went ahead and placed the files in Lutris' dir ~/.local/share/lutris/runtime/dxvk/v1.9.1L/

I'm now able to start the game and see the menus, but the image in the game is covered by a dark layer (don't know how to describe it better)

image

@AlexBurdu
Copy link

I encounter the same dark layer bug when selecting the character also

@K0bin
Copy link
Contributor Author

K0bin commented Aug 14, 2021

First of all, make sure your GPU drivers are up to date. It seems to work fine for most people.

I dont think that will be fixed before the game is publicly available. I personally can't fix it because the apitrace someone uploaded freezes my system. (Might be the memory leak in Nvidia drivers)

@AlexBurdu
Copy link

I have Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-65-generic, LLVM 12.0.0) (0x67df)

@K0bin
Copy link
Contributor Author

K0bin commented Aug 14, 2021

And what Radv/Mesa version are you using?

@kdwinter
Copy link

Same problem for me with RADV on an AMD Radeon RX 6700 XT (NAVY_FLOUNDER, DRM 3.41.0, 5.13.7-zen1-1-zen, LLVM 12.0.1). Mesa 21.1.6-1

@AlexBurdu
Copy link

Mesa 21.0.3 here

@MrStorm1988
Copy link

Confirmed for AlexBurdu. I am have dark layer when selected character. RX580. Mesa 21.1.6. Manjaro.

@vegegoku
Copy link

Anyone has the exact steps to fix this with lutris?

@kuunha
Copy link

kuunha commented Aug 14, 2021

This fix the dark lines on my machine

export RADV_DEBUG=nohiz

Screenshot_20210814_182735

AMD 5700X
Mesa 21.1.6
KDE/Wayland
Opensuse Tumbleweed

@AlexBurdu
Copy link

AlexBurdu commented Aug 14, 2021

I can confirm setting envir variable RADV_DEBUG=nohiz in lutris fixes this, but entering the game causes it to crash

@stonebuckl
Copy link

stonebuckl commented Aug 14, 2021

Confirmed fixed (dll + RADV_DEBUG=nohiz for graphical glitches) on Arch Linux, AMD Radeon RX 6900 XT, mesa 21.1.6.
I cannot express how grateful I am for this! (As a bare minimum I named my first character Kobin)

@vegegoku
Copy link

vegegoku commented Aug 14, 2021

I still cant apply the fix on lutris ... I downloaded the build and executed setup_vkd3d_proton.sh install but how do I make lutris pick this version ..
When I copy the files over the dir ~/.local/share/lutris/runtime/dxvk/v1.9.1L/ then when I start the game instead of sound/balck screen the game crash

@MrStorm1988
Copy link

This fix the dark lines on my machine

export RADV_DEBUG=nohiz

Screenshot_20210814_182735

AMD 5700X
Mesa 21.1.6
KDE/Wayland
Opensuse Tumbleweed

Thanks! That's works!

@catrielmuller
Copy link

I still cant apply the fix on lutris ... I downloaded the build and executed setup_vkd3d_proton.sh install but how do I make lutris pick this version ..
When I copy the files over the dire ~/.local/share/lutris/runtime/dxvk/v1.9.1L/ then when I start the game instead of sound/balck screen the game crash

Whats version of mesa are you using?

  • Version: 21.2.0

@stonebuckl
Copy link

I still cant apply the fix on lutris ... I downloaded the build and executed setup_vkd3d_proton.sh install but how do I make lutris pick this version ..
When I copy the files over the dir ~/.local/share/lutris/runtime/dxvk/v1.9.1L/ then when I start the game instead of sound/balck screen the game crash

My suggestion is to do it manually if the script does not work for you. I renamed the original d3d12.dll to d3d12.dll.bak in the folder $WINEPREFIX/drive_c/windows/system32/ (make sure you understand which WINEPREFIX is the correct one for your setup). Then copy the correct (x86/x64) new DLL from the downloaded file to $WINEPREFIX/drive_c/windows/system32/ and update the DLL overrides (crucial step) for d3d12 to native or native then builtin. I don't use lutris myself (Bottles with lutris) and I don't know how to do that last step in lutris. With wine you could do it with WINEPREFIX=./myprefix winecfg.

@vegegoku
Copy link

vegegoku commented Aug 14, 2021

I still cant apply the fix on lutris ... I downloaded the build and executed setup_vkd3d_proton.sh install but how do I make lutris pick this version ..
When I copy the files over the dire ~/.local/share/lutris/runtime/dxvk/v1.9.1L/ then when I start the game instead of sound/balck screen the game crash

Whats version of mesa are you using?

  • Version: 21.2.0

I am on nvidia I think
image

[System]
OS:              Ubuntu 20.04 focal
Arch:            x86_64
Kernel:          5.11.0-25-generic
Desktop:         KDE
Display Server:  x11

[CPU]
Vendor:          GenuineIntel
Model:           Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Physical cores:  4
Logical cores:   8

[Memory]
RAM:             31.3 GB
Swap:            2.0 GB

[Graphics]
Vendor:          NVIDIA Corporation
OpenGL Renderer: Quadro M1000M/PCIe/SSE2
OpenGL Version:  4.6.0 NVIDIA 470.57.02
OpenGL Core:     4.6.0 NVIDIA 470.57.02
OpenGL ES:       OpenGL ES 3.2 NVIDIA 470.57.02
Vulkan:          Supported

> glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro M1000M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 470.57.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 470.57.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 470.57.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

@kleshas
Copy link

kleshas commented Aug 15, 2021

The patch doesn't seem to help with me at all on lutris. Hearthstone and D3 still work under same wineprefix
RX570, arch i3 and sway.
Wine version: lutris-6.13-3-x86_64 (and 6.14 tried), DXVK 1.9.1L (and 1.9L-8b6ac52 tried). esync enabled.

edit: graphics working now. Copied the files as mentioned above, rather than rely on the script. Thanks for the fix :)

@kleshas
Copy link

kleshas commented Aug 15, 2021

I don't use lutris myself (Bottles with lutris) and I don't know how to do that last step in lutris. With wine you could do it with WINEPREFIX=./myprefix winecfg.

In lutris, right click the game, click Wine configuration, go to libraries tab, highlight D3D12 and choose edit to change.

@jerrytt
Copy link

jerrytt commented Aug 15, 2021

I follow the way above : overwrite the d3d12.dll but still got blackscreen ( sound works )
nvidia card.

[jerry@jerry-usb system32]$ ls -l|grep lutri
lrwxrwxrwx 1 jerry jerry      68 Aug 15 13:09 d3d10_1.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d10_1.dll
lrwxrwxrwx 1 jerry jerry      70 Aug 15 13:25 d3d10core.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d10core.dll
lrwxrwxrwx 1 jerry jerry      66 Aug 15 13:09 d3d10.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d10.dll
lrwxrwxrwx 1 jerry jerry      66 Aug 15 13:25 d3d11.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d11.dll
lrwxrwxrwx 1 jerry jerry      66 Aug 15 13:25 d3d12.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d12.dll
lrwxrwxrwx 1 jerry jerry      65 Aug 15 13:25 d3d9.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d9.dll
lrwxrwxrwx 1 jerry jerry      65 Aug 15 13:25 dxgi.dll -> /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/dxgi.dll
[jerry@jerry-usb system32]$ md5sum /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d12.dll
3ebaed48bdf88a4a2a56bd95f3fe74d7  /home/jerry/.local/share/lutris/runtime/dxvk/v1.9.1L/x64/d3d12.dll
fixme:d3d12_command_queue_Wait: Failed to acquire Vulkan semaphore for fence 0x7e04c510, value 0x189, completed value 0x188.
fixme:d3d12_command_queue_Wait: Failed to acquire Vulkan semaphore for fence 0x7e04c510, value 0x18a, completed value 0x189.
0394:fixme:dxgi:dxgi_factory_IsCurrent iface 0x407e50 stub!

@Vibi1
Copy link

Vibi1 commented Aug 15, 2021

This fix the dark lines on my machine

export RADV_DEBUG=nohiz

Screenshot_20210814_182735

AMD 5700X
Mesa 21.1.6
KDE/Wayland
Opensuse Tumbleweed

How do I add this variable? Do I just paste RADV_DEBUG=nohiz and in the value box put 1? A file path? I'm new to this sorry.

@K0bin
Copy link
Contributor Author

K0bin commented Aug 15, 2021

This is a pull request, not a support thread.

It's been confirmed that the PR works and the game is fine except for what is probably a Radv driver bug. Please stop spamming now.

@AlexBurdu
Copy link

You're right about it not being a support thread.
Thanks for taking the time to put up the fix and also answer some of the questions.

I managed to get mine to work also after cleaning up wine, lutris and starting from scratch.
@Vibi1 RADV_DEBUG is the variable name, while nohiz is the value you set for it.

Works for me with lutris-fshack-6.14-3-x86_64 and with setting RADV_DEBUG=nohiz envir variable. See here: https://docs.mesa3d.org/envvars.html#radv-driver-environment-variables

Cheers!

@jerrytt
Copy link

jerrytt commented Aug 15, 2021

Anyone with nvidia card works with this dll(https://github.com/HansKristian-Work/vkd3d-proton/actions/runs/1130860939) ?

Looks it doesn't work on nvidia driver.

Manjaro Linux
vulkan-mesa-layers 21.1.6-1
linux510-nvidia 470.57.02-5

card gtx960m

@Marfjeh
Copy link

Marfjeh commented Aug 15, 2021

The patched DLL file works wonderfully! Many thanks! Only there is some performance issues.

Arch Linux
Vulkan-mesa-layers 21.1.6-1
nvidia 470.57.02
Linux 5.13.8-arch1-1
I did not use any env vars.

image

@K0bin
Copy link
Contributor Author

K0bin commented Aug 15, 2021

Only there is some performance issues.

You'll have to be a bit more specific than that.

@stonebuckl
Copy link

stonebuckl commented Aug 15, 2021

I can confirm that the performance is not ideal but it's also not bad for me. I am running at 40-60 FPS at 4K with highest settings (125% scale) with an AMD RX 5900 XT. There is a lot of input lag but that seems to be the case on Windows as well from what I hear. I am not even sure if the Windows version reaches higher FPS with this setup, I can't find any relevant benchmarks from the current beta.

@Marfjeh
Copy link

Marfjeh commented Aug 16, 2021

Only there is some performance issues.

You'll have to be a bit more specific than that.

I'm not really sure that the performance issues are because of this patch or my setup, i probably shoudn't have it mentioned at all.
as because my setup is not ideal because i cannot run any compositors because i'm running a mixed refresh setup on X11 (60 and a 144hz monitor).

The game is fully playable for me.

But on windows it feels i have more FPS then on wine. i'll report back how many FPS i had if that is enough data. but once again this might be my problematic setup.

more info:
GPU: GTX 1060 6GB.
CPU: Ryzen 5 1600. stock clocks.

@K0bin
Copy link
Contributor Author

K0bin commented Aug 16, 2021

GPU: GTX 1060 6GB.

Not surprising at all. Nvidia Pascal GPUs (GTX 10XX) are known to perform very poorly with vkd3d-proton due to hardware limitations.

@Marfjeh
Copy link

Marfjeh commented Aug 16, 2021

GPU: GTX 1060 6GB.

Not surprising at all. Nvidia Pascal GPUs (GTX 10XX) are known to perform very poorly with vkd3d-proton due to hardware limitations.

Ah i did not know that. Alright well problem solved then. more reasons to upgrade my GPU :P.

@marcosjunqueira
Copy link

Works on
[System]
OS: Pop!_OS 21.04 hirsute
Arch: x86_64
Kernel: 5.11.0-7620-generic
Desktop: pop:GNOME
Display Server: x11

[CPU]
Vendor: GenuineIntel
Model: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Physical cores: 4
Logical cores: 8

[Memory]
RAM: 31.3 GB
Swap: 4.0 GB

[Graphics]
Vendor: NVIDIA Corporation
OpenGL Renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2
OpenGL Version: 4.6.0 NVIDIA 470.57.02
OpenGL Core: 4.6.0 NVIDIA 470.57.02
OpenGL ES: OpenGL ES 3.2 NVIDIA 470.57.02
Vulkan: Supported

Captura de Tela-20210816185833-1944x1071

@K0bin
Copy link
Contributor Author

K0bin commented Aug 17, 2021

I know it works, I dont need anyone else to confirm that.

@marcosjunqueira
Copy link

I know it works, I dont need anyone else to confirm that.

You're welcome!

@hexploder
Copy link

This fix the dark lines on my machine

export RADV_DEBUG=nohiz

AMD 5700X
Mesa 21.1.6
KDE/Wayland
Opensuse Tumbleweed

Going to ask the most dumb question about this sorry for how dumb it is and I'm asking just because I can't check it by my self right now
I have on Lutris the Blizzard Battle.net installed, then from the Battle.net Launcher I installed D2R, after that I override the d2d12.dll as explained no issue with that cause I did it on ~/.local/share/lutris/runtime/dxvk/v1.9.1L (I should have done it on the prefix or backup the originals but whatever it should work), now that RADV_DEBUG=nohiz I put it in the configuration under System options and I add them as an Env variable right?

Now... doing all that to the Battle.net Launcher is going to get transfered to D2R when I put play from the BNet Launcher? or I need to Add another Game and find the D2R executable inside the BNet Launcher prefix? I have done stuff like this to make for example Project D2 work I don't know if I need that here.

Regards and sorry if the question is dumb.

@K0bin
Copy link
Contributor Author

K0bin commented Aug 19, 2021

@hexploder

The Lutris team now ship this PR in the latest VKD3D-Proton version.
https://github.com/lutris/vkd3d/releases/tag/v2.4L-2

No idea how you select that, I don't use Lutris.

@Cesium06
Copy link

Just wanted to pop in and say that this fix is also working for the Quake 1 Remaster that was released on Steam today. Looks and runs perfectly so far for me. If anyone is interested, navigate into your steamapps. Your quake folder has a rerelease folder. Use that .exe in there with this fix and it should resolve it.
Thanks for resolving this issue!

@Galcian79
Copy link

Galcian79 commented Aug 22, 2021

@K0bin Sorry, was my bad, Lutris override the Libs when you change the config, I created a new DXVK forlder to use from there and now the Issue gone. I will test the rest of the game. Thanks

Could you be more specific? I ran the game outside Lutris and still have the issue.

Copy link
Owner

@HansKristian-Work HansKristian-Work left a comment

Choose a reason for hiding this comment

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

Also LGTM

@HansKristian-Work HansKristian-Work merged commit 76f37c3 into HansKristian-Work:master Aug 23, 2021
@K0bin K0bin deleted the disable-raster branch August 23, 2021 11:10
@RezoApio
Copy link

@AlexBurdu Download the build here: https://github.com/HansKristian-Work/vkd3d-proton/actions/runs/1130860939 and install that into your Wine prefix using the setup script.

@K0bin I am not sure how to use the .sh provided. From what I can read of the script you need to run it from the correct path. Is it the Lutris dxvk folder you copy the patch to? or is it the wine prefix created by lutris?
Thanks for your input.

@K0bin
Copy link
Contributor Author

K0bin commented Sep 30, 2021

Lutris ships a version that has the fix by default as far as I know.

@RezoApio
Copy link

RezoApio commented Sep 30, 2021

This is what I have read too but I have still the black screen with only music and hand pointer...
Do not know what troubleshooting I could do... are there any logs I could use?

@Dornicker
Copy link

This is what I have read too but I have still the black screen with only music and hand pointer... Do not know what troubleshooting I could too... are there any logs I could use?

Same for me. NVIDIA GTX 770 with Manjaro 5.14 und lutris-ge-6.16-1 runner.

@dmame2021
Copy link

This is what I have read too but I have still the black screen with only music and hand pointer... Do not know what troubleshooting I could too... are there any logs I could use?

Same for me. NVIDIA GTX 770 with Manjaro 5.14 und lutris-ge-6.16-1 runner.

Same for me. System and drivers are up to date. PopOS, NVIDIA 750ti, and doesn't matter what runner or DXVK that I use. I've tried 1.9.1, 1.9.2, 2.4L-2 and others. The results are always the same... music is fine, black screen, then cursor finally appears.

@sullome
Copy link

sullome commented Oct 6, 2021

For all who is trying to get things to work on the current game version, please be aware that game now uses it's own DLL.
It is located in the folder where you installed the game. For me it was in C:/Program Files (x86)/Diablo II Resurrected/d3d12.dll

I replaced both the one in C:/windows/system32/d3d12.dll and that one with vkd3d/x64/d3d12.dll and everything worked.

Also, please remember, that this custom vkd3d requires DXGI. I used the one from DXVK, installed with dnf install wine-dxvk-dxgi (Fedora 34).

Also, please be aware of the fact that Battle.net periodically checks game files and it detects this DLL change. It does that on time timer, so you can update the game, then switch the DLL to the correct one and then launch it just fine. But you have to be quick and you have to do it every time game updates.


Wine 6.18 (Staging)
DXVK 1.9.2
NVidia 470.74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diablo II Resurrected black screen