Shouldn't this be filtered on the opengl32 level (might be the case depending on the comments below)?
It's an x11 restriction. I don't even know if other display drivers expose this information.
Layered windows for instance use 32bpp visual while the default visual is often 24bpp. I'm not sure how or why this currently works for toplevel windows, but I think that what we need here is for the child window to match its toplevel bpp, not necessarily the screen default bpp.
I'm also curious whether there are some restrictions on Windows between parent and child bpp and pixel format enumeration, maybe it would be worth testing?
This is about the visual depth, not the buffer depth. You can have a 32-bit RGBA buffer that only has a 24-bit visual depth. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9322#note_120909