WIP Refactoring to move frame rendering from KRCamera to KRRenderGraph

This commit is contained in:
2025-04-10 00:35:39 -07:00
parent 7dc8a1304e
commit 5f286e185e
8 changed files with 167 additions and 97 deletions

View File

@@ -50,7 +50,7 @@ KRSurface::KRSurface(KRContext& context, KrSurfaceHandle handle, void* platformH
, m_frameIndex(0)
, m_renderGraphForward(std::make_unique<KRRenderGraphForward>(context))
, m_renderGraphDeferred(std::make_unique<KRRenderGraphDeferred>(context))
, m_blackFrameRenderGraph(std::make_unique<KRRenderGraphBlackFrame>(context))
, m_renderGraphBlackFrame(std::make_unique<KRRenderGraphBlackFrame>(context))
, m_swapChain(std::make_unique<KRSwapchain>(context))
, m_surfaceFormat{}
{
@@ -118,7 +118,7 @@ void KRSurface::destroy()
std::unique_ptr<KRDevice>& device = m_pContext->getDeviceManager()->getDevice(m_deviceHandle);
m_renderGraphForward->destroy(*device);
m_renderGraphDeferred->destroy(*device);
m_blackFrameRenderGraph->destroy(*device);
m_renderGraphBlackFrame->destroy(*device);
for (int i=0; i < KRENGINE_MAX_FRAMES_IN_FLIGHT; i++) {
if (device && m_renderFinishedSemaphores[i] != VK_NULL_HANDLE) {
@@ -180,7 +180,7 @@ KrResult KRSurface::createSwapChain()
res = m_blackFrameRenderGraph->initialize(*this);
res = m_renderGraphBlackFrame->initialize(*this);
if (res != KR_SUCCESS) {
return res;
}
@@ -262,7 +262,7 @@ void KRSurface::endFrame()
void KRSurface::renderBlackFrame(VkCommandBuffer &commandBuffer)
{
m_blackFrameRenderGraph->render(commandBuffer, *this, nullptr);
m_renderGraphBlackFrame->render(commandBuffer, *this, nullptr);
}
VkFormat KRSurface::getSurfaceFormat() const