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_GetProcAddress can use wrong library on Android #2791

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 1 comment
Closed

SDL_GL_GetProcAddress can use wrong library on Android #2791

SDLBugzilla opened this issue Feb 11, 2021 · 1 comment
Labels
waiting Waiting on user response

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.7
Reported for operating system, platform: Android (All), All

Comments on the original bug report:

On 2018-01-11 10:06:02 +0000, Richard Russell wrote:

If SDL creates an OpenGLES 1 context, for example as a result of this hint:

SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengles") ;

subsequent calls to SDL_GL_GetProcAddress (on Android) search the libGLESv2.so library rather than the correct libGLESv1.so library. This results in NULL being returned for functions which don't exist in OpenGLES 2 (such as glLogicOp) and probably an incorrect address being returned for other functions.

The simplest solution is for SDL to call 'eglGetProcAddress' which is guaranteed to use the correct library. Currently the code to do this (in SDL_egl.c) is disabled, apparently because of a bug in Android. However that bug was supposedly fixed in 2010 so it may be that the conditional test can be removed, or at least be made dependent on the version of Android.

If the current 'fallback' code is retained, it will need to be changed to test what rendering context has been created (which may not always be what the user requested) and select the appropriate library accordingly.

On 2019-06-09 01:41:52 +0000, Sam Lantinga wrote:

Sylvain believes he has fixed this here:
https://hg.libsdl.org/SDL/rev/00a1aa5a1fc0

Can you double check?

Also, Sylvain, I believe we can re-enable the code to call eglGetProcAddress(), if that's the right solution here.

On 2019-06-09 14:07:15 +0000, Sylvain wrote:

From bug 4040, bug 4041 :

https://hg.libsdl.org/SDL/rev/00a1aa5a1fc0

It should now unload/re-load the correct EGL libs so that SDL_GL_GetProcAddress can get them.

but eglGetProcAddress is still busted and remains un-activated on android https://hg.libsdl.org/SDL/file/00fb5966c44f/src/video/SDL_egl.c#l216 (see test case on bug 4040)

@SDLBugzilla SDLBugzilla added bug waiting Waiting on user response labels Feb 11, 2021
@slouken slouken removed the bug label May 11, 2022
@icculus
Copy link
Collaborator

icculus commented Sep 9, 2023

(Bugzilla bug 4040 is #2789, 4141 is #2790)

I think the consensus was that the fixes made were "good enough" and it wasn't worth going further with. Time to close this bug?

@slouken slouken closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting on user response
Projects
None yet
Development

No branches or pull requests

3 participants