- // TODO Use proper value for to_present
- VkRenderPass render_pass = device.get_pipeline_cache().get_render_pass(target->get_format(), clear, !clear_values, true);
+ bool to_present = false;
+ unsigned n_attachments = target->get_format().size();
+ for(unsigned i=0; i<n_attachments; ++i)
+ if(dynamic_cast<const SwapChainTexture *>(target->VulkanFramebuffer::get_attachment(i)))
+ to_present = true;
+ VkRenderPass render_pass = device.get_pipeline_cache().get_render_pass(target->get_format(), clear, !clear_values, to_present);