Implement KRRenderGraph::getFinalRenderPass()
This commit is contained in:
@@ -146,6 +146,16 @@ KRRenderPass* KRRenderGraph::getRenderPass(RenderPassType type)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
KRRenderPass* KRRenderGraph::getFinalRenderPass()
|
||||
{
|
||||
for (KRRenderPass* pass : m_renderPasses) {
|
||||
if (pass->isFinal()) {
|
||||
return pass;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void KRRenderGraph::render(VkCommandBuffer &commandBuffer, KRSurface& surface, KRScene* scene)
|
||||
{
|
||||
for(KRRenderPass* pass : m_renderPasses) {
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
int addAttachment(const char* name, VkFormat format);
|
||||
void addRenderPass(KRDevice& device, const RenderPassInfo& info);
|
||||
KRRenderPass* getRenderPass(RenderPassType type);
|
||||
KRRenderPass* getFinalRenderPass();
|
||||
void render(VkCommandBuffer &commandBuffer, KRSurface& surface, KRScene* scene);
|
||||
void destroy(KRDevice& device);
|
||||
|
||||
|
||||
@@ -103,3 +103,8 @@ RenderPassType KRRenderPass::getType() const
|
||||
{
|
||||
return m_info.type;
|
||||
}
|
||||
|
||||
bool KRRenderPass::isFinal() const
|
||||
{
|
||||
return m_info.finalPass;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
void end(VkCommandBuffer& commandBuffer);
|
||||
|
||||
RenderPassType getType() const;
|
||||
bool isFinal() const;
|
||||
|
||||
// private:
|
||||
VkRenderPass m_renderPass;
|
||||
|
||||
@@ -298,7 +298,7 @@ KrResult KRSurface::createSwapChain()
|
||||
return res;
|
||||
}
|
||||
|
||||
m_swapChain->create(*device, m_surface, m_surfaceFormat, depthImageFormat, swapExtent, imageCount, *m_renderGraph->getRenderPass(RenderPassType::RENDER_PASS_FORWARD_OPAQUE));
|
||||
m_swapChain->create(*device, m_surface, m_surfaceFormat, depthImageFormat, swapExtent, imageCount, *m_renderGraph->getFinalRenderPass());
|
||||
|
||||
return KR_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user