https://bugs.winehq.org/show_bug.cgi?id=51848
Bug ID: 51848 Summary: Performance Regression in Secondhand Lands Product: Wine Version: 6.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: escomk3@hotmail.com Distribution: ---
After 4261369e5d8 [1], FPS will be near zero, and the game area will be black, with the actual should-be content sometimes appearing and disappearing.
Standard output with default'ish debug channels doesn't show any difference with a build prior to this commit.
1. https://source.winehq.org/git/wine.git/commit/4261369e5d8f1d71e8d20747475158...
https://bugs.winehq.org/show_bug.cgi?id=51848
Chiitoo escomk3@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://www.secondhandlands | |.com/download.php Regression SHA1| |4261369e5d8f1d71e8d20747475 | |1585fe9f90cc5 Distribution|--- |Gentoo Keywords| |download, performance, | |regression
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #1 from Henri Verbeet hverbeet@gmail.com --- Could you attach a "+ddraw,+d3d9,+d3d" log?
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #2 from Chiitoo escomk3@hotmail.com --- Created attachment 70818 --> https://bugs.winehq.org/attachment.cgi?id=70818 Trace with channels: +ddraw,+d3d9,+d3d
Forgot to mention that the game does require native 'd3dcompiler_43' and 'd3dx9_43' to run at all at this time.
Thank you!
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #3 from Henri Verbeet hverbeet@gmail.com --- Is this still reproducible?
I was unable to reproduce the slowdown earlier, and unfortunately I didn't get any leads from your log either. I tried revisiting this for code freeze though, and right now it's just not rendering anything at all for me. I initially suspected a second regression, but I'm seeing the same behaviour with older Wine versions, including wine-6.0 and wine-6.17. Trying to look into that, I came across a message claiming the game was shut down between when this bug was originally filed and now.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #4 from Chiitoo escomk3@hotmail.com --- Indeed, the servers have been taken down, possibly permanently.
However, it's possible to run the client directly by giving it anything as an argument like so:
'Client.exe 123'
At 7.0-rc2 the FPS hangs around 20, so that's an improvement of sorts, but there's still a very fast-flashing UI happening.
https://bugs.winehq.org/show_bug.cgi?id=51848
Sagawa sagawa.aki+winebugs@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sagawa.aki+winebugs@gmail.c | |om
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #5 from Conor McCarthy cmccarthy@codeweavers.com --- *** Bug 52236 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=51848
Conor McCarthy cmccarthy@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cmccarthy@codeweavers.com Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #6 from Conor McCarthy cmccarthy@codeweavers.com --- I think this is a driver problem. The chosen GL pixel format with WGL_SWAP_COPY_ARB is identical to the one chosen without this patch except for the different swap attribute. I found nothing wrong with how the pixel format is used. There were no GL errors and no assertion failures in a Mesa debug build. No effect occurs in swapchain_gl_present() because swapchain_present_is_partial_copy() is false anyway. The problem persists if the changes to swapchain_gl_present() are reverted.
On my system with an RX580, it freezes the entire X window UI, so the exe must be terminated from an alternate console. This problem is worse in Secondhand Lands because X window doesn't unfreeze after I terminate the game.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #7 from Henri Verbeet hverbeet@gmail.com --- Created attachment 71508 --> https://bugs.winehq.org/attachment.cgi?id=71508 patch
(In reply to Chiitoo from comment #4)
However, it's possible to run the client directly by giving it anything as an argument like so:
'Client.exe 123'
Thanks, that helps a lot, and I'm able to reproduce the issue now. The attached patch helps here, although I don't believe it's entirely correct. (In particular, it will incorrectly clear a pixel format previously set by the application in some cases.)
(In reply to Conor McCarthy from comment #6)
I think this is a driver problem. The chosen GL pixel format with WGL_SWAP_COPY_ARB is identical to the one chosen without this patch except for the different swap attribute. I found nothing wrong with how the pixel format is used. There were no GL errors and no assertion failures in a Mesa debug build. No effect occurs in swapchain_gl_present() because swapchain_present_is_partial_copy() is false anyway. The problem persists if the changes to swapchain_gl_present() are reverted.
The problem seems to be a bit more subtle; always using a WGL_SWAP_COPY_ARB format also works fine. The issue in this particular application is that the application first creates swapchains with a "copy" swap effect, and then later creates a swapchain with a "non-copy" swap effect on the same window. That causes us to end up switching between the two different pixel formats, even though the original context that needed the WGL_SWAP_COPY_ARB pixel format has long since been destroyed. On the winex11 side, changing the pixel format causes the GL drawable to be recreated, and that's the cause of the flickering, and likely the slowdown as well.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #8 from Chiitoo escomk3@hotmail.com --- (In reply to Henri Verbeet from comment #7)
Created attachment 71508 [details] patch
(In reply to Chiitoo from comment #4)
However, it's possible to run the client directly by giving it anything as an argument like so:
'Client.exe 123'
Thanks, that helps a lot, and I'm able to reproduce the issue now. The attached patch helps here, although I don't believe it's entirely correct. (In particular, it will incorrectly clear a pixel format previously set by the application in some cases.)
Very good!
Indeed, works for me as well; no more blinking, and FPS went from 23 to 33.
Thanks!
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #9 from Sagawa sagawa.aki+winebugs@gmail.com --- *** Bug 52236 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=51848
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Performance Regression in |Multiple applications have |Secondhand Lands |very poor performance after | |4261369e5d8 (Secondhand | |Lands, SPORE) CC| |z.figura12@gmail.com
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- I can reproduce the same problem in SPORE, and it's fixed by the same patch.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #11 from Andrey Gusev andrey.goosev@gmail.com --- WRC 4 FIA World Rally Championship is also affected.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #12 from Andrey Gusev andrey.goosev@gmail.com --- And Crysis 2 Maximum Edition in DX9 mode.
https://bugs.winehq.org/show_bug.cgi?id=51848
--- Comment #13 from Sagawa sagawa.aki+winebugs@gmail.com --- This is still an issue in Wine 8.0-rc3.
https://bugs.winehq.org/show_bug.cgi?id=51848
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=51848
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |46c8a637525d0f1cf67830295fb | |460c819b800b6 Status|NEW |RESOLVED
--- Comment #14 from Zeb Figura z.figura12@gmail.com --- Should be fixed by https://source.winehq.org/git/wine.git/commitdiff/46c8a637525d0f1cf67830295fb460c819b800b6.
https://bugs.winehq.org/show_bug.cgi?id=51848
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.4.