Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50123 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/utils.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 233cd49209f..22b893b8745 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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; @@ -4182,6 +4182,16 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; if (properties.bufferFeatures & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_TEXTURE; + 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; + } + }
flags = 0; texture_flags = properties.linearTilingFeatures | properties.optimalTilingFeatures;