ValveSoftware / gamescope

SteamOS session compositing window manager
Other
2.84k stars 189 forks source link

Question: Best practices for Gamescope WSI in Flatpaks #1154

Open cgutman opened 4 months ago

cgutman commented 4 months ago

I'm looking to ship a libplacebo-based Vulkan renderer in Moonlight to support HDR on Steam Deck. This works fine for AppImage, but the Flatpak (which seems to be the recommended distribution method for 3rd party apps on the Deck) lacks access to the host filesystem and therefore cannot load the Gamescope WSI that enables HDR support.

Chiaki4Deck encountered the same issue and solved it by building their Flatpak with --filesystem=host which allows them to reach into the host filesystem and grab the Gamescope WSI libraries. However, this approach is far from ideal. In addition to significantly weakening the Flatpak sandbox's protections, loading host libraries also raises ABI compatibility concerns between libraries in the Flatpak runtime and the host system.

An alternative approach would be to build the Gamescope WSI into the Flatpak itself, which would avoid any ABI concerns but creates Wayland protocol compatibility concerns between the WSI and Gamescope itself. Since these Gamescope Wayland protocols seem to be intended to be for internal use only, this might end up creating a much worse compatibility issue if breaking changes are made to the Wayland protocols.

I was wondering if you could provide some official upstream guidance on how to approach this problem of Gamescope WSI usage inside Flatpaks (or alternatively, HDR support in Flatpaks, which is the reason I've gone down this rabbit hole). I would like to avoid shipping something that's going to break without warning in a Steam Deck update.

Joshua-Ashton commented 4 months ago

Hmmmmmmmmmm, we have historically not provided any versioning checks between these two, despite them being pretty linked.

In future, we could version the gamescope_swapchain protocol and any other totally private protocols more.

I will get back to you.