layer: Dump surface state on creation

This commit is contained in:
Joshua Ashton 2022-12-24 13:42:01 +00:00 committed by Joshie
parent a4f30a87ff
commit 3591f2d4ab

View file

@ -323,7 +323,7 @@ namespace GamescopeWSILayer {
} }
fprintf(stderr, "[Gamescope WSI] Made gamescope surface for xid: 0x%x\n", window); fprintf(stderr, "[Gamescope WSI] Made gamescope surface for xid: 0x%x\n", window);
GamescopeSurface::create(*pSurface, GamescopeSurfaceData { auto gamescopeSurface = GamescopeSurface::create(*pSurface, GamescopeSurfaceData {
.instance = instance, .instance = instance,
.surface = waylandSurface, .surface = waylandSurface,
.connection = connection, .connection = connection,
@ -332,9 +332,20 @@ namespace GamescopeWSILayer {
.hdrOutput = hdrOutput, .hdrOutput = hdrOutput,
}); });
DumpGamescopeSurfaceState(gamescopeSurface);
return result; return result;
} }
static void DumpGamescopeSurfaceState(GamescopeSurface& surface) {
fprintf(stderr, "[Gamescope WSI] Surface state:\n");
fprintf(stderr, " window xid: 0x%x\n", surface->window);
fprintf(stderr, " wayland surface res id: %u\n", wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(surface->surface)));
fprintf(stderr, " layer client flags: 0x%x\n", surface->flags);
fprintf(stderr, " server hdr output enabled: %s\n", surface->hdrOutput ? "true" : "false");
fprintf(stderr, " hdr formats exposed to client: %s\n", surface->shouldExposeHDR() ? "true" : "false");
}
static VkBool32 GetPhysicalDeviceGamescopePresentationSupport( static VkBool32 GetPhysicalDeviceGamescopePresentationSupport(
const vkroots::VkInstanceDispatch* pDispatch, const vkroots::VkInstanceDispatch* pDispatch,
GamescopeInstance& gamescopeInstance, GamescopeInstance& gamescopeInstance,