[Scummvm-tracker] [ScummVM :: Bugs] #13215: OpenGLSdlGraphics3dManager::setupScreen() might invoke `glGetIntegerv` without GL context
ScummVM :: Bugs
trac at scummvm.org
Wed Jan 12 13:07:57 UTC 2022
#13215: OpenGLSdlGraphics3dManager::setupScreen() might invoke `glGetIntegerv`
without GL context
-------------------+----------------------------
Reporter: GMTA | Owner: (none)
Type: defect | Status: new
Priority: low | Component: Common
Version: | Resolution:
Keywords: | Game: Grim Fandango
-------------------+----------------------------
Description changed by GMTA:
Old description:
> 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.
New description:
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
--
--
Ticket URL: <https://bugs.scummvm.org/ticket/13215#comment:1>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list