Use undefined initial image layout (fixes #187), added missing layout transition for compute texture target in ray tracing example

This commit is contained in:
saschawillems 2016-06-22 20:30:14 +02:00
parent 00560f06b5
commit dbf80b217c
7 changed files with 39 additions and 34 deletions

View file

@ -226,7 +226,7 @@ public:
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
imageCreateInfo.extent = { textureArray.width, textureArray.height, 1 };
imageCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
imageCreateInfo.arrayLayers = layerCount;
@ -255,7 +255,7 @@ public:
copyCmd,
textureArray.image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_PREINITIALIZED,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
subresourceRange);