-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
WIP: Fix window cannot be transparent when using EGL. #19230
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
base: master
Are you sure you want to change the base?
Conversation
You can test this PR using the following package version. |
IIRC that would break rendering with nvidia driver. |
With recent Linux distros there is a new API for querying a proper X11 visual, but we need a MESA version check + we need to verify if that works with NVIDIA. |
I thought this was just a bug caused by missing logic of EGL in the code. So I just set the I tested this change on the Fantasy 2 GPU (an uncommon GPU from Innosilicon), and this change works correctly. Its driver has bugs when using GLX, which causes program to crash with a So maybe we should add a config to control whether transparency is enabled when using EGL? |
EGL code should check for |
We'll probably need to replace this code with eglGetConfigs/eglGetConfigAttrib calls and add some callbacks in |
I tried add It seems that only the color depth of the X11 Window affects the result. |
|
It's explicitly marked to be ignored https://github.com/anholt/mesa/blob/01e511233b24872b08bff862ff692dfb5b22c1f4/src/egl/main/eglconfig.c#L212C1-L214C41 |
In |
I'd still suggest to attempt enumerating configs manually and find one with 32 bit X11 visual |
I can try it later. But I have a question: even if I don't change any EGL configuration, I only change the depth of the X11 window, transparency works correctly. Moreover, we don't get the X11 visual via EGL now. So what's the purpose of changing the EGL config? |
Using
And visual 21 is 24-bit color depth, visual 42 is 32-bit. Here is the output of
Maybe this is why i get the 0x21 visual. And the |
When I've tried this exact change a couple of years ago it has broken rendering completely (blank window) with some GPU drivers. So we need to do it the correct way. |
@kekekeks Now, I have implemented that retrieving all configurations using I also tried So, maybe a option to force using 32-bit color depth is still necessary. |
What does the pull request do?
Fix window cannot be transparent when using EGL.
What is the current behavior?
If using EGL,
visualInfo
will be null. Then the window will be 24-bit depth, so it cannot be transparent.What is the updated/expected behavior with this PR?
Window can be transparent when using EGL.
How was the solution implemented (if it's not obvious)?
Using
_x11.TransparentVisualInfo
.Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues