We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2961

Summary: EGL ChooseConfig selects software renderer on Android
Product: SDL Reporter: mittorn
Component: videoAssignee: Sam Lantinga <slouken>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: 2.0.3   
Hardware: All   
OS: Android (All)   

Description mittorn 2015-04-25 15:14:43 UTC
I set these attributes on Android:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
After that SDL selects Android Pixelflinger intead of hardware GLES renderer on some devices.
It caused by finding config by comparing attributes, that seems to drop all hardware configs. Affected on some PowerVR GPUs.
All other EGL config selection examples uses first config from list, but i don't know how to do that with SDL without modifications in libSDL2.
It's better to add some flag to skip config search or add flag to avoid software rendering (or use ACCELERATED_VISUAL flag to disallow software rendering).
Comment 2 Sam Lantinga 2016-10-08 00:32:47 UTC
Can you provide a patch that gives the behavior you would expect?

Thanks!
Comment 3 mittorn 2016-10-14 17:15:51 UTC
This commit enables egl context select by macro, which is always disabled:
https://github.com/mittorn/SDL-mirror/commit/9c0e1dd819cd8470dd80c9ff5085def223306a16
The only reason when enable it. I think, if it does not work on many android devices, it may be broken on other EGL implementations. Android drivers does return invalid contexts in list, but first context is valid on all devices.
maybe enable macro on all non-android devices?
Comment 4 Sylvain 2016-10-17 08:01:08 UTC
Hi,

Some time ago, there was an analog situation: a bad EGL config was chosen, discarding the correct ones.

See https://bugzilla.libsdl.org/show_bug.cgi?id=2291

I ended up checking all the EGL config, and clearly some were producing a blinking red overlay.

1) I wonder now if adding "SDL_RENDERER_PRESENTVSYNC" would have fixed the issue ? And also if it would fix your issue.


2) I suggest that instead of a pre-processor ifdef, maybe we could add a software SDL Hint to disable the bit-diff.