Commit 6f55c8d1 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use an sRGB fallback format for sRGB formats in wined3d_swapchain_vk_select_vk_format().

parent 97558b65
......@@ -635,6 +635,22 @@ done:
return supported;
}
static VkFormat get_swapchain_fallback_format(VkFormat vk_format)
{
switch (vk_format)
{
case VK_FORMAT_R8G8B8A8_SRGB:
return VK_FORMAT_B8G8R8A8_SRGB;
case VK_FORMAT_R8G8B8A8_UNORM:
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
case VK_FORMAT_R16G16B16A16_SFLOAT:
return VK_FORMAT_B8G8R8A8_UNORM;
default:
WARN("Unhandled format %#x.\n", vk_format);
return VK_FORMAT_UNDEFINED;
}
}
static VkFormat wined3d_swapchain_vk_select_vk_format(struct wined3d_swapchain_vk *swapchain_vk,
VkSurfaceKHR vk_surface)
{
......@@ -684,7 +700,7 @@ static VkFormat wined3d_swapchain_vk_select_vk_format(struct wined3d_swapchain_v
if (i == format_count)
{
/* Try to create a swapchain with format conversion. */
vk_format = VK_FORMAT_B8G8R8A8_UNORM;
vk_format = get_swapchain_fallback_format(vk_format);
WARN("Failed to find Vulkan swapchain format for %s.\n", debug_d3dformat(desc->backbuffer_format));
for (i = 0; i < format_count; ++i)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment