Opened 10 months ago

Closed 9 months ago

#14196 closed defect (fixed)

scummvm shaders: strange behavior after add-in a game

Reported by: legluondunet Owned by: lephilousophe
Priority: high Component: Graphics: Scalers
Version: Keywords:
Cc: Game:

Description

Hello ScummVM dev team, I found a bug when using shaders:

When I remove a game then add-it again (or add another game), shaders does no more work and display ingame is broken, for this game and all others games. Other, you can no more change shaders, when you try to change shaders you obtain this error message:
"Failed to apply some of the graphic option changes:
the shader cold not be changed".
All I can do here is to restart ScummVM.

I captured a video where I reproduce this issue:

https://youtu.be/HJg5GcFoN8I

Thank you (again) for your help.

Change History (19)

comment:1 by legluondunet, 10 months ago

some log:

$ ./bin/scummvm -d 6 > scummvm.log
WARNING: Couldn't initialize text to speech through speech-dispatcher!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'gui-icons.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: The overlayed dialog Dialog.Launcher.GameList has not been sized, using a default size for Browser!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: LibRetro Preset Parsing: Error while parsing file 'crt/crt-VGA.glslp': Invalid float value for key 'scale_x0': '1.000000'!
WARNING: Failed to load shader crt/crt-VGA.glslp!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: LibRetro Preset Parsing: Error while parsing file 'crt/crt-VGA.glslp': Invalid float value for key 'scale_x0': '1.000000'!
WARNING: Failed to load shader crt/crt-VGA.glslp!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: The overlayed dialog Dialog.Launcher.GameList has not been sized, using a default size for Browser!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: LibRetro Preset Parsing: Error while parsing file 'crt/crt-VGA.glslp': Invalid float value for key 'scale_x0': '1.000000'!
WARNING: Failed to load shader crt/crt-VGA.glslp!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: LibRetro Preset Parsing: Error while parsing file 'crt/crt-easymode-halation.glslp': Invalid float value for key 'scale_x0': '1.000000'!
WARNING: Failed to load shader crt/crt-easymode-halation.glslp!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: LibRetro Preset Parsing: Error while parsing file 'crt/crt-VGA.glslp': Invalid float value for key 'scale_x0': '1.000000'!
WARNING: Failed to load shader crt/crt-VGA.glslp!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!
WARNING: SearchSet::add: archive 'shaders.dat' already present!

comment:2 by digitall, 10 months ago

Component: --Unset--Graphics: Scalers

comment:3 by legluondunet, 9 months ago

My config:
OS: Manjaro 22.0.2 Sikaris
Kernel: x86_64 Linux 6.1.9-1-MANJARO
CPU: AMD Ryzen 9 5900HX with Radeon Graphics @ 16x 3.3GHz
GPU: AMD Radeon RX 6600M (navi23, LLVM 15.0.7, DRM 3.49, 6.1.9-1-MANJARO)
Video drivers: Mesa 22.3.5

comment:4 by sev-, 9 months ago

So far, I could not reproduce it on my Mac. Will check on Linux.

comment:5 by lotharsm, 9 months ago

I was able to replicate it with the current Snap package from the edge channel, so running 2.8.0git.

I tested with de_DE and en_US as locale to check if there is an issue with the locales, and no changes.

Interestingly, _removal_ of the game is not the issue. The bug is triggered after you add a game and then launch it without restarting ScummVM. As soon as you close ScummVM after adding the game and re-start it, it runs just fine.

On my VM I don't get a completely broken image though, just the usual game graphics without the shaders applied.

I don't get the error message regarding shaders.dat, my log file is quite un-eventful:

OpenGL version: 4.1 (Compatibility Profile) Mesa 21.2.6
OpenGL vendor: VMware, Inc.
OpenGL renderer: SVGA3D; build: RELEASE;  LLVM;
OpenGL: version 4.1
OpenGL: GLSL version string: 4.10
OpenGL: GLSL version: 410
OpenGL: Max texture size: 16384
OpenGL: NPOT texture support: 1
OpenGL: Shader support: 1
OpenGL: Shader support for engines: 1
OpenGL: Multitexture support: 1
OpenGL: FBO support: 1
OpenGL: Multisample FBO support: 1
OpenGL: Multisample max number: 8
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
generateZipSet: Loaded pack file: shaders.dat
Found BASS version v0.0372 (5097 dnr entries)
SKY.CPT with Officer Blunt bug encountered, fixing talk gfx.

comment:6 by lotharsm, 9 months ago

Priority: normalhigh

comment:7 by lotharsm, 9 months ago

@legluondunet have you compiled ScummVM yourself and if so, did you enable the GTK3 integration?

I'm going to re-test ASAP, because it could be related to the GTK3 dialog that appears when adding a game. This would also explain why MacOS and Win32 don't have this issue.

comment:8 by lotharsm, 9 months ago

I'm waiting for confirmation by rebuilding with GTK3 disabled, but I think this is the culprit.

Even if I don't add a game and just trigger the GTK3 file dialog by changing a random path like the Extras path (without saving any changes), support for at least this shader will break.

comment:9 by lotharsm, 9 months ago

Confirmed: This bug is triggered by the GTK3 system dialogs. No matter _which_ dialog I trigger, it will always fail to correctly parse the shader files.

comment:10 by legluondunet, 9 months ago

"have you compiled ScummVM yourself"
Hello lotharsm, yes I compiled it myself, this is my command:

make clean && ./configure --enable-all-engines --disable-debug --enable-release --prefix=$(pwd)/build
mkdir build
make install
cd build
./bin/scummvm

comment:11 by legluondunet, 9 months ago

Running ScummVM configure...
Looking for C++ compiler... g++
Checking if compiler supports C++11... yes
Checking for compiler version... GCC 12.2.1, ok
Checking if C++11 initializer list is available... yes
Checking if C++11 std::nullptr_t is available... yes
Using LLD linker... no
Using Mold linker... no
Checking for whether C++ compiler accepts -Wglobal-constructors... no
Checking for whether C++ compiler accepts -Wno-undefined-var-template... no
Checking for whether C++ compiler accepts -Wno-pragma-pack... no
Checking for whether C++ compiler accepts -Wno-address-of-packed-member... yes
Checking endianness... little
Checking 64-bitness... yes
Type with 1 byte... char
Type with 2 bytes... short
Type with 4 bytes... int
Type with 8 bytes... long
Alignment required... no
Checking host CPU architecture... x86_64
Checking hosttype... linux-gnu
Checking for pkg-config... yes
Looking for sdl-config... /usr/bin/sdl2-config
Checking for SDL... yes
Checking for SDL_Net... yes
Checking if host is POSIX compliant... yes
Checking if posix_spawn is supported... yes
Checking if fseeko with 64-bit off_t is supported... yes
Checking whether to have a verbose build... no
Checking whether building plugins was requested... no
Checking if detection features building statically... yes
Checking if building detection features for all engines... yes
Checking for Ogg... yes
Checking for TTS libraries... yes
Checking for Vorbis... yes
Checking for Tremor... no (Vorbis/Tremor support is mutually exclusive)
Checking for OPL2LPT... no
Checking for RetroWave OPL3... no
Checking for FLAC >= 1.0.1... yes
Checking for MAD... yes
Checking for ALSA >= 0.9... yes
Checking for libjpeg >= v6b... yes
Checking for PNG >= 1.2.8... yes
Checking for GIF >= 5.0.0... yes
Checking for libtheoradec >= 1.0... yes
Checking for libfaad... yes
Checking for SEQ MIDI... yes
Checking for sndio... yes
Checking for TiMidity... yes
Checking for zlib... yes
Checking for libmpeg2 >= 0.4.0... yes
Checking for liba52... yes
Looking for curl-config... /usr/bin/curl-config
Checking for libcurl... yes
Cloud integration... local, servers
Checking for FluidSynth... yes
Checking for FluidLite... no (FluidSynth/FluidLite support is mutually exclusive)
Checking for readline... skipping (text console disabled)
Checking for libunity... no
Checking for gtk... yes
Checking for FreeType2... yes
Checking for OpenGL... yes (runtime detection)
Checking for OpenGL for game... yes (shaders enabled)
Checking for Linux CD-ROM... yes
Checking for curl... yes
Checking for FriBidi... yes
Test C++11 compatibility during compilation... no
Checking for Discord RPC... no
Building translation support... yes (with runtime language detection)
Building taskbar integration support... no
Building system dialogs support... gtk
Building text-to-speech support... speech dispatcher
Building TinyGL support... yes
Building Bink video support... yes
Building updates support... no
Enabling Address Sanitizer... no
Enabling Thread Sanitizer... no
Enabling Undefined Behavior Sanitizer... no
Backend... sdl (2.26.3), 16bit color, high resolution, TinyGL, savegame timestamp, HQ and Edge scalers, aspect ratio correction, MT-32 emulator, Lua, Nuked OPL emulator, cloud

Engines (builtin):

SCUMM [all games]
Access
ADL
AGI
AGOS [all games]
Adventure Game Studio
Sanitarium
Lord Avalot d'Argent
Beavis and Butthead in Virtual Stupidity
Blade Runner
The Journeyman Project 2: Buried in Time
CGE
CGE2
Chamber
Chewy: Esc from F5
Cinematique evo 1
Magic Composer
Cinematique evo 2
Lost Eden
Cryo Omni3D games [all games]
Macromedia Director
Dungeon Master
Dragon History
Blazing Dragons
Drascula: The Vampire Strikes Back
Dreamweb
Escape From Hell
Freescape
Glk Interactive Fiction games
UFOs
Gobli*ns
The Griffon Legend
Grim [all games]
Groovie [all games]
Hades Challenge
Hyperspace Delivery Boy!
Hopkins FBI
Hpl1
Hugo Trilogy
Hypnotix Inc.
In Cold Blood
Illusions Engine
The Immortal
Kingdom: The Far Reaches
Kyra [all games]
Labyrinth of Time
The Last Express
Lilliput
Lure of the Temptress
MacVenture
MADE
MADS [all games]
Might and Magic [all games]
Mohawk [all games]
Mortevielle
mTropolis
Mutation of JB
Myst 3
Nancy Drew
Neverhood
Nikita Game Interface
Parallaction
The Journeyman Project: Pegasus Prime
Red Comrades
Pink Panther
Playground 3d: the testing and playground environment for 3d renderers
Plumbers Don't Wear Ties
The Prince and The Coward
Private Eye
Flight of the Amazon Queen
SAGA [all games]
SAGA2
SCI [all games]
The Lost Files of Sherlock Holmes
Beneath a Steel Sky
Sludge
The Longest Journey
Star Trek 25th Anniversary/Judgment Rites
Mission Supernova
Broken Sword
Broken Sword II
Broken Sword 2.5
Teen Agent
TestBed: the Testing framework
Tetraedge
Tinsel
Starship Titanic
3 Skulls of the Toltecs
Tony Tough and the Night of Roasted Moths
Toonstruck
Touche: The Adventures of the Fifth Musketeer
Trecision Adventure Module
TsAGE
Bud Tucker in Double Trouble
Little Big Adventure
Ultima
V-Cruise
Voyeur
WAGE
Wintermute [all games]
Z-Vision

WARNING: This ScummVM build contains the following UNSTABLE engines:

Lord Avalot d'Argent
Chamber
Lost Eden
Dungeon Master
Escape From Hell
Grim [Escape from Monkey Island]
Hpl1
In Cold Blood
The Immortal
Kingdom: The Far Reaches
The Last Express
Lilliput
MacVenture
MADS [MADS V2]
Might and Magic [Might and Magic 1]
Mohawk [Where in Time is Carmen Sandiego?]
Mutation of JB
Nancy Drew
Playground 3d: the testing and playground environment for 3d renderers
Sludge
Star Trek 25th Anniversary/Judgment Rites
TestBed: the Testing framework
Tetraedge
V-Cruise
WAGE
Wintermute [Wintermute3D]

Creating engines/engines.mk
Creating engines/detection_table.h
Creating engines/plugins_table.h
Creating config.h
Creating config.mk

in reply to:  10 comment:12 by lotharsm, 9 months ago

Replying to legluondunet:

Hello lotharsm, yes I compiled it myself, this is my command:

make clean && ./configure --enable-all-engines --disable-debug --enable-release --prefix=$(pwd)/build

Thank you very much! Can you confirm that

make clean && ./configure --disable-system-dialogs --enable-all-engines --disable-debug --enable-release --prefix=$(pwd)/build

will fix shader support on your end as well?

comment:13 by legluondunet, 9 months ago

I will build today's git without changing anything and try to reproduce the issue.
If I can reproduce this issue, I will compile today's git with "--disable-gtk" option and I will report you result, are you ok with this? Could this help?

comment:14 by lotharsm, 9 months ago

Yep, this would work, thank you! :-)

comment:15 by legluondunet, 9 months ago

results:
1) today's git compiled with this command:

make clean && ./configure --enable-all-engines --disable-debug --enable-release --prefix=$(pwd)/build

--> launch a game, shaders work ok, removing/adding a game, I can reproduce the issue.

2) today's git compiled with this command:

make clean && ./configure --disable-system-dialogs --enable-all-engines --disable-debug --enable-release --prefix=$(pwd)/build

--> launch a game, shaders work ok, removing/adding a game, can not reproduce the issue

Last edited 9 months ago by legluondunet (previous) (diff)

comment:16 by lotharsm, 9 months ago

Thank you, that's exactly what I was afraid of - GTK3 integration breaks the shader compilation. Sigh.

comment:17 by legluondunet, 9 months ago

You quickly identified this bug ! I hope you could fix it easily, I send you good vibes from France :)

comment:18 by elasota, 9 months ago

Investigated this somewhat and what is probably happening is that gtk_init_check calls setlocale and changes the locale to the system locale unless gtk_disable_setlocale. This causes widespread number parsing breakage if the system locale uses a comma decimal separator.

Either gtk_disable_setlocale has to be called prior to gtk_init_check, or the locale has to be changed back.

comment:19 by lephilousophe, 9 months ago

Owner: set to lephilousophe
Resolution: fixed
Status: newclosed

Reproduced, confirmed diagnosis and fixed in commits 772e7364d19e1b03bab230e04c4d71fe8740c6ef (master) and 003853d665d6a8fe5300085a33f10e61d66a6e18 (branch 2.7).
Thanks to rootfather and elasota for the investigation.

Note: See TracTickets for help on using tickets.