From 9fde7553571cf184820d213649bd7a61d9205eca Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 3 Oct 2025 21:03:06 +0200 Subject: [PATCH] kopper: disable color management for wayland surfaces Otherwise clients cannot use color management themselves. Signed-off-by: Julian Orth Part-of: --- src/gallium/drivers/zink/zink_instance.py | 1 + src/gallium/drivers/zink/zink_kopper.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_instance.py b/src/gallium/drivers/zink/zink_instance.py index 9de653ab820..5c747209978 100755 --- a/src/gallium/drivers/zink/zink_instance.py +++ b/src/gallium/drivers/zink/zink_instance.py @@ -47,6 +47,7 @@ EXTENSIONS = [ Extension("VK_KHR_wayland_surface"), Extension("VK_KHR_xcb_surface"), Extension("VK_KHR_win32_surface"), + Extension("VK_EXT_swapchain_colorspace"), ] if platform.system() == "Darwin": diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 7d563c55aae..934085c44ff 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -282,7 +282,10 @@ kopper_CreateSwapchain(struct zink_screen *screen, struct kopper_displaytarget * cswap->scci.surface = cdt->surface; cswap->scci.flags = zink_kopper_has_srgb(cdt) ? VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR : 0; cswap->scci.imageFormat = cdt->formats[0]; - cswap->scci.imageColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; + if (cdt->type == KOPPER_WAYLAND) + cswap->scci.imageColorSpace = VK_COLOR_SPACE_PASS_THROUGH_EXT; + else + cswap->scci.imageColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; // TODO: This is where you'd hook up stereo cswap->scci.imageArrayLayers = 1; cswap->scci.imageUsage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |