]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/commands_backend.cpp
Make it possible to query if a framebuffer can be presented
[libs/gl.git] / source / backends / vulkan / commands_backend.cpp
index 9f53f1ce56f172a060e91bd3cfb102e5c4613c1e..5de0f090a9d774aa7e6c8d76d6dc4ebcf7bc5dd8 100644 (file)
@@ -10,7 +10,6 @@
 #include "rect.h"
 #include "renderpass.h"
 #include "semaphore.h"
-#include "swapchaintexture.h"
 #include "vulkan.h"
 
 using namespace std;
@@ -92,12 +91,7 @@ void VulkanCommands::begin_render_pass(bool clear, const ClearValue *clear_value
        if(!primary_buffer)
                begin_buffer(0);
 
-       fb_is_swapchain = false;
-       unsigned n_attachments = framebuffer->get_format().size();
-       for(unsigned i=0; (!fb_is_swapchain && i<n_attachments); ++i)
-               if(dynamic_cast<const SwapChainTexture *>(framebuffer->get_attachment(i)))
-                       fb_is_swapchain = true;
-
+       fb_is_swapchain = framebuffer->is_presentable();
        framebuffer->refresh();
 
        RenderPass render_pass;