vkd3d: Use the resource's stored format in vkd3d_create_image().

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2022-01-18 14:58:59 +10:00 committed by Alexandre Julliard
parent 16393e10d5
commit 70d87dcf37

View File

@ -855,7 +855,11 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
VkImageCreateInfo image_info;
VkResult vr;
if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0)))
if (resource)
{
format = resource->format;
}
else if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0)))
{
WARN("Invalid DXGI format %#x.\n", desc->Format);
return E_INVALIDARG;