From fd36cefbe29c883decba583795191a0a7079c1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 28 Mar 2018 15:03:22 +0200 Subject: [PATCH] demos: Do not force sRGB formats for Vulkan swapchains. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following validation error: IMAGE(ERROR): object: 0x0 type: 0 location: 3302 msgCode: 180357110: vkCreateImageView() format VK_FORMAT_B8G8R8A8_UNORM differs from image 6 format VK_FORMAT_B8G8R8A8_SRGB. Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation. The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image' Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- demos/demo_xcb.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/demos/demo_xcb.h b/demos/demo_xcb.h index 4de1149d..9980b506 100644 --- a/demos/demo_xcb.h +++ b/demos/demo_xcb.h @@ -304,17 +304,6 @@ static inline void demo_set_idle_func(struct demo *demo, demo->idle_func = idle_func; } -static inline DXGI_FORMAT demo_get_srgb_format(DXGI_FORMAT format) -{ - switch (format) - { - case DXGI_FORMAT_B8G8R8A8_UNORM: - return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; - default: - return DXGI_FORMAT_UNKNOWN; - } -} - static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *command_queue, struct demo_window *window, const struct demo_swapchain_desc *desc) { @@ -338,7 +327,7 @@ static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *c VkImage *vk_images; VkFormat format; - if ((format = vkd3d_get_vk_format(demo_get_srgb_format(desc->format))) == VK_FORMAT_UNDEFINED) + if ((format = vkd3d_get_vk_format(desc->format)) == VK_FORMAT_UNDEFINED) return NULL; if (FAILED(ID3D12CommandQueue_GetDevice(command_queue, &IID_ID3D12Device, (void **)&d3d12_device)))