aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-02-28 14:25:58 +1300
committerChris Forbes <chrisf@ijw.co.nz>2017-03-01 09:52:42 +1300
commitbba73cd799889bb48a2b6f6f750a5005cc5ac068 (patch)
tree64c08b59e4c8230e201425bfefa052c2699eaf69 /layers/core_validation.cpp
parenta9ba746a78e4e0025f04ca9f4ebcbf1282a93145 (diff)
downloadusermoji-bba73cd799889bb48a2b6f6f750a5005cc5ac068.tar.xz
layers: Fix state recorded for swapchain images
Reorder the fields to match the declaration, initialize tiling & type. Previously the image type ended up as VK_IMAGE_TYPE_1D due to the default initialization, which caused bad behavior in later validation. Fixes #1508. Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index c7327f7e..daa0360d 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -10606,13 +10606,16 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchai
image_layout_node.format = swapchain_node->createInfo.imageFormat;
// Add imageMap entries for each swapchain image
VkImageCreateInfo image_ci = {};
- image_ci.mipLevels = 1;
- image_ci.arrayLayers = swapchain_node->createInfo.imageArrayLayers;
- image_ci.usage = swapchain_node->createInfo.imageUsage;
+ image_ci.flags = 0;
+ image_ci.imageType = VK_IMAGE_TYPE_2D;
image_ci.format = swapchain_node->createInfo.imageFormat;
- image_ci.samples = VK_SAMPLE_COUNT_1_BIT;
image_ci.extent.width = swapchain_node->createInfo.imageExtent.width;
image_ci.extent.height = swapchain_node->createInfo.imageExtent.height;
+ image_ci.mipLevels = 1;
+ image_ci.arrayLayers = swapchain_node->createInfo.imageArrayLayers;
+ image_ci.samples = VK_SAMPLE_COUNT_1_BIT;
+ image_ci.tiling = VK_IMAGE_TILING_OPTIMAL;
+ image_ci.usage = swapchain_node->createInfo.imageUsage;
image_ci.sharingMode = swapchain_node->createInfo.imageSharingMode;
dev_data->imageMap[pSwapchainImages[i]] = unique_ptr<IMAGE_STATE>(new IMAGE_STATE(pSwapchainImages[i], &image_ci));
auto &image_state = dev_data->imageMap[pSwapchainImages[i]];