Add error handling for KRRenderGraphBlackFrame::Initialize failure
This commit is contained in:
@@ -44,7 +44,7 @@ KRRenderGraphBlackFrame::~KRRenderGraphBlackFrame()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRRenderGraphBlackFrame::initialize(KRSurface &surface)
|
KrResult KRRenderGraphBlackFrame::initialize(KRSurface &surface)
|
||||||
{
|
{
|
||||||
VkFormat depthImageFormat = VK_FORMAT_UNDEFINED;
|
VkFormat depthImageFormat = VK_FORMAT_UNDEFINED;
|
||||||
KrResult res = KR_SUCCESS;
|
KrResult res = KR_SUCCESS;
|
||||||
@@ -64,4 +64,6 @@ void KRRenderGraphBlackFrame::initialize(KRSurface &surface)
|
|||||||
info.finalPass = true;
|
info.finalPass = true;
|
||||||
info.type = RenderPassType::RENDER_PASS_BLACK_FRAME;
|
info.type = RenderPassType::RENDER_PASS_BLACK_FRAME;
|
||||||
addRenderPass(*surface.getDevice(), info);
|
addRenderPass(*surface.getDevice(), info);
|
||||||
|
|
||||||
|
return KR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,6 @@ public:
|
|||||||
KRRenderGraphBlackFrame(KRContext& context);
|
KRRenderGraphBlackFrame(KRContext& context);
|
||||||
~KRRenderGraphBlackFrame();
|
~KRRenderGraphBlackFrame();
|
||||||
|
|
||||||
void initialize(KRSurface& surface);
|
KrResult initialize(KRSurface& surface);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -293,7 +293,10 @@ KrResult KRSurface::createSwapChain()
|
|||||||
m_renderGraph->addRenderPass(*device, info);
|
m_renderGraph->addRenderPass(*device, info);
|
||||||
|
|
||||||
|
|
||||||
m_blackFrameRenderGraph->initialize(*this);
|
res = m_blackFrameRenderGraph->initialize(*this);
|
||||||
|
if (res != KR_SUCCESS) {
|
||||||
|
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->getRenderPass(RenderPassType::RENDER_PASS_FORWARD_OPAQUE));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user