-
Notifications
You must be signed in to change notification settings - Fork 1.8k
EGL wxGLCanvas: prefer configs without alpha when EGL_ALPHA_SIZE is zero or not specified. #24395
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
Conversation
…ero or not specified. At least Mesa Iris on Wayland is known to put RGBA5551 and RGBA4444 formats at the start of the config list, even if we didn't request alpha.
Looks good to me, thanks! @swt2c Any objections to applying this?
What has broken it? I thought it did build with it relatively recently... Please open an issue if there was a backwards incompatible change, TIA! |
else | ||
|
||
int requestedAlpha = -1; | ||
for (int i = 0; attrsList[i] != EGL_NONE; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, after looking at this more carefully, I think there is a problem here and this should be
for (int i = 0; attrsList[i] != EGL_NONE; i++) | |
for (int i = 0; attrsList[i] != EGL_NONE; i += 2) |
Shouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless one of the "values" is EGL_ALPHA_SIZE
, it seems fine. But I agree += 2 makes more sense.
if (bestConfig == -1) | ||
bestConfig = i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't we break
here? As written, this selects the last matching config, while I thought the idea was to select the first one. Oops, no, it doesn't, I misread, but it's still not clear why should we continue iterating after finding a match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly a leftover after I was printing all configs.
At least Mesa Iris on Wayland is known to put RGBA5551 and RGBA4444 formats at the start of the config list, even if we didn't request alpha, which is unexpected, so filter them out manually in this case to ensure we get the expected RGB444, as with the other drivers. See wxWidgets#24395. Co-authored-by: Vadim Zeitlin <[email protected]>
It's (still) the string conversion stuff. (30 errors) I'm not sure whether it's best to fix in KiCad or wx. But wrapping everything in wxString() generally doesn't make the code more readable. |
At least Mesa Iris on Wayland is known to put RGBA5551 and RGBA4444 formats at the start of the config list, even if we didn't request alpha, which is unexpected, so filter them out manually in this case to ensure we get the expected RGB888, as with the other drivers. See #24395, #24397. Co-authored-by: Vadim Zeitlin <[email protected]>
Replaced by #24397, merged now, so closing this one.
This is definitely not how I'd fix it, I'd rather just remove |
At least Mesa Iris on Wayland is known to put RGBA5551 and RGBA4444 formats at the start of the config list, even if we didn't request alpha, which is unexpected, so filter them out manually in this case to ensure we get the expected RGB888, as with the other drivers. See wxWidgets#24395, wxWidgets#24397. Co-authored-by: Vadim Zeitlin <[email protected]> (cherry picked from commit ff90bd5)
There's an issue with KiCad when using KDE6 on native Wayland with Intel graphics (Mesa 24.0.2, Iris) causing OpenGL buffers to be transparent.
See KiCad issue: https://gitlab.com/kicad/code/kicad/-/issues/17341
Even if
EGL_ALPHA_SIZE
is not set, when usingeglChooseConfig
, Mesa sorts the list in such a way that configs with alpha are put at the start, and wx only used the first one. In the sorting order this list looks like this:GLFW, for example, either uses the EGL_EXT_present_opaque extension, or if not available,
filters out configs with alpha.
Config list (EGL_LOG_LEVEL=debug, requested depth=8)
eglinfo.txt
This is targeted for 3.2 because KiCad is not buildable with wx master.