HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.87k stars 194 forks source link

Age of Empire 4 hangs on Intel shortly after intro screen #1200

Closed djdeath closed 1 year ago

djdeath commented 2 years ago

I've traced this to 2 issues. One of them doesn´t seem to be a driver problem. It seems Vkd3d-proton is reusing a mutable descriptor as an image/sampler or a buffer view without writing it prior to submission. In the descriptor the image part normally would have the bottom 6 bits to 0 (if it was written by the driver) : https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/anv_descriptor_set.c#L1355 But we're not getting zeros and the HW reads that as a message length which makes it go off the rails.

The fix/workaround for the Intel/Mesa driver : https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17247 It was reported again with proton experimental yesterday : https://gitlab.freedesktop.org/mesa/mesa/-/issues/7111

HansKristian-Work commented 2 years ago

This sounds like a game bug then? Is this something descriptor_qa_checks catches?

djdeath commented 2 years ago

I didn't know that tool existed, would need to check.

I don't know the status of validation layers for this extension, but I suppose it could be caught there too.

HansKristian-Work commented 2 years ago

There is no GPU validation support of mutable with update-after-bind. descriptor_qa_checks is a tailor made variant of that for vkd3d-proton.

djdeath commented 2 years ago

I think I just ran into another instance of this with a different title (Hellblade: Senua's Sacrifice) : https://gitlab.freedesktop.org/mesa/mesa/-/issues/7110

Except this time I can't workaround it with a compiler change.

Do you know if descriptor_qa_checks is available in any of the proton version shipping with steam?

mbriar commented 2 years ago

As far as I'm aware there is no Proton build on steam that ships with descriptor_qa_checks enabled. You'll have to build vkd3d-proton manually with meson --cross-file build-win64.txt -Denable_descriptor_qa=true and then copy the resulting d3d12.dll to e.g. $HOME/.local/share/Steam/steamapps/common/Proton - Experimental/files/lib64/wine/vkd3d-proton, overwriting the existing one.

djdeath commented 1 year ago

Well it sucks. With descriptor_qa_checks I cannot reproduce the problem anymore.

djdeath commented 1 year ago

The Hellblade issue turned out to be an driver issue, fixed by https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19275

Checking Age Of Empire 4 and will close if also fixed.

mbriar commented 1 year ago

FWIW, it looks like AoE4 currently also hangs on AMD in some scenarios https://github.com/HansKristian-Work/vkd3d-proton/issues/1279 You might want to try with https://github.com/HansKristian-Work/vkd3d-proton/pull/1285, or wait until it lands.

djdeath commented 1 year ago

Confirm, AoE4 is also fixed for us.

We have some rendering issue, but it's probably thing else.

heftig commented 1 year ago

Given the comment at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19275#note_1635850, is this really fixed already?

djdeath commented 1 year ago

Partly, there are other issues.