Graphics/FrameGraph: Add support for cubemap and slice rendering

This commit is contained in:
SirLynix
2022-12-02 23:00:44 +01:00
committed by Jérôme Leclercq
parent 4ae3f51174
commit 5a57976b4b
6 changed files with 229 additions and 61 deletions

View File

@@ -16,10 +16,32 @@ namespace Nz
return id;
}
inline std::size_t FrameGraph::AddAttachmentCube(FramePassAttachment attachment)
{
std::size_t id = m_attachments.size();
m_attachments.emplace_back(AttachmentCube{ std::move(attachment) });
return id;
}
inline std::size_t FrameGraph::AddAttachmentCubeFace(std::size_t attachmentId, CubemapFace face)
{
attachmentId = ResolveAttachmentIndex(attachmentId);
assert(std::holds_alternative<AttachmentCube>(m_attachments[attachmentId]));
std::size_t id = m_attachments.size();
m_attachments.emplace_back(AttachmentLayer{
attachmentId,
SafeCast<std::size_t>(face)
});
return id;
}
inline std::size_t FrameGraph::AddAttachmentProxy(std::string name, std::size_t attachmentId)
{
assert(attachmentId < m_attachments.size());
assert(std::holds_alternative<FramePassAttachment>(m_attachments[attachmentId]));
std::size_t id = m_attachments.size();
m_attachments.emplace_back(AttachmentProxy {