On Fri Sep 13 15:10:20 2024 +0000, Paul Gofman wrote:
There wasn't similar things in GL, the API is a bit different, setting a new drawable on the GL context was obsoleting the old one (without a possibility to switch back). I think having multiple vulkan surfaces on a window always resulting in offscreen blitting is too bad actually. This is not so uncommon case in practice, and having any surface created and left resulting in the whole game rendering going through blitting is very unfortunate. Note that it is not what we have in Proton currently: in Proton now we don't blit those but attach client window back if currently offscreen surface is presented. This is also hacky of course but at least works, assuming the apps do not switch presenting to surfaces after each frame (not yet encountered). Offscreen blitting has the issues mentioned above, to mention another, HDR won't work where it currently works in Proton + Gamescope.
This is not what this is doing: this only creates offscreen surfaces for child windows (which currently aren't supported at all), or when DPI scaling is required (in which case we need to scale the surfaces, and that's not doable without indirection). It doesn't change anything wrt. multiple surfaces.
Note that on that matter, upstream simply doesn't allow multiple surfaces to be created on the same window, and any new surface that is created invalidates the previous ones, which I think matches some tests we have.