Moving from 1.1.0 to trunk breaks Tremulous on my work machine. I get this error:
Sys_Error: GLimp_Init() - could not load OpenGL subsystem
Yes, yes, I know this is usually a bad GL subsystem ... but 1.1.0 works perfectly.
I did some bisecting with SVN, and tracked it down to r778, the import of ioq3 r775. Further testing tracked it down to (sensibly) src/unix/sdl_glimp.c.
Turns out the removal of one line:
===
@@ -626,7 +651,6 @@
tstencilbits = 0;
}
- sdlcolorbits = 4;
if (tcolorbits == 24)
sdlcolorbits = 8;
===
was causing it to crap out. Now, yes, I realize that sdlcolorbits is being initialized at the top of the function, so that line should be irrelevant. But if I compile with it back in the program the game starts up ... otherwise it doesn't.
I'm going to try running trunk/ at home to see if it exhibits the same behaviour, but that said, this is a trivial one-line fix which, while theoretically redundant, fixes a problem without causing any harm. Applying it would be nice. (It should probably go upstream too.)
Created attachment 983[details]
One-line fix for GLX crash in sdl_glimp.c
Here is the fix I mentioned. Utterly trivial, should be unnecessary, but hey.
It does what it needs to do.
Ah ha! Turns out this is NOT a miscompilation by GCC. The problem is that the section of code here is run in a loop ... which should be trying both 4bpc and 8bpc on each iteration. But because it's only set to 4 once, at the top, it ends up always trying 8bpc afterwards, missing potential GLX visual depths. Oops!
This is definitely also an upstream bug, so I'm going to submit it there as well.
Created attachment 983 [details] One-line fix for GLX crash in sdl_glimp.c Here is the fix I mentioned. Utterly trivial, should be unnecessary, but hey. It does what it needs to do.