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

Warcraft 3 (32 bit): VK_EXT_extended_dynamic_state graphic glitch #1808

Closed
michelesr opened this issue Nov 5, 2020 · 13 comments
Closed

Warcraft 3 (32 bit): VK_EXT_extended_dynamic_state graphic glitch #1808

michelesr opened this issue Nov 5, 2020 · 13 comments

Comments

@michelesr
Copy link

After updating the Intel Vulkan driver (32 bit version) on Arch Linux graphic glitches/rendering issues (intermittent flashing rendered objects, ~ every 2 seconds) started to appear.

By doing a git bisect on the driver, I identified the commit that introduced the issue, that is https://gitlab.freedesktop.org/mesa/mesa/-/commit/32e0f7e09721d4097f7b134b679053f48c216668, which enables the VK_EXT_extended_dynamic_state extension.

Not sure whether it's a driver bug, or something in DXVK. Is it possible to disable the extension at runtime as workaround?

Software information

Warcraft 3 (v1.31 32 bit build), both with DirectX 11 and 9

System information

  • GPU: Intel UHD Graphics 630
  • Driver: lib32-vulkan-intel 20.2.1
  • Wine version: wine-5.7.r0.g2ad422ff ( TkG Staging Esync Fsync ) (lutris-5.7-8-x86_64)
  • DXVK version: 1.7.2

Apitrace file(s)

  • Tried to run apitrace.exe but, I get:
apitrace: warning: caught exception 0xc000001d

And can't find the trace file anywhere :-(

Log files

@doitsujin
Copy link
Owner

You don't need to run apitrace.exe, you can just copy dxgi.dll, d3d11.dll and dxgitrace.dll from apitrace next to the game exe (the 32-bit variants), set the dxgi and d3d11 DLL overrides to native and run the game.

Given that Warcraft III is no longer available, this is the only hope of getting any sort of debugging done on this problem, although I'd rather suspect some sort of driver issue given that it seems to work on other hardware, and a DXVK problem with that extension affecting only this one game seems unlikely.

@michelesr
Copy link
Author

