Use correct layout for color attachment

Fixes #1041
This commit is contained in:
Sascha Willems 2023-06-03 16:48:37 +02:00
parent 240a56e441
commit e9288ed57f

View file

@ -1,7 +1,7 @@
/* /*
* Vulkan Example - Using VK_KHR_dynamic_rendering for rendering without framebuffers and render passes (wip) * Vulkan Example - Using VK_KHR_dynamic_rendering for rendering without framebuffers and render passes (wip)
* *
* Copyright (C) 2022 by Sascha Willems - www.saschawillems.de * Copyright (C) 2022-2023 by Sascha Willems - www.saschawillems.de
* *
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/ */
@ -128,7 +128,7 @@ public:
VkRenderingAttachmentInfoKHR colorAttachment{}; VkRenderingAttachmentInfoKHR colorAttachment{};
colorAttachment.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR; colorAttachment.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
colorAttachment.imageView = swapChain.buffers[i].view; colorAttachment.imageView = swapChain.buffers[i].view;
colorAttachment.imageLayout = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR; colorAttachment.imageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE; colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
colorAttachment.clearValue.color = { 0.0f,0.0f,0.0f,0.0f }; colorAttachment.clearValue.color = { 0.0f,0.0f,0.0f,0.0f };