Skip to content

Commit

Permalink
layer: Add GAMESCOPE_WSI_FORCE_BYPASS
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Dec 13, 2023
1 parent a2f8db9 commit 3e14ef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions layer/VkLayer_FROG_gamescope_wsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ namespace GamescopeWSILayer {
static GamescopeLayerClient::Flags defaultLayerClientFlags(uint32_t appid) {
GamescopeLayerClient::Flags flags = 0;

const char *bypassEnv = getenv("GAMESCOPE_WSI_FORCE_BYPASS");
if (bypassEnv && *bypassEnv && atoi(bypassEnv) != 0)
flags |= GamescopeLayerClient::Flag::ForceBypass;

// My Little Pony: A Maretime Bay Adventure picks a HDR colorspace if available,
// but does not render as HDR at all.
if (appid == 1600780)
Expand Down Expand Up @@ -169,6 +173,13 @@ namespace GamescopeWSILayer {
return false;
}

// Some games do things like have a 1280x800 top-level window and
// a 1280x720 child window for "fullscreen".
// To avoid Glamor work on the XWayland side of things, have a
// flag to force bypassing this.
if (!!(flags & GamescopeLayerClient::Flag::ForceBypass))
return true;

// If we have any child windows obscuring us bigger than 1x1,
// then we cannot flip.
// (There can be dummy composite redirect windows and whatever.)
Expand Down
1 change: 1 addition & 0 deletions src/layer_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace GamescopeLayerClient
// GAMESCOPE_LAYER_CLIENT_FLAGS
namespace Flag {
static constexpr uint32_t DisableHDR = 1u << 0;
static constexpr uint32_t ForceBypass = 1u << 1;
}
using Flags = uint32_t;
}

0 comments on commit 3e14ef9

Please sign in to comment.