Ok, so I did that and the FPS dropped a lot. Ironically, they dropped so much that the glitch is not visible anymore. However, I managed to get the trace file now (I zipped it because otherwise GitHub won't let me upload it here directly):
trace.zip

@doitsujin
Copy link
Owner

Not really seeing anything out of the ordinary, no Vulkan validation errors, and no glitches in the arguably extremely short trace.

@michelesr
Copy link
Author

Is there any benchmark or example that I can run which might use that extension to try to reliably reproduce the problem? If it's a driver issue it shouldn't be confined to only one game.

@doitsujin
Copy link
Owner

DXVK always uses the extension if it's supported, in order to correctly cap vertex buffer sizes. There's no way to disable it.

@michelesr
Copy link
Author

Understood... I guess I'll need to test with other 3D applications/games... so far tried the test from dxdiag (the spinning cube) and that one (using DX9 over DXVK) is working properly.

@michelesr
Copy link
Author

Also tested this by running an old version of the WoW client (32bit, DX9) and the problem is not present. Might be related to WC3 then, and given that I have a workaround (compiling the driver with the ext disabled) I'm happy for this issue to be closed, at least until there's a reliable way to reproduce and understand what exactly it's happening.

Thanks for your help @doitsujin !

@avindra
Copy link

avindra commented Nov 26, 2020

Looks like this game (including The Frozen Throne expansion) uses DirectX 8 (see logs below).

There is a 1.31 patch for the game that seems to add DirectX 11, which means DXVK can actually hook in there.

The problem is some Battle.net alternatives like ICCup are still using 1.26, so hopefully they update soon.

(Thanks for guihkx for showing how to get these debug lines).

WINEDEBUG="+timestamp,+pid,+tid,+loaddll" WINEPREFIX=~/.wine32  DXVK_HUD=1 wine war3.exe -window -d3d -classic  2>&1 | grep -i d3d
206:30732.286:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\wined3d.dll" at 7C640000: builtin
207:30732.286:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\d3d8.dll" at 02780000: builtin
208:30732.829:0020:0024:trace:loaddll:free_modref Unloaded module L"C:\\windows\\system32\\d3d8.dll" : builtin
209:30732.829:0020:0024:trace:loaddll:free_modref Unloaded module L"C:\\windows\\system32\\wined3d.dll" : builtin
210:30732.831:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\wined3d.dll" at 7C640000: builtin
211:30732.831:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\d3d8.dll" at 02870000: builtin
212:30732.992:0020:0024:trace:loaddll:free_modref Unloaded module L"C:\\windows\\system32\\d3d8.dll" : builtin
213:30732.992:0020:0024:trace:loaddll:free_modref Unloaded module L"C:\\windows\\system32\\wined3d.dll" : builtin
214:30733.001:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\wined3d.dll" at 7C640000: builtin
215:30733.002:0020:0024:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\d3d8.dll" at 02870000: builtin
227:30733.925:0020:0104:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts.

@avindra
Copy link

avindra commented Nov 26, 2020

Wow amazingly, the Dxwrapper Dx8 -> Dx9 thing @guihkx found worked out for me. It runs at full 95 fps on my monitor when it's running in fullscreen mode.

I dropped 30 frames here because I was abusing the render pipeline by spamming Razor's massive AOE spell over and over in WTF mode in DotA.

lich

#1585 (comment)

I would recommended most users just update to the latest Warcraft though, if that's an option. I imagine DX11->Vulkan will run faster than the 8->9 -> Vulkan.


More info: it requires 3 files (1 ini + 2 dll) in the root of the game dir:

-rw-r--r--  1 user group 415K Nov 25 21:40  d3d8.dll
-rw-r--r--  1 user group 1.8M Nov 25 21:40  dxwrapper.dll
-rw-r--r--  1 user group 2.3K Nov 25 21:41  dxwrapper.ini

The important thing in dxwrapper.ini (which is part of the release tarball) is setting D3d8to9 = 1 (for this game). (See the referenced comment for further instructions).

@michelesr
Copy link
Author

There is a 1.31 patch for the game that seems to add DirectX 11, which means DXVK can actually hook in there.

I was referring to that version specifically, which runs on Directx 9 or 11. On older versions of the game you can use the OpenGL backend which seems solid (however 1.31 with DX11/DXVK gives smoother experience in my system)

@avindra
Copy link

avindra commented Nov 29, 2020

That's right, 1.31 is the best patch to use. It looks like it may be the final patch for WC3, so hopefully Blizzard ports everything correctly to the Reforged client. Avoid the older ones if you can.

If anyone wants to see patch numbers where respective DirectX upgrades took place, we did some sleuthing in another repo:

legluondunet/MyLittleLutrisScripts#54 (comment)

@michelesr
Copy link
Author

Looks like https://gitlab.freedesktop.org/mesa/mesa/-/commit/c763926c7632aea9c60f54f44d0e86d7ba33aa86 solved the problem for good!

The fix is included in the release 20.3.1 of the Intel Vulkan drivers.

@AlbertWang2018
Copy link

Wow amazingly, the Dxwrapper Dx8 -> Dx9 thing @guihkx found worked out for me. It runs at full 95 fps on my monitor when it's running in fullscreen mode.

I dropped 30 frames here because I was abusing the render pipeline by spamming Razor's massive AOE spell over and over in WTF mode in DotA.

lich

#1585 (comment)

I would recommended most users just update to the latest Warcraft though, if that's an option. I imagine DX11->Vulkan will run faster than the 8->9 -> Vulkan.

More info: it requires 3 files (1 ini + 2 dll) in the root of the game dir:

-rw-r--r--  1 user group 415K Nov 25 21:40  d3d8.dll
-rw-r--r--  1 user group 1.8M Nov 25 21:40  dxwrapper.dll
-rw-r--r--  1 user group 2.3K Nov 25 21:41  dxwrapper.ini

The important thing in dxwrapper.ini (which is part of the release tarball) is setting D3d8to9 = 1 (for this game). (See the referenced comment for further instructions).

Fantastic! I downloaded dxwrapper but I don't know how to use it. After reading your reply, I finally used it. My problem has been solved. Thank you very much.

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

No branches or pull requests

4 participants