#include "pipelinestate.h"
#include "rect.h"
#include "semaphore.h"
+#include "swapchaintexture.h"
#include "vulkan.h"
using namespace std;
device.get_transfer_queue().dispatch_transfers(current_buffer);
- // 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);
target->refresh();
return true;
}
+const Texture *VulkanFramebuffer::get_attachment(unsigned i) const
+{
+ return static_cast<const Framebuffer *>(this)->attachments[i].tex;
+}
+
void VulkanFramebuffer::update(unsigned) const
{
const Framebuffer &self = *static_cast<const Framebuffer *>(this);
namespace GL {
class Device;
+class Texture;
class VulkanFramebuffer: public NonCopyable
{
bool is_format_supported(const FrameFormat &);
static void require_layered() { }
+ const Texture *get_attachment(unsigned) const;
void update(unsigned) const;
void require_complete() const { }