http://bugs.winehq.org/show_bug.cgi?id=30256
Bug #: 30256 Summary: Ancients of Ooga: very slow rendering in mid game Product: Wine Version: 1.3.22 Platform: x86 OS/Version: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: gyebro69@gmail.com CC: matteo.mystral@gmail.com Classification: Unclassified Regression SHA1: 002674e49d3343d2ad4670081276e38af867eefe
Created attachment 39520 --> http://bugs.winehq.org/attachment.cgi?id=39520 terminal output
Ancients of Ooga is an indie platformer, developed by NinjaBee. The demo version of the game is Steam-only: http://store.steampowered.com/app/91810/
The problem: performance is okay in the menus and during the intro video. As soon as the video ends and the game is loaded, framerate drops dramatically. While in the menus I get 50 fps, in mid-game I get 1-2 fps or less. This makes the game unplayable.
The problem appeared in Wine-1.3.22 and is still present in 1.5.0. Actually, Wine-1.3.21 is the one and only version being capable of running the game normally. All previous versions fail to start the game correctly, and all later versions have the reported performance issue. When I start a new game I get 30 fps with 1.3.21, and 1-2 fps with 1.3.22.
The result of the regression test:
002674e49d3343d2ad4670081276e38af867eefe is the first bad commit commit 002674e49d3343d2ad4670081276e38af867eefe Author: Matteo Bruni mbruni@codeweavers.com Date: Mon Jun 6 17:44:43 2011 +0200
wined3d: Fix glDrawBuffers() optimization.
:040000 040000 afbbbb65e869d58ae00b56c627228bd6e9d2d1bb 71478cb542317c0b2e3c1dc2b8155a6ff4dcd44a M dlls
The problem can be reproduced with the Steam demo version (the game needs native d3dx9_36.dll). Please let me know if you need a log with debug channels enabled.
Fedora 16 Nvidia 250 / driver 290.10 X.Org X Server 1.11.4
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #1 from GyB gyebro69@gmail.com 2012-03-24 13:38:13 CDT --- I forgot to mention that the game is currently available in the Indie Royale Bundle for a limited time period (3 days left). Matteo, I can gift you the games in the bundle if you'd like to investigate the problem yourself. http://www.indieroyale.com/
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #2 from Matteo Bruni matteo.mystral@gmail.com 2012-03-24 17:11:47 CDT --- Unfortunately I can't reproduce the issue here on Nvidia or AMD. Also, yeah, this looks like one of those bugs which are hard to debug without being able to reproduce locally... Anyway, I guess you could attach a +d3d9,+d3d,+d3d_surface log, in case something shows up there. The resulting logfile would probably be too big, even compressed: just attach the tail of the log (compressed) for the time being.
Another thing you can try is backbuffer ORM, in case it makes any difference.
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #3 from GyB gyebro69@gmail.com 2012-03-24 23:15:17 CDT --- Created attachment 39531 --> http://bugs.winehq.org/attachment.cgi?id=39531 partial +d3d9,+d3d,+d3d_surface log (uncompressed 205 MB)
Orm=backbuffer acts as a workaround and performance is normal with that setting.
The attached log contains the last 2 million lines of the full log (the whole log grew over 1.3 GB until I got into the main game).
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #4 from Matteo Bruni matteo.mystral@gmail.com 2012-03-26 12:58:39 CDT --- Created attachment 39556 --> http://bugs.winehq.org/attachment.cgi?id=39556 Update the right mask.
I attached a patch which should be correct and remove many unneeded glDrawBuffers() calls (which probably aren't free). However, the affected code was introduced AFTER the patch from the regression test, so I guess your issue is different... Anyway, I'd appreciate if you could test this patch, just in case.
Reading the log I had another idea though. Could you try the patch from bug 27879 and see if it helps here too?
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #5 from GyB gyebro69@gmail.com 2012-03-26 13:32:06 CDT --- (In reply to comment #4)
Created attachment 39556 [details] Update the right mask.
I attached a patch which should be correct and remove many unneeded glDrawBuffers() calls (which probably aren't free). However, the affected code was introduced AFTER the patch from the regression test, so I guess your issue is different... Anyway, I'd appreciate if you could test this patch, just in case.
Reading the log I had another idea though. Could you try the patch from bug 27879 and see if it helps here too?
None of the patches made any difference...once I get into the game it is still painfully slow.
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #6 from Matteo Bruni matteo.mystral@gmail.com 2012-03-26 18:10:31 CDT --- Created attachment 39561 --> http://bugs.winehq.org/attachment.cgi?id=39561 Hack to replace RGBA16 with RGBA8
(In reply to comment #4)
Reading the log I had another idea though. Could you try the patch from bug 27879 and see if it helps here too?
Hmm, actually 6c5e109af7184ee557aa24c676cc78f3e92e6782 wasn't in 1.3.22, so the patch from that bug can't do any difference... Sorry about it.
I'm still thinking the slowdown may have to do with WINED3DFMT_R16G16B16A16_UNORM render targets + blending causing an emulation fallback in the GL driver, like bug 27879. The game uses such texture format as an additional render target which is "disabled" (not supported) by backbuffer ORM and may be broken before the regression patch.
The game doesn't really check for availability of the texture format and crashes if it can't create the WINED3DFMT_R16G16B16A16_UNORM render target; something like the attached hack is the only thing I could think of for another test.
I hope this hack helps, otherwise I'm pretty much at a loss...
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #7 from GyB gyebro69@gmail.com 2012-03-26 21:40:43 CDT --- (In reply to comment #6)
Created attachment 39561 [details] Hack to replace RGBA16 with RGBA8
(In reply to comment #4)
Reading the log I had another idea though. Could you try the patch from bug 27879 and see if it helps here too?
Hmm, actually 6c5e109af7184ee557aa24c676cc78f3e92e6782 wasn't in 1.3.22, so the patch from that bug can't do any difference... Sorry about it.
I'm still thinking the slowdown may have to do with WINED3DFMT_R16G16B16A16_UNORM render targets + blending causing an emulation fallback in the GL driver, like bug 27879. The game uses such texture format as an additional render target which is "disabled" (not supported) by backbuffer ORM and may be broken before the regression patch.
The game doesn't really check for availability of the texture format and crashes if it can't create the WINED3DFMT_R16G16B16A16_UNORM render target; something like the attached hack is the only thing I could think of for another test.
I hope this hack helps, otherwise I'm pretty much at a loss...
Thanks, the hack did the trick and performance is back to normal.
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #8 from Henri Verbeet hverbeet@gmail.com 2012-03-27 02:45:01 CDT --- (In reply to comment #6)
The game doesn't really check for availability of the texture format and crashes if it can't create the WINED3DFMT_R16G16B16A16_UNORM render target;
Does that actually work on Windows?
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #9 from Matteo Bruni matteo.mystral@gmail.com 2012-03-27 11:53:56 CDT --- (In reply to comment #8)
(In reply to comment #6)
The game doesn't really check for availability of the texture format and crashes if it can't create the WINED3DFMT_R16G16B16A16_UNORM render target;
Does that actually work on Windows?
I don't have a GPU without RGBA16 render target support around, so I'm not sure. On my older GeForce 6200 (which advertises D3DFMT_A16B16G16R16 render targets but not QUERY_POSTPIXELSHADER_BLENDING nor QUERY_FILTER flags) the game shows mostly junk, as if the render targets don't get updated. My guess is that the game still tries to render to the D3DFMT_A16B16G16R16 render target with alpha blending and that doesn't really work.
It would be interesting to repeat such test on Windows on a GeForce 8xxx - 2xx GPU. Although I guess it works there, so either Linux OpenGL drivers have issues with RGBA16 blending on that hardware which D3D drivers don't have, or the hardware actually doesn't support RGBA16 blending and they have some "nice" workaround for that in the D3D drivers (such as disabling writes to the RGBA16 render target).
Enough wild guessing...
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #10 from GyB gyebro69@gmail.com 2012-03-30 12:15:59 CDT --- Just would like to add that the problem is not present with the open source Nouveau driver (I get pretty decent framerate with Nouveau).
http://bugs.winehq.org/show_bug.cgi?id=30256
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #11 from Jerome Leclanche adys.wh@gmail.com 2012-03-30 13:37:55 CDT --- Is this a nvidia issue then?
http://bugs.winehq.org/show_bug.cgi?id=30256
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #12 from joaopa jeremielapuree@yahoo.fr 2013-04-20 14:24:31 CDT --- Can be closed as UPSTREAM?
http://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #13 from Austin English austinenglish@gmail.com 2013-04-22 19:31:38 CDT --- (In reply to comment #12)
Can be closed as UPSTREAM?
Potentially, but I'd like to hear that from one of the d3d guys.
http://bugs.winehq.org/show_bug.cgi?id=30256
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |UPSTREAM
--- Comment #14 from Henri Verbeet hverbeet@gmail.com 2013-04-23 04:52:01 CDT --- I'd say so, although it's not entirely clear if the application is more broken or the driver.
https://bugs.winehq.org/show_bug.cgi?id=30256
--- Comment #15 from Béla Gyebrószki gyebro69@gmail.com --- I tried again this game in Wine 1.9.12 with 2 different cards and drivers: GeForce GTS 250 with binary drivers 340.96: the problem still exists GeForce GT 730 with binary drivers 364.19: the problem doesn't exist The game runs fine with nouveau/mesa on the GTS 250.
https://bugs.winehq.org/show_bug.cgi?id=30256
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=30256
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #17 from Austin English austinenglish@gmail.com --- This was inadvertently caught up in my unclosed bugs filter. NOTOURBUG should only be closed when fixed upstream.
Setting back to RESOLVED NOTOURBUG.
Sorry for the spam.