After doing some more research I found a workaround to this issue without any code changes.
Setting the environment variable
force_glsl_extensions_warn=true when launching Supermodel makes texture2DLod errors go away and the game renders just fine using the new 3D engine. No slowdowns or anything. Just a warning: ATTENTION: default value of option force_glsl_extensions_warn overridden by environment.
- Code: Select all
Supermodel: A Sega Model 3 Arcade Emulator (Version 0.3a-WIP)
Copyright 2003-2022 by The Supermodel Team
ATTENTION: default value of option force_glsl_extensions_warn overridden by environment.
Title: Daytona USA 2 - Battle on the Edge (Japan, Revision A)
ROM Set: daytona2
Developer: Sega
Year: 1998
Stepping: 2.1
Extra Hardware: Digital Sound Board (Type DSB2), Drive Board, Net Board, Security Board
According to what I found in the Internet, force_glsl_extensions_warn: let the program use extensions without asking, but warn on use.
In case anyone find this in the future the command line to start Supermodel should look like this:
- Code: Select all
force_glsl_extensions_warn=true <path_to_supermodel_binary> <path_to_rom> <additional_options>
Having said that, I may be wrong because this is all new to me but it seems that on mesa/Linux OpenGL extensions needs to be enable explicitly from the code in order to use texture2DLod function and if not requested by the code they will not be enabled, causing the errors and rendering issues.
This comment I found in an ancient mesa bug report may be interesting and more meaningful for you guys than what I can try to explain with my lack of knownledge on this matter:
https://bugs.freedesktop.org/show_bug.cgi?id=43477#c61. Specifying #version 130 (it doesn't, so it gets 110, which is mandatory spec behavior)
So I went ahead and replaced
#version 120 with
#version 130 in line 6 of Src/Graphics/New3D/R3DShaderTriangles.h and recompiled supermodel.
With this change in place now the texture2DLod errors are gone but the issue is not completely solved as I'm getting a new error:
- Code: Select all
error: fragment shader lacks main
And no 3D graphs rendered. In this scenario, using the workaround mentioned above, also makes everything works fine.
I will keep looking into this and sorry for the long post but I thought this information may be useful for you and other users finding this issue.
Thanks.