Do you see any other way out of this? I mean specifically the case when an app sets GL pixel format itself on a window. I was thinking about whether it is possible to make setpixelformat quicker in winex11 instead and I don't see how. If keeping direct presentation it will require some X window reconfigure which is not going to be anywhere quick. Otherwise, it can be technically made to work like for GL child window redering (keeping composite redirected drawables for different pixel formats) but that requires essentially the same blitting on each present as done with wined3d backup context.
The other different (but a bit complicated) way would be to:
- count statistics of GL pixel format switches;
- introduce switching back from backup context and switch between resetting pixel format or switching to backup context or back based on that.
Assuming that recreating the GLX drawable is always worse than a GDI blit, I think this patch is the right direction. I just don't want to regress performance in backends other than x11.
So maybe the right approach here is to add some boolean flag saying "return an error if changing the pixel format would be expensive". Or maybe things are already broken on winemac and the right approach is just to punt.