Graphics/FrameGraph: Make use of RenderPassCache

This commit is contained in:
Jérôme Leclercq
2021-07-17 21:11:45 +02:00
parent 7e4f624ca7
commit 7fb5109dfa
4 changed files with 13 additions and 1 deletions

View File

@@ -851,7 +851,8 @@ namespace Nz
BuildPhysicalPassDependencies(colorAttachmentCount, depthStencilAttachmentIndex.has_value(), renderPassAttachments, subpassesDesc, subpassesDeps);
m_pending.renderPasses.push_back(renderDevice->InstantiateRenderPass(std::move(renderPassAttachments), std::move(subpassesDesc), std::move(subpassesDeps)));
m_pending.renderPasses.push_back(Graphics::Instance()->GetRenderPassCache().Get(renderPassAttachments, subpassesDesc, subpassesDeps));
//m_pending.renderPasses.push_back(renderDevice->InstantiateRenderPass(std::move(renderPassAttachments), std::move(subpassesDesc), std::move(subpassesDeps)));
physicalPassIndex++;
}

View File

@@ -60,6 +60,7 @@ namespace Nz
if (!m_renderDevice)
throw std::runtime_error("failed to instantiate render device");
m_renderPassCache.emplace(*m_renderDevice);
m_samplerCache.emplace(m_renderDevice);
MaterialPipeline::Initialize();
@@ -78,6 +79,7 @@ namespace Nz
Graphics::~Graphics()
{
MaterialPipeline::Uninitialize();
m_renderPassCache.reset();
m_samplerCache.reset();
m_fullscreenVertexBuffer.reset();
m_fullscreenVertexDeclaration.reset();