Graphics/FrameGraph: Reuse textures if possible

This commit is contained in:
Jérôme Leclercq
2021-12-05 16:53:02 +01:00
parent 3b1bf480e6
commit 4eb96849db
4 changed files with 75 additions and 5 deletions

View File

@@ -38,6 +38,25 @@ namespace Nz
return outputIndex;
}
template<typename F>
void FramePass::ForEachAttachment(F&& func) const
{
for (const auto& input : m_inputs)
func(input.attachmentId);
for (const auto& output : m_outputs)
func(output.attachmentId);
if (m_depthStencilInput != FramePass::InvalidAttachmentId)
{
func(m_depthStencilInput);
if (m_depthStencilOutput != FramePass::InvalidAttachmentId && m_depthStencilOutput != m_depthStencilInput)
func(m_depthStencilOutput);
}
else if (m_depthStencilOutput != FramePass::InvalidAttachmentId)
func(m_depthStencilOutput);
}
inline auto FramePass::GetCommandCallback() const -> const CommandCallback&
{