]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pipelinestate_backend.cpp
Refactor render pass operations into a helper struct
[libs/gl.git] / source / backends / vulkan / pipelinestate_backend.cpp
index 87e03242d329ae90fb66d5346cefe9a4af4e195e..b7e50873aec14f1cb16a841916adb5a6ccfb97cd 100644 (file)
@@ -10,6 +10,7 @@
 #include "pipelinestate_backend.h"
 #include "program.h"
 #include "rect.h"
+#include "renderpass.h"
 #include "sampler.h"
 #include "stenciltest.h"
 #include "structurebuilder.h"
@@ -149,7 +150,9 @@ void VulkanPipelineState::fill_creation_info(vector<char> &buffer) const
        const PipelineState &self = *static_cast<const PipelineState *>(this);
 
        const FrameFormat &format = self.framebuffer->get_format();
-       VkRenderPass render_pass = device.get_pipeline_cache().get_render_pass(format, false, false, false);
+       RenderPass render_pass;
+       render_pass.framebuffer = self.framebuffer;
+       render_pass.update(device);
 
        unsigned n_color_attachments = 0;
        for(FrameAttachment a: format)
@@ -253,7 +256,7 @@ void VulkanPipelineState::fill_creation_info(vector<char> &buffer) const
        pipeline_info->pDepthStencilState = depth_stencil_info;
        pipeline_info->pColorBlendState = blend_info;
        pipeline_info->pDynamicState = dynamic_info;
-       pipeline_info->renderPass = handle_cast<::VkRenderPass>(render_pass);
+       pipeline_info->renderPass = handle_cast<::VkRenderPass>(render_pass.handle);
        pipeline_info->subpass = 0;
 
        if(self.shprog)