skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 344 forks source link

GLXBadFBConfig with Open GL 3 #1590

Closed ryanteck closed 5 years ago

ryanteck commented 5 years ago
Platform Branch Hash CIDL
Ubuntu 16.04 Master 1b89fcd Git Compiled

Description of the Issue

Reicast does not seem to support OpenGL 3 Cards producing a "glxbadfbconfig" error.

This is repeatable across a few different platforms I own, all with a video card that only supports Open GL 3

Debugging Steps Tested

Logs Gathered

Error details

ryan@ryan-desktop:~/reicast-emulator/shell/linux$ ./reicast_naomi.elf 
Config dir is: /home/ryan/.config/reicast/
Data dir is:   /home/ryan/.local/share/reicast/
Personality: 00000000
Updated personality: 00000000
Linux paging: 4096 00001000 00000FFF
MAP 00800000 w/ 50331648
MAP 20000000 w/ 50331648
MAP 04000000 w/ 33554432
MAP 06000000 w/ 33554432
MAP 0C000000 w/ 0
vmem reserve: base: BC020000, aram: dc020000, vram: C0020000, ram: C8020000
Mem alloc successful!

Found 12 matching FB configs.
Chosen visual ID = 0x21
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  156 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  31
  Current serial number in output stream:  30

GLX Info for version with 4870

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Success with 5870

ryan@ryan-desktop:~/reicast-emulator/shell/linux$ ./reicast_naomi.elf 
Config dir is: /home/ryan/.config/reicast/
Data dir is:   /home/ryan/.local/share/reicast/
Personality: 00000000
Updated personality: 00000000
Linux paging: 4096 00001000 00000FFF
MAP 00800000 w/ 50331648
MAP 20000000 w/ 50331648
MAP 04000000 w/ 33554432
MAP 06000000 w/ 33554432
MAP 0C000000 w/ 0
vmem reserve: base: ECF40000, aram: 0cf40000, vram: F0F40000, ram: F8F40000
Mem alloc successful!

Found 12 matching FB configs.
Chosen visual ID = 0x21
OpenGL version: 4.3 (Core Profile) Mesa 18.0.5
Screen DPI is 96, size 640 x 480. Scaling by 1.00

GLX Version with 5870

ryan@ryan-desktop:~/reicast-emulator/shell/linux$ glxinfo | grep "version"
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL core profile version string: 4.3 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.30
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
flyinghead commented 5 years ago

Can you run reicast with gdb and get me a stack trace so I can figure out where it's failing?

It's actually requesting GL 3.1 so that might be the issue. But it's supposed to print out stuff that I don't see in your log, hence my request.

ryanteck commented 5 years ago

After a discussion on Discord we've come up with a few things.

Seems it could be as much a Graphics Driver issue with older cards rather than Reicast not supporting GL3. I'll do some more debugging and testing and report back.

Log of GLX Info on another computer that it works on.

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.3.2
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.3.2
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.3.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

With some more debugging on a system with OGL 4.5 card, I found the following. Using MESA_GL_VERSION_OVERRIDE= allows me to specify a version, Reicast works down to OGL 4.3 but anything lower and I get the error message (4.2, 4.0, 3.3, 3.0)

I'll give it a try to see if I can override it to use OGL4 on my OGL3 card and report back.

skmp commented 5 years ago

I think the code requires a 3.2 FC contexts

On Thu, 9 May 2019 at 15:44, Ryan Walmsley notifications@github.com wrote:

After a discussion on Discord we've come up with a few things.

Seems it could be as much a Graphics Driver issue with older cards rather than Reicast not supporting GL3. I'll do some more debugging and testing and report back.

Log of GLX Info on another computer that it works on.

server glx version string: 1.4 client glx version string: 1.4 GLX version: 1.4 Max core profile version: 4.5 Max compat profile version: 3.0 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.2 OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.3.2 OpenGL core profile shading language version string: 4.50 OpenGL version string: 3.0 Mesa 18.3.2 OpenGL shading language version string: 1.30 OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.3.2 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

With some more debugging on a system with OGL 4.5 card, I found the following. Using MESA_GL_VERSION_OVERRIDE= allows me to specify a version, Reicast works down to OGL 4.3 but anything lower and I get the error message (4.2, 4.0, 3.3, 3.0)

I'll give it a try to see if I can override it to use OGL4 on my OGL3 card and report back.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/issues/1590#issuecomment-491093957, or mute the thread https://github.com/notifications/unsubscribe-auth/AADAAMUERI56JSET6XRNP5LPUSSOLANCNFSM4HL5KIYA .

ryanteck commented 5 years ago

Well I'm not sure if it is the UI causing it, however when I run with "MESA_GL_VERSION_OVERRIDE=4.3" It works perfectly fine.

Got HOTD2 Naomi working at a smooth 60FPS. I'll leave it up to you if you wish to close the issue.

flyinghead commented 5 years ago

I can reproduce it by asking for an invalid GL version. Instead of falling back to GL 3.1, reicast exits with the same error message.

flyinghead commented 5 years ago

should be fixed by https://github.com/reicast/reicast-emulator/pull/1593

ryanteck commented 5 years ago

Seems to have fixed it on the machine I'm using which supports 4.5 and when setting MESA_GL_VERSION_OVERRIDE=3.3 on it. Will test on the other machine :+1:

ryanteck commented 5 years ago

Tested fine on the 4870 and Mac Mini I also had failures on. Thank you very much for the swift fix @flyinghead