diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index 0fe921d3e0..52f6b411d1 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -404,7 +404,7 @@ gdk_vulkan_context_real_init (GInitable *initable, &n_formats, formats); for (i = 0; i < n_formats; i++) { - if (formats[i].format == VK_FORMAT_B8G8R8A8_SRGB) + if (formats[i].format == VK_FORMAT_B8G8R8A8_UNORM) break; } if (i == n_formats) diff --git a/gsk/gskvulkancolorpipeline.c b/gsk/gskvulkancolorpipeline.c index ab6c3e581f..29e44ce7ba 100644 --- a/gsk/gskvulkancolorpipeline.c +++ b/gsk/gskvulkancolorpipeline.c @@ -101,9 +101,9 @@ gsk_vulkan_color_pipeline_collect_vertex_data (GskVulkanColorPipeline *pipeline, instance->rect[1] = rect->origin.y; instance->rect[2] = rect->size.width; instance->rect[3] = rect->size.height; - instance->color[0] = pow (color->red, 2.2); - instance->color[1] = pow (color->green, 2.2); - instance->color[2] = pow (color->blue, 2.2); + instance->color[0] = color->red; + instance->color[1] = color->green; + instance->color[2] = color->blue; instance->color[3] = color->alpha; } diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c index 9ef2c51bf5..4dea8e65ae 100644 --- a/gsk/gskvulkanimage.c +++ b/gsk/gskvulkanimage.c @@ -167,7 +167,7 @@ gsk_vulkan_image_new (GdkVulkanContext *context, .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, .flags = 0, .imageType = VK_IMAGE_TYPE_2D, - .format = VK_FORMAT_B8G8R8A8_SRGB, + .format = VK_FORMAT_B8G8R8A8_UNORM, .extent = { width, height, 1 }, .mipLevels = 1, .arrayLayers = 1, @@ -359,7 +359,7 @@ gsk_vulkan_image_new_from_data_via_staging_buffer (GskVulkanUploader *uploader, uploader->staging_buffer_free_list = g_slist_prepend (uploader->staging_buffer_free_list, staging); - gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_SRGB); + gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM); return self; } @@ -478,7 +478,7 @@ gsk_vulkan_image_new_from_data_via_staging_image (GskVulkanUploader *uploader, uploader->staging_image_free_list = g_slist_prepend (uploader->staging_image_free_list, staging); - gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_SRGB); + gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM); return self; } @@ -521,7 +521,7 @@ gsk_vulkan_image_new_from_data_directly (GskVulkanUploader *uploader, } }); - gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_SRGB); + gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM); return self; } @@ -557,7 +557,7 @@ gsk_vulkan_image_new_for_swapchain (GdkVulkanContext *context, self->height = height; self->vk_image = image; - gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_SRGB); + gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM); return self; } @@ -577,7 +577,7 @@ gsk_vulkan_image_new_for_framebuffer (GdkVulkanContext *context, VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_SRGB); + gsk_vulkan_image_ensure_view (self, VK_FORMAT_B8G8R8A8_UNORM); return self; } diff --git a/gsk/resources/vulkan/color.frag.glsl b/gsk/resources/vulkan/color.frag.glsl index 68d77d72f9..218ee854eb 100644 --- a/gsk/resources/vulkan/color.frag.glsl +++ b/gsk/resources/vulkan/color.frag.glsl @@ -6,5 +6,5 @@ layout(location = 0) out vec4 color; void main() { - color = inColor; + color = vec4(inColor.rgb * inColor.a, inColor.a); }