From de76045939042d3b2cac2f9137451a367fe4b620 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 21 Jun 2024 21:53:38 +0200 Subject: [PATCH] vulkan: Mark swapchain images as GSK_GPU_IMAGE_SRGB Detect if an SRGB format is in use and mark the images as such. So far this doesn't happen, but once it does, things will work. --- gsk/gpu/gskvulkanimage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gsk/gpu/gskvulkanimage.c b/gsk/gpu/gskvulkanimage.c index 5215dd98a6..59343b194f 100644 --- a/gsk/gpu/gskvulkanimage.c +++ b/gsk/gpu/gskvulkanimage.c @@ -441,6 +441,7 @@ gsk_vulkan_image_new_for_swapchain (GskVulkanDevice *device, gsize height) { GskVulkanImage *self; + GskGpuImageFlags flags = 0; self = g_object_new (GSK_TYPE_VULKAN_IMAGE, NULL); @@ -453,8 +454,11 @@ gsk_vulkan_image_new_for_swapchain (GskVulkanDevice *device, self->vk_image_layout = VK_IMAGE_LAYOUT_UNDEFINED; self->vk_access = 0; + if (format == gdk_memory_format_vk_srgb_format (memory_format)) + flags |= GSK_GPU_IMAGE_SRGB; + /* FIXME: The flags here are very suboptimal */ - gsk_gpu_image_setup (GSK_GPU_IMAGE (self), 0, memory_format, width, height); + gsk_gpu_image_setup (GSK_GPU_IMAGE (self), flags, memory_format, width, height); gsk_vulkan_image_create_view (self, format,