ValveSoftware / gamescope

SteamOS session compositing window manager
Other
2.97k stars 197 forks source link

Enabling HDR with Horizon Forbidden West crashes gamescope #1212

Closed sebastiencaty closed 5 months ago

sebastiencaty commented 5 months ago

I've been able to play games using HDR without issue. Latest working title is A Plague Tale Requiem for example.

While Horizon Forbidden West works ok with Proton Hotfix, trying to enable HDR cause an immediate crash (the game, steam and gamescope). Desktop itself does not crash, no GPU fault either.

Steam log :

[HDR Layer] Created HDR surface
vulkan: Creating Gamescope nested swapchain with format 64 and colorspace 0
[HDR Layer] Creating swapchain for id: 29 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:17] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x5621efb3c670 (res 0x5621efb16850)
wlserver: [xwayland/server.c:273] Xserver is ready
vulkan: Creating Gamescope nested swapchain with format 64 and colorspace 1000104008
[HDR Layer] Creating swapchain for id: 29 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x5621efaf03e0 (res 0x5621efb1a040)
[Gamescope WSI] Creating Gamescope surface: xid: 0x38002c0
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
wlserver: [Gamescope WSI] Made gamescope surface for xid: 0x38002c0
[types/wlr_compositor.c:692] New wlr_surface 0x5621efba3ee0 (res 0x5621efb31a20)[Gamescope WSI] Surface state:

  steam app id:                  2420110
  window xid:                    0x38002c0
  wayland surface res id:        5
  layer client flags:            0x0
  server hdr output enabled:     true
  hdr formats exposed to client: true
[Gamescope WSI] Creating swapchain for xid: 0x38002c0 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Created swapchain for xid: 0x38002c0 - imageCount: 3
[Gamescope WSI] VkHdrMetadataEXT: display primaries:
                                      r: 0.708 0.292
                                      g: 0.17 0.797
                                      b: 0.131 0.046
                                      w: 0.3127 0.329
                                  mastering luminance: min 0.0001 nits, max 47512 nits
                                  maxContentLightLevel: 1498 nits
                                  maxFrameAverageLightLevel: 500 nits
gamescope: ../gamescope-3.14.2/src/backend.h:268: const T& gamescope::BackendBlob::View() const [with T = hdr_metadata_infoframe]: Assertion `sizeof( T ) == m_Data.size()' failed.
(EE) failed to read Wayland events: Connection reset by peer
[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x38002c0.
[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x38002c0.
[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x38002c0.

GPU : 7900 XTX Monitor : AW3423DW Gamescope 3.14.2 VK_hdr_layer : main@f5f13b7 Plasma 6.0.2 Mesa : main@c73c244a Kernel 6.8.0

Joshua-Ashton commented 5 months ago

This should be fixed in master already -- the HDR layer is also not needed anymore.

sebastiencaty commented 5 months ago

Indeed it works well from master and without VK_hdr_layer. Much simpler now.

Awesome work! Thank you so much :)