vkd3d: Avoid passing 0 miplevels to Vulkan.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-01-25 14:52:52 +01:00 committed by Alexandre Julliard
parent fd4f0b0024
commit 2aa7c6b753

View File

@ -623,12 +623,20 @@ HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
{
static const D3D12_HEAP_PROPERTIES heap_properties = {D3D12_HEAP_TYPE_DEFAULT};
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
D3D12_RESOURCE_DESC validated_desc;
VkMemoryRequirements requirements;
VkImage vk_image;
HRESULT hr;
assert(desc->Dimension != D3D12_RESOURCE_DIMENSION_BUFFER);
if (!desc->MipLevels)
{
validated_desc = *desc;
validated_desc.MipLevels = max_miplevel_count(desc);
desc = &validated_desc;
}
/* XXX: We have to create an image to get its memory requirements. */
if (SUCCEEDED(hr = vkd3d_create_image(device, &heap_properties, 0, desc, &vk_image)))
{