WineHQ
Bug Tracking Database – Bug 23802

 Bugzilla

 

Last modified: 2013-12-20 12:43:06 UTC  

Need for Speed Shift demo: slow framerate on showroom floor

Bug 23802 - Need for Speed Shift demo: slow framerate on showroom floor
Need for Speed Shift demo: slow framerate on showroom floor
Status: CLOSED FIXED
AppDB: Show Apps affected by this bug
Product: Wine
Classification: Unclassified
Component: -unknown
1.2
x86 Linux
: P2 normal
: ---
Assigned To: Mr. Bugs
: download, patch
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-07-26 22:52 UTC by Dan Kegel
Modified: 2013-12-20 12:43 UTC (History)
5 users (show)

See Also:
Regression SHA1:
Fixed by SHA1:
Distribution: ---
Staged patchset:


Attachments
Avoid software blit fallbacks (1.06 KB, patch)
2010-08-09 15:58 UTC, Stefan Dösinger
Details | Diff
Increase the FBO cache size for NFS shift (699 bytes, patch)
2010-08-09 15:58 UTC, Stefan Dösinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kegel 2010-07-26 22:52:44 UTC
In the showroom floor, when the car is just rotating, the 
framerate in Wine is well under 10fps, but in Windows it seems 
very smooth, above 20fps.  
The problem even occurs at low resolutions like 800x600.
Maybe there's some event timer firing at the wrong rate?

This problem's been around as long as I can remember.
Comment 1 Stefan Dösinger 2010-07-27 04:58:33 UTC
I get rather crappy performance with this game on Windows as well(Core 2 Duo, GF 9600, but it is CPU limited). Can you compare the in-game race framerate, preferably with a quick race without any opponents? You can show the framerate on Windows with Fraps(http://www.fraps.com/).

I think that my Windows setup is probably broken, as my CPU isn't too old. I get 6 fps in the main menu(both Windows and Wine), which seems wrong to me, but I need some performance data from a different computer to tell if it's my system's or the game's fault.
Comment 2 Stefan Dösinger 2010-07-28 02:52:27 UTC
Ok, my windows installation was broken. I reinstalled it after Mass effect 2 ran at 0.5 fps in the main menu.

Now with a better Windows to Wine comparison I can say that our overall performance in this game is a catastrophe. Just some quick data from the main menu(rotating car, etc): Windows gets 55 fps, wined3d on Windows 19, Wine 6. So we get approximately 10% of the Windows performance. Our usual "crap is this slow" 50% seem so sweet now.

I'm back to debugging this game's performance...
Comment 3 Dan Kegel 2010-07-28 08:45:26 UTC
Yeah, it's pretty bad in the main menu.

If it's any comfort, the frame rates seem better in the actual racing 
parts of the game.
Comment 4 Stefan Dösinger 2010-08-09 15:58:18 UTC
Created attachment 30072 [details]
Avoid software blit fallbacks
Comment 5 Stefan Dösinger 2010-08-09 15:58:50 UTC
Created attachment 30073 [details]
Increase the FBO cache size for NFS shift
Comment 6 Stefan Dösinger 2010-08-09 16:13:19 UTC
My performance debugging results were not as fruitful as I originally hoped. The patches I attached improve the performance with wined3d on Windows a little bit(22 -> 27 fps), but it is still a far cry from the 53 fps native d3d achieves.

The first one avoids a software fallback, it is pretty streightforward. However, the blit code is still in pretty bad shape, so I don't want to send it to wine-patches right away. This change may uncover some other problems, e.g. with backbuffer ORM.

The second one is needed because NFS:Shift uses more than 64 different framebuffer configurations in the main menu. The reconfiguration of framebuffers causes performance issues in the GL driver. This is a crude workaround only. For a proper fix we'd want some fbo cache limitation logic that isn't based on a fixed value. Also with growing FBO cache sizes we'll need different approach to organizing the cache, with the current design the cost for finding a specific FBO grows quickly with increased sizes.
(NFS:Shift apparently generates mipmaps with FBO_blit, so it blits bitween many different surfaces. There may be a capability flag issue. D3D supports mipmap autogeneration that would probably be faster. Wined3d supports it too, so if the game knows about it it should be able to use it)

As I mentioned, on Windows this improves the performance by about 20%. On Linux, the non-d3d issues drain all the oxygen set free by these improvements, so the performance was improved from ~16fps to ~17fps. However, the 16 fps were better than the 6 fps I got when I ran the app the last time. Switching to Linux 2.6.34 may have improved things, I can investigate this closer if needed(about 1/3rd of the CPU time is spent in the Linux kernel).

The remaining issues in the main menu are in 3 areas:
*) Blits are very expensive. There isn't a specific blit that is expensive. Some blits are integer RGBA blits, some are float blits, some scale up, some scale down. Filtering isn't the issue
*) Activating the FBOs is expensive, about 10% of total CPU time are spent in glBindFramebuffer(ARB or EXT). I did not find any obvious workaround here.
*) sRGB write correction. This is a GPU limitation, and it won't bother us until we remove the CPU limitations above.
Comment 7 Dan Kegel 2010-08-13 09:03:44 UTC
Feels much smoother with the patches, thanks!
In fact, +fps shows the framerate *doubled* in the menu
on my system (e8400, Geforce GT 220, ubuntu 10.04, 2.6.32-24-generic-pae),
from 8.5fps to 19fps.

(However, there's something funky going on with the sound.
I'm not hearing all the sounds I should, and it's possible
that some flaky sound problem is artificially improving things.)
Comment 8 Stefan Dösinger 2010-08-13 10:58:11 UTC
Did the patches double the framerate, or some other change? In my case some other change accounted for most of the improvement(6->16 fps), the patches are just some minor change(16->17)
Comment 9 Dan Kegel 2010-08-13 11:34:05 UTC
I ran with and without patches.  The menu was definitely twice as fast with the patches.  I'm going to repeat the measurements on another computer.
Comment 10 Dan Kegel 2010-08-13 12:53:33 UTC
The improvements continue on my i7 / gt 240 / 2.6.33-custom gentoo system.
where performance *tripled* on the menu; it went from 9fps with current git
to 28fps with current git + the two patches.
Comment 11 Dan Kegel 2011-02-12 01:30:27 UTC
What's the status of these patches?

I just tested this game again, and it's horridly slow without them.
Comment 12 Alexander B 2012-09-13 13:08:27 UTC
also affected :

Need For Speed Hot Pursuit 2010 (Bug 31078), Dirt 2 demo (Bug 30655), Dirt 3
Comment 13 Maxime 2013-05-30 14:59:02 UTC
(In reply to comment #12)
> also affected :
> 
> Need For Speed Hot Pursuit 2010 (Bug 31078), Dirt 2 demo (Bug 30655), Dirt 3

This bug affect "Splinter Cell : Conviction".
Comment 14 Andrey Gusev 2013-12-10 08:58:39 UTC
Tried in 1.7.8 without attached patches. Framerate is normal.
Nvidia driver 331.20
Comment 15 Austin English 2013-12-10 12:35:31 UTC
Reported fixed.
Comment 16 Alexandre Julliard 2013-12-20 12:43:06 UTC
Closing bugs fixed in 1.7.9.


Privacy Policy
If you have a privacy inquiry regarding this site, please write to [email protected]

Hosted By CodeWeavers