#include "device.h"
#include "framebuffer.h"
#include "framebuffer_backend.h"
+#include "renderpass.h"
#include "vulkan.h"
using namespace std;
++i;
}
- VkRenderPass render_pass = device.get_pipeline_cache().get_render_pass(self.format, false, false, false);
+ RenderPass render_pass;
+ render_pass.framebuffer = &self;
+ render_pass.update(device);
VkFramebufferCreateInfo framebuffer_info = { };
framebuffer_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
- framebuffer_info.renderPass = handle_cast<::VkRenderPass>(render_pass);
+ framebuffer_info.renderPass = handle_cast<::VkRenderPass>(render_pass.handle);
framebuffer_info.attachmentCount = self.format.size();
framebuffer_info.pAttachments = handle_cast<::VkImageView *>(vk_attachments);
framebuffer_info.width = self.width;
void VulkanFramebuffer::prepare_image_layouts(bool discard) const
{
for(const Framebuffer::Attachment &a: static_cast<const Framebuffer *>(this)->attachments)
- a.tex->change_layout(a.level, get_vulkan_attachment_layout(get_components(a.tex->get_format())), discard);
+ a.tex->change_layout(a.level, get_vulkan_attachment_layout(get_components(a.tex->get_format())), (discard && a.layer<0));
}
void VulkanFramebuffer::set_debug_name(const string &name)