diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp index f26819a60..ce011dcd7 100644 --- a/layer/VkLayer_FROG_gamescope_wsi.cpp +++ b/layer/VkLayer_FROG_gamescope_wsi.cpp @@ -1234,7 +1234,7 @@ namespace GamescopeWSILayer { continue; } - xcb::Prefetcher prefetcher(gamescopeSurface->connection, gamescopeSurface->window); + auto prefetcher = xcb::Prefetcher::GetPrefetcherIf(!gamescopeSurface->isWayland(), gamescopeSurface->connection, gamescopeSurface->window); const bool canBypass = gamescopeSurface->canBypassXWayland(); if (canBypass != gamescopeSwapchain->isBypassingXWayland) UpdateSwapchainResult(canBypass ? VK_SUBOPTIMAL_KHR : VK_ERROR_OUT_OF_DATE_KHR); diff --git a/layer/xcb_helpers.hpp b/layer/xcb_helpers.hpp index 72d0ec092..b7ea9701e 100644 --- a/layer/xcb_helpers.hpp +++ b/layer/xcb_helpers.hpp @@ -16,6 +16,13 @@ namespace xcb { //Note: this class is currently only meant to be used within GamescopeWSILayer::VkDeviceOverrides::QueuePresentKHR: struct Prefetcher { + static std::optional GetPrefetcherIf(bool bCond, xcb_connection_t* connection, const xcb_window_t window) { + if (bCond) + return std::optional(std::in_place_t{}, connection, window); + + return std::nullopt; + } + explicit Prefetcher(xcb_connection_t* connection, const xcb_window_t window) { g_cache = { .window = window,