Opened 3 years ago
Closed 2 years ago
#13215 closed defect (fixed)
OpenGLSdlGraphics3dManager::setupScreen() might invoke `glGetIntegerv` without GL context
Reported by: | GMTA | Owned by: | lephilousophe |
---|---|---|---|
Priority: | low | Component: | Common |
Version: | Keywords: | ||
Cc: | Game: | Grim Fandango |
Description (last modified by )
When switching from the launcher to an OpenGL game such as Grim Fandango, the GL context is destroyed and then created again. To create a new context, OpenGLSdlGraphics3dManager::setupScreen()
is invoked. Before it actually created a new context, the MSAA sample count is retrieved with:
SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, ¤tSamples);
This in turn invokes glGetIntegerv
. According to the OpenGL spec, invoking any API without an active GL context results in undefined behavior.
While porting ScummVM to SerenityOS, I have had to patch out the above call to make Grim Fandango work at all. This is not a fix but a workaround, but it might be useful for you to see.
A possible solution would be to make sure to only retrieve the samples when a GL context exists.
Related SerenityOS PR: https://github.com/SerenityOS/serenity/pull/11831
Attachments (1)
Change History (3)
by , 3 years ago
Attachment: | 0001-Prevent-call-to-glGetIntegerv-without-context.patch added |
---|
comment:1 by , 3 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in 31caab89e1e7fe6494a4da2fbb743b90bb509450
Thanks.