#include "framebuffer.h"
#include "framebuffer_backend.h"
#include "renderpass.h"
+#include "swapchaintexture.h"
#include "vulkan.h"
using namespace std;
dq.destroy(h);
}
-bool VulkanFramebuffer::is_format_supported(const FrameFormat &fmt)
+bool VulkanFramebuffer::is_format_supported(const FrameFormat &fmt) const
{
const VulkanFunctions &vk = device.get_functions();
for(FrameAttachment a: fmt)
return true;
}
+bool VulkanFramebuffer::is_presentable() const
+{
+ const Framebuffer &self = *static_cast<const Framebuffer *>(this);
+ return std::any_of(self.attachments.begin(), self.attachments.end(),
+ [](const Framebuffer::Attachment &a){ return dynamic_cast<const SwapChainTexture *>(a.tex); });
+}
+
void VulkanFramebuffer::update(unsigned mask) const
{
const Framebuffer &self = *static_cast<const Framebuffer *>(this);
RenderPass render_pass;
render_pass.framebuffer = &self;
+ render_pass.to_present = is_presentable();
render_pass.update(device);
VkFramebufferCreateInfo framebuffer_info = { };