On Wed Feb 28 14:04:24 2024 +0000, Rémi Bernon wrote:
We need to provide an EGLConfig when creating a surface, otherwise EGL
wouldn't know which format to use when creating the underlying surface buffers. Yes, but if it doesn't actually make any difference and if a surface with an arbitrary config and a config-less context can be used for any Win32 pixel format, then maybe we could use a generic config (say the most feature-ful one) and save the complexity of surface recreation and pixel format changes?
This is a candid question, which after looking a bit more into Proton fshack I will answer myself. The surface config will change the framebuffer format, which probably needs to match what the applications will expect.
We could perhaps decouple that from the actual surface format, but that would require creating a FBO ourselves, the same way fshack is doing, rendering to a texture which format would match the selected config, and then rendering that texture again to the actual generic surface.
In the future I think it could be a way to get rid of the set_pixel_format shenanigans.