wined3d: Use VK_FORMAT_D24_UNORM_S8_UINT when available.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50123
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit e4bc4df09f)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Matteo Bruni 2021-03-10 20:50:15 +01:00 committed by Michael Stefaniuc
parent 597a3b414e
commit 43e4f4b81e
1 changed files with 12 additions and 1 deletions

View File

@ -4142,7 +4142,7 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format,
{WINED3DFMT_D32_FLOAT_S8X24_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT, },
{WINED3DFMT_R32_FLOAT_X8X24_TYPELESS, VK_FORMAT_D32_SFLOAT_S8_UINT, },
{WINED3DFMT_X32_TYPELESS_G8X24_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT, },
{WINED3DFMT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT, },
{WINED3DFMT_D24_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, },
};
VkFormat vk_format = VK_FORMAT_UNDEFINED;
VkImageFormatProperties image_properties;
@ -4177,6 +4177,17 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format,
format->f.color_fixup = COLOR_FIXUP_IDENTITY;
VK_CALL(vkGetPhysicalDeviceFormatProperties(vk_physical_device, vk_format, &properties));
if (vk_format == VK_FORMAT_D24_UNORM_S8_UINT)
{
if (~properties.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)
{
/* AMD doesn't support VK_FORMAT_D24_UNORM_S8_UINT. */
WARN("Mapping VK_FORMAT_D24_UNORM_S8_UINT to VK_FORMAT_D32_SFLOAT_S8_UINT.\n");
format->vk_format = vk_format = VK_FORMAT_D32_SFLOAT_S8_UINT;
VK_CALL(vkGetPhysicalDeviceFormatProperties(vk_physical_device, vk_format, &properties));
}
}
if (properties.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT)
format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE;