[Bug 14724] New: Max Payne 2: PP effect performance (ORM=fbo)

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Aug 1 19:56:24 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=14724

           Summary: Max Payne 2: PP effect performance (ORM=fbo)
           Product: Wine
           Version: CVS/GIT
          Platform: PC-x86-64
               URL: http://www.rockstargames.com/maxpayne2/mp2_downloads.htm
                    l
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: directx-d3d
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: liquid.acid at gmx.net
                CC: onety-three at gmx.net


Hi,

this bug is about performance issues with post-processing (PP) effects in the
demo of the game "Max Payne 2".

This bug is only about issues that happen when OffscreenRenderingMode is set to
fbo. Please don't report issues with backbuffer or pbuffer mode here.

This is a split from this bug:
http://bugs.winehq.org/show_bug.cgi?id=14038

Furthermore the bug should only focus on performance issues, since there are a
lot more issues with PP effects, which are not related to performance.

The problem mostly seems to happen on nvidia Geforce FX 5xxx series cards.

Where are PP effect used in the game:
- Bullettime mode is using a sepia tone filter
- Cutscenes are motion blurred

What is BAD performance: One frame rendered every 5 seconds, which makes the
game essentially unplayable.
While cutscenes can be skipped, bullettime is crucial for the game and I'm sure
there is noone out there who has finished it without using the feat.

There are two PP effect modes selectable ingame:
(i) medium (which is the better working one)
(ii) high (this is the more problematic one)

The issue itself:
PP effects used in the game lead to severe slowdowns, resulting in BAD
performance (as described above).

People confirming the problem:
(i) Me, with a Geforce FX 5900
(ii) Frank Roscher, with a GeForce FX 5700

Driver versions:
(i) Currently I have version 173.14.09 installed, but the problem also existed
with nvidia-drivers-100.14.19
(ii) Frank has reported the problem with driver version 169.12

Possible reasons for the slowdown:
The nvidia Geforce FX 5xxx series does report OpenGL 2.0 capabilities in the
glxinfo, but does NOT explicitly advertise the GL_ARB_npot in the extension
string.
The only NPOT-like extension advertised is the texture_rectangle one.

OpenGL 2.0 support however implies support of GL_ARB_npot, since this one is
now in core. Stefan Dösinger comments on that behaviour in
http://bugs.winehq.org/show_bug.cgi?id=14038#c28
According to him the FX hits a (slower) software fallback as soon as the
ARB_npot/"unconditional NP2 support" extension is used.

That also seems to be the core of the problem. Wine should not use
unconditional NP2 for the FX and instead of the (conditional) texture_rectangle
support, which should be supported by the FX in hardware.

New problems arise in latest git master when disabling usage of NP2 in
directx.c (by commenting out the line with the extension).
I will comment on these (new) problems later.

----------------------------------------------------------------------------

But first, some HISTORY about the problem:

With PPE (PP effects) = medium (and a resolution of 800x600):

wine-0.9.25: Performance in bullettime is OK, but visuals are suffering from
cropping bug (*) and room-disconnection errors (**)

---- somewhere here the cropping bug is solved for fbo ----

wine-0.9.45: Performance in bullettime is OK, visuals are also OK (no cropping,
no room-disconnections)
But there is a problem with intro and outro videos (those are not rendered
fullscreen and leave a lot of black borders around them)

wine-0.9.56: Performance in bullettime is OK, visuals also OK
No problems with intro/outro videos

---- somewhere here is currently the best version to play MP2 ----

wine-1.0.0: Performance in bullettime is OK, visuals also OK
texture_shader FIXMEs flooding the console (not only in scenes with PP effects)

wine-1.1.0: Same like wine-1.0.0

wine-1.1.1: Same like wine-1.0.0, furthermore in scenes with PP effects (not
only bullettime) these FIXMEs flood the console (I filtered the ones about
nvts):
fixme:d3d_surface:read_from_framebuffer_texture >>>>>>>>>>>>>>>>>
GL_INVALID_ENUM (0x500) from glReadBuffer @ surface.c / 913
fixme:d3d_shader:shader_arb_deselect_depth_blt >>>>>>>>>>>>>>>>>
GL_INVALID_OPERATION (0x502) from glDisable(GL_VERTEX_PROGRAM_ARB) @
arb_program_shader.c / 1840

wine-1.1.2: Performance in bullettime is BAD (same applies to PP effects in
cutscenes), visuals however are OK
nvts FIXMEs are gone, but there are new ones which are generated while PP
effects are displayed on screen:
fixme:d3d_surface:read_from_framebuffer_texture >>>>>>>>>>>>>>>>>
GL_INVALID_ENUM (0x500) from glReadBuffer @ surface.c / 920

wine git master from 2.8.2008: Performance like wine-1.1.2, visuals are now
completly broken - the screen goes black after going into bullettime, returns
to normal view after bullettime is over (takes some time after pressing the bt
key again). The FIXMEs from wine-1.1.2 are still there.

We see here that MP2 is gradually broken.

(*): For the cropping bug see: http://bugs.winehq.org/show_bug.cgi?id=14686
(**): A screenshot is going to be attached

----------------------------------------------------------------------------

With PPE (PP effects) = high (and a resolution of 800x600):

wine-0.9.25: Performance is BAD, sepia filter is correctly applied, but game
suffers again from the room-disconnection bug, no cropping issue here.
Cutscenes however are rendered incorrectly, looks like some sort of zooming is
going on.

wine-0.9.45: Performance is OK, both bullettime and cutscenes are rendered
correctly (no room-disconnections, sepia filter correct, motion blur working),
BUT:
As soon as PP effects are used the used screen content is shrinked to a subarea
of the original screen. Note that this is NOT a cropping effect, it's just that
the rendered pictures are now confined in the subarea.
Like with PPE=medium the intro/outro videos are rendered incorrectly.
Apart from that this is the best version if you wanna use high PP effects.

---- rendering breaks by introducing commit
d09cbcec91561186bee77aaba55b29cbf2d7e7ef ----

wine-0.9.56: This one has broken rendering. Performance is still OK, but as
soon as bullettime is enabled the screen is filled with a solid color.
HOWEVER cutscenes (which also use postprocessing) work without problems.
Cutscenes are rendered with motion blur, no cropping and GOOD performance.

wine-1.0.0: Like wine-0.9.56 but the nvts FIXME flooding is introduced.
Cutscenes still working perfectly, but bt is broken.

wine-1.1.0: Same like wine-1.0.0

wine-1.1.1: Same like wine-1.0.0, but now these FIXMEs flood the console as
soon as PP effects are used:
fixme:d3d_surface:read_from_framebuffer_texture >>>>>>>>>>>>>>>>>
GL_INVALID_ENUM (0x500) from glReadBuffer @ surface.c / 913
fixme:d3d_shader:shader_arb_deselect_depth_blt >>>>>>>>>>>>>>>>>
GL_INVALID_OPERATION (0x502) from glDisable(GL_VERTEX_PROGRAM_ARB) @
arb_program_shader.c / 1840

---- commit c088edeae7fed4645fa3f34fb5bacc1eeaa87706 from Stefan Dösinger
fixes the bt sepia filter but introduces the major slowdowns ----

wine-1.1.2: Bullettime PP is restored, but performance is BAD now. Cutscene PP
has the same issues now, it suffers from major slowdown. As soon as PP effects
are used I see these FIXMEs on console:
fixme:d3d_surface:read_from_framebuffer_texture >>>>>>>>>>>>>>>>>
GL_INVALID_ENUM (0x500) from glReadBuffer @ surface.c / 920
The nvts FIXMEs are gone with this version.

wine git master from 2.8.2008: Breaks even more, as soon as PP effects are on
screen the screen goes black. Leaving bt restores the scene, but when canceling
cutscenes the scenes stays black. I have to enter bt and leave it again to
restore the view. Very strange.

----------------------------------------------------------------------------

This concludes my current research (for now).

Greets,
Tobias


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list