Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_GL_CONTEXT_DEBUG_FLAG can fail silently on some Android devices #2943

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Android (All), ARM

Comments on the original bug report:

On 2018-07-30 22:50:49 +0000, Jade Macho wrote:

Created attachment 3274
Fix disabling SDL_GL_CONTEXT_DEBUG_FLAG for possibly faulty drivers

First of all, I'm sorry if the version I selected is incorrect. I'm using this mirror, which mirrors the "default" branch by default: https://github.com/spurious/SDL-mirror

When setting the SDL_GL_CONTEXT_DEBUG_FLAG context flag on my Android device powered by an Adreno 305 GPU, the window / context creation fails silently.

libEGL itself logs

E/libEGL  (26984): validate_display:255 error 3008 (EGL_BAD_DISPLAY)

to logcat, but the window / context creation doesn't "fail" (it isn't returning NULL, nor setting an error) before crashing. Specifically, in this state, invoking any GL function obtained via SDL_GL_GetProcAddress, such as glGetString, immediately causes a segmentation fault.

Possibly related and worth noting: Even though neither the GL_KHR_debug nor the EGL_KHR_debug extensions are supported by my GPU, SDL_GL_GetProcAddress("glDebugMessageControlKHR") returns a stub which logs

E/libEGL  (22431): called unimplemented OpenGL ES API

I've thus attached a diff which removes the SDL_GL_CONTEXT_DEBUG_FLAG flag before context creation if the EGL_KHR_debug extension isn't present and if the EGL version is lower than 1.5 (which supposedly includes the extension).
The patch makes SDL lie about the created context, but from what I can tell, this seems to be a driver-related bug in the first place.

On 2018-10-01 16:41:15 +0000, Sam Lantinga wrote:

Fixed, thanks!
https://hg.libsdl.org/SDL/rev/754cd2042e21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant