=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d: Avoid passing 0 miplevels to Vulkan.
Alexandre Julliard
julliard at winehq.org
Fri Jan 25 16:05:12 CST 2019
Module: vkd3d
Branch: master
Commit: 2aa7c6b753aa184575da3ca1a0fab009b90d7021
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=2aa7c6b753aa184575da3ca1a0fab009b90d7021
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Fri Jan 25 14:52:52 2019 +0100
vkd3d: Avoid passing 0 miplevels to Vulkan.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d/resource.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 75a5201..6eba450 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -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)))
{
More information about the wine-cvs
mailing list