From a5fbcb28f05c847516600826987516c4005a8e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 24 Oct 2016 13:20:09 +0200 Subject: [PATCH] libs/vkd3d: Set initial image layout to VK_IMAGE_LAYOUT_UNDEFINED for CPU inaccessible images. --- libs/vkd3d/resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 5021632e..43dadd04 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -182,7 +182,9 @@ static HRESULT vkd3d_create_image(struct d3d12_resource *resource, struct d3d12_ image_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; image_info.queueFamilyIndexCount = 0; image_info.pQueueFamilyIndices = NULL; - image_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + + image_info.initialLayout = is_cpu_accessible_heap(heap_properties) ? + VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED; FIXME("Ignoring initial state %#x.\n", initial_state);