Merge branch 'SP3-1-Rendering' into SP3-4-editor

This commit is contained in:
Sri Sham Haran 2022-09-09 14:35:23 +08:00
commit 122dc2f531
2 changed files with 34 additions and 0 deletions

View File

@ -517,6 +517,22 @@ namespace SHADE
return subpasses.at(subpassIndexing[subpassName]);
}
/***************************************************************************/
/*!
\brief
Get the renderpass from the node.
\return
Handle to the renderpass.
*/
/***************************************************************************/
Handle<SHVkRenderpass> SHRenderGraphNode::GetRenderpass(void) const noexcept
{
return renderpass;
}
/***************************************************************************/
/*!
@ -938,4 +954,12 @@ namespace SHADE
ConfigureFramebuffers();
}
Handle<SHRenderGraphNode> SHRenderGraph::GetNode(std::string const& nodeName) const noexcept
{
if (nodeIndexing.contains(nodeName))
return nodes[nodeIndexing.at(nodeName)];
return {};
}
}

View File

@ -180,6 +180,11 @@ namespace SHADE
/*-----------------------------------------------------------------------*/
Handle<SHSubpass> AddSubpass (std::string subpassName) noexcept;
/*-----------------------------------------------------------------------*/
/* SETTERS AND GETTERS */
/*-----------------------------------------------------------------------*/
Handle<SHVkRenderpass> GetRenderpass (void) const noexcept;
friend class SHRenderGraph;
};
@ -227,6 +232,11 @@ namespace SHADE
void AddResource(std::string resourceName, SH_ATT_DESC_TYPE type, uint32_t w = static_cast<uint32_t>(-1), uint32_t h = static_cast<uint32_t>(-1), vk::Format format = vk::Format::eB8G8R8A8Unorm, uint32_t levels = 1, vk::ImageCreateFlagBits createFlags = {});
Handle<SHRenderGraphNode> AddNode (std::string nodeName, std::initializer_list<std::string> resourceNames, std::initializer_list<std::string> predecessorNodes) noexcept;
void Generate (void) noexcept;
/*-----------------------------------------------------------------------*/
/* SETTERS AND GETTERS */
/*-----------------------------------------------------------------------*/
Handle<SHRenderGraphNode> GetNode (std::string const& nodeName) const noexcept;
};
}