Opened 3 weeks ago

Closed 3 weeks ago

#15491 closed defect (fixed)

GRAPHICS: OPENGL: GRIM: Grim Fandango 60 > 12 FPS performance drop in ScummVM 2.9.0pre

Reported by: dwatteau Owned by: lephilousophe
Priority: blocker Component: Graphics
Version: Keywords:
Cc: Game: Grim Fandango

Description

Current Git HEAD on OSX PPC 10.5. Built with GCC 7.5.0 and optimisations turned on.

This PowerBook5,6 has an (old) ATI Radeon 9600 XT card, which used to run Grim Fandango just fine in ScummVM 2.8.0.

But on ScummVM 2.9.0pre, the performance has dropped from a solid 60 FPS to 10-12 FPS.

Doing a git bisect gave me the following "culprit":

commit 635cb6b998ccc66614b5dcbd59eab68797abf1cd
Author: Le Philousophe <lephilousophe@users.noreply.github.com>
Date:   Sat Mar 2 11:57:10 2024 +0100

    GRAPHICS: OPENGL: Upgrade glad headers
    
    This allows to remove a workaround in context creation

 graphics/opengl/context.cpp |  90 +++++-----
 graphics/opengl/glad.h      | 417 +++++++++++++++++++-------------------------
 2 files changed, 219 insertions(+), 288 deletions(-)

which is related to GitHub PR <https://github.com/scummvm/scummvm/pull/5683>.

I can attach the process to OSX's Instruments or OpenGL profiler, if necessary. Feel also free to ping me here or over Discord, if you need some live tests or something

Here's the -d6 output:

Using SDL Video Driver "Quartz"
OpenGL: GL context initialized
OpenGL version: 2.0 ATI-1.5.48
OpenGL vendor: ATI Technologies Inc.
OpenGL renderer: ATI Radeon 9600 XT OpenGL Engine
OpenGL: version 2.0
OpenGL: GLSL version string: 1.20
OpenGL: GLSL version: 120
OpenGL: Max texture size: 2048
OpenGL: NPOT texture support: 1
OpenGL: Shader support: 1
OpenGL: Shader support for engines: 1
OpenGL: Multitexture support: 1
OpenGL: FBO support: 0
OpenGL: Multisample FBO support: 0
OpenGL: Multisample max number: -1
OpenGL: Packed pixels support: 1
OpenGL: Packed depth stencil support: 1
OpenGL: Unpack subimage support: 1
OpenGL: OpenGL ES depth 24 support: 0
OpenGL: Texture edge clamping support: 1
OpenGL: Texture border clamping support: 1
OpenGL: Texture mirror repeat support: 1
OpenGL: Texture max level support: 1
Invalid joystick: 0
creating SurfaceSDL graphics manager
creating OpenGL graphics manager
creating OpenGL graphics manager
Using SDL Audio Driver "coreaudio"
Output sample rate: 44100 Hz
Output buffer size: 1024 samples
Output channels: 2
OpenGL: GL context initialized
OpenGL version: 2.0 ATI-1.5.48
OpenGL vendor: ATI Technologies Inc.
OpenGL renderer: ATI Radeon 9600 XT OpenGL Engine
OpenGL: version 2.0
OpenGL: GLSL version string: 1.20
OpenGL: GLSL version: 120
OpenGL: Max texture size: 2048
OpenGL: NPOT texture support: 1
OpenGL: Shader support: 1
OpenGL: Shader support for engines: 1
OpenGL: Multitexture support: 1
OpenGL: FBO support: 0
OpenGL: Multisample FBO support: 0
OpenGL: Multisample max number: -1
OpenGL: Packed pixels support: 1
OpenGL: Packed depth stencil support: 1
OpenGL: Unpack subimage support: 1
OpenGL: OpenGL ES depth 24 support: 0
OpenGL: Texture edge clamping support: 1
OpenGL: Texture border clamping support: 1
OpenGL: Texture mirror repeat support: 1
OpenGL: Texture max level support: 1
WARNING: Libretro is not supported!

Change History (4)

comment:1 by aquadran, 3 weeks ago

Priority: normalblocker

comment:2 by dwatteau, 3 weeks ago

aquadran says on Discord:

it might be related to missing GL_FRAGMENT_PROGRAM_ARB, used in grim to write to zbuffer
but its needed only for classic opengl
without extension access to zbuffer might be very slow
extension in glad needs to be restored

comment:3 by dwatteau, 3 weeks ago

Commit 634bc2811ed98701b26be4bba18ba0d8aa8ae79b has restored the original 60 FPS, thanks!

It can probably be cherry-picked to the 2.9.0 branch if noone objects to it.

comment:4 by lephilousophe, 3 weeks ago

Owner: set to lephilousophe
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.