| Summary: | [PATCH] SDL_EGL_ChooseConfig: don't fall through if no matching format exists | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Conn O'Griofa <connogriofa> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.1 | Keywords: | target-2.0.14 |
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | [PATCH] SDL_EGL_ChooseConfig: don't fall through if no matching format exists | ||
This is a follow-up to the fix posted for bug 4349. Although the patch for that issue did fix EGL config selection for Raspberry Pi 4, it caused a regression for the VC4 driver of Raspberry Pi 3 (using firmware KMS mode). The reason appears to be that if the driver have an exact match for the underlying format, the function will fall through due to no config being selected (it doesn't even reach the part where a close match is determined). This problem doesn't affect all SDL2 applications, but can be reproduced via lzdoom (https://github.com/drfrag666/gzdoom) or mupen64plus when using the GLideN64 plugin (https://github.com/gonetz/GLideN64). There are probably a lot more examples, but those are two that I can recall off-hand. *if the driver does not have an exact match for the underlying format (apologies for the comment spam) This patch is now https://hg.libsdl.org/SDL/rev/877c5d06c09e, thanks! --ryan. |
Created attachment 3964 [details] [PATCH] SDL_EGL_ChooseConfig: don't fall through if no matching format exists On Raspberry Pi 3 via the VC4 driver in firmware KMS mode, none of the found configs match the desired format, causing the function to fall through without any config being selected. Fix by first iterating over the found configs, and if no match exists, don't exclude the non-matching configs. This should fix RPI3 and possibly other targets without breaking targets that have a matching native format (such as RPI4).