https://bugs.winehq.org/show_bug.cgi?id=43519
Bug ID: 43519 Summary: Path of Exile: Corrupt/flickering UI textures after ~1 minute of gameplay Product: Wine Version: 2.14 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3dx9 Assignee: wine-bugs@winehq.org Reporter: nneonneo@gmail.com
Created attachment 58911 --> https://bugs.winehq.org/attachment.cgi?id=58911 console log for Wine, manual annotations added (in the form of <<<NOTE>>> lines)
Path of Exile 3.0.0c launches and enters a game successfully on 32-bit mode with Wine 2.14-devel on macOS.
However, about a minute or so into gameplay, the UI textures start to flicker uncontrollably, and are replaced with corrupt nonsense (see attached video "PoE Corrupt Textures.mov"). At the point where this starts happening, the console shows the following:
err:d3d:wined3d_fence_wait glClientWaitSync returned 0x911b. err:d3d:buffer_sync_apple wined3d_fence_wait() returned 4, dropping async buffer locks.
Before this message appears, everything is 100% OK.
Environment: - macOS 10.12.5 (Sierra) - MacBook Pro Retina, screen resolution 1920x1080 (external monitor only) - NVIDIA GeForce GT 750M graphics card with 2048MB VRAM (discrete graphics in use) - Wine 2.14 development version, WINEARCH=win32, 32-bit .wine directory (bug still occurs with today's Wine 2.14 staging; 64-bit Wine fails to launch the game at all) - Vanilla .wine directory (winecfg not run, winetricks not run, no DLL overrides)
https://bugs.winehq.org/show_bug.cgi?id=43519
--- Comment #1 from Robert Xiao nneonneo@gmail.com --- Created attachment 58912 --> https://bugs.winehq.org/attachment.cgi?id=58912 video demonstrating texture glitch (rendering game unplayable)
https://bugs.winehq.org/show_bug.cgi?id=43519
--- Comment #2 from Robert Xiao nneonneo@gmail.com --- Created attachment 58913 --> https://bugs.winehq.org/attachment.cgi?id=58913 screenshot of in-game settings panel
https://bugs.winehq.org/show_bug.cgi?id=43519
--- Comment #3 from Robert Xiao nneonneo@gmail.com --- Created attachment 58914 --> https://bugs.winehq.org/attachment.cgi?id=58914 wined3d_fence_wait patch that seems to fix the issue
OK, I built from source (tag wine-2.14) and reproduced the bug. Then I patched wined3d_fence_wait by setting the timeout to something much less than ~(uint64_t)0xffff (but still very large, ~146 years) and the problem appears to be fixed.
I believe what's happening is that the timeout value is internally being adjusted by macOS somewhere, and that adjustment is not entirely predictable. The previous comment to avoid 0xfffffffffffffbff suggests that the adjustment is at least 1000 nanoseconds (1us), but my testing suggests that the adjustment could be as high as 65536 nanoseconds under certain circumstances.
To avoid any future issues, this patch uses a timeout of 2^62 nanoseconds. Why not 2^63? Because I'm paranoid that a "negative" value (one which could be interpreted as a negative signed 64-bit int) might cause other issues down the line. 2^62 is a long enough wait time to be safe, while being far enough from 2^63 or 2^64 that we shouldn't see any further issues.
https://bugs.winehq.org/show_bug.cgi?id=43519
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
https://bugs.winehq.org/show_bug.cgi?id=43519
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b2303d90af34da3427d27302f40 | |055c548cc657a Resolution|--- |FIXED Component|directx-d3dx9 |directx-d3d Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Matteo Bruni matteo.mystral@gmail.com --- Should be fixed by b2303d90af34da3427d27302f40055c548cc657a, thank you Robert!
https://bugs.winehq.org/show_bug.cgi?id=43519
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.17.