diff options
| author | Karl Schultz <karl@lunarg.com> | 2018-09-11 16:23:14 -0600 |
|---|---|---|
| committer | Karl Schultz <karl@lunarg.com> | 2018-09-12 09:03:10 -0600 |
| commit | e88bc84edea639d028cfd8f37abd6875016fa70c (patch) | |
| tree | 4831c79f49932f9db31d617d8467f250c8414aa4 | |
| parent | 31030a11a6425701566d8f5194b528f4d911eab5 (diff) | |
| download | usermoji-e88bc84edea639d028cfd8f37abd6875016fa70c.tar.xz | |
cube: Fix new validation error
As of Vulkan-ValidationLayers commit 2872f4a, the layers now check that
image layouts specified in descriptors match the current image layout
state. LAYOUT_GENERAL is not a wildcard for this matching.
Change the image layouts for the combined image sampler descriptors
from LAYOUT_GENERAL to LAYOUT_SHADER_READ_ONLY_OPTIMAL.
| -rw-r--r-- | cube/cube.c | 2 | ||||
| -rw-r--r-- | cube/cube.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/cube/cube.c b/cube/cube.c index 8edbd656..ea9517e8 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -2046,7 +2046,7 @@ static void demo_prepare_descriptor_set(struct demo *demo) { for (unsigned int i = 0; i < DEMO_TEXTURE_COUNT; i++) { tex_descs[i].sampler = demo->textures[i].sampler; tex_descs[i].imageView = demo->textures[i].view; - tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL; + tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; } memset(&writes, 0, sizeof(writes)); diff --git a/cube/cube.cpp b/cube/cube.cpp index 65cce400..6ff11900 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -1825,7 +1825,7 @@ void Demo::prepare_descriptor_set() { for (uint32_t i = 0; i < texture_count; i++) { tex_descs[i].setSampler(textures[i].sampler); tex_descs[i].setImageView(textures[i].view); - tex_descs[i].setImageLayout(vk::ImageLayout::eGeneral); + tex_descs[i].setImageLayout(vk::ImageLayout::eShaderReadOnlyOptimal); } vk::WriteDescriptorSet writes[2]; |
