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

@ -309,7 +309,7 @@ public:
imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
// Texture will be sampled in a shader and is also the blit destination
imageCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
@ -329,7 +329,7 @@ public:
cmdBuffer,
tex->image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_PREINITIALIZED,
VK_IMAGE_LAYOUT_UNDEFINED,
tex->imageLayout);
// Create sampler