depth_stencil_ref.attachment = VK_ATTACHMENT_UNUSED;
VkSampleCountFlagBits vk_samples = static_cast<VkSampleCountFlagBits>(get_vulkan_samples(format.get_samples()));
+ VkImageLayout default_layout = (to_present ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
unsigned i = 0;
unsigned color_count = 0;
attachments[i].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
attachments[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
attachments[i].stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE;
- attachments[i].initialLayout = (clear ? VK_IMAGE_LAYOUT_UNDEFINED : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
- attachments[i].finalLayout = (to_present ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ attachments[i].initialLayout = (clear ? VK_IMAGE_LAYOUT_UNDEFINED : default_layout);
+ attachments[i].finalLayout = default_layout;
unsigned attach_pt = get_attach_point(a);
if(attach_pt==get_attach_point(COLOR_ATTACHMENT))