From ae372f29171c403d6ad78caaa5f509a97d1ce244 Mon Sep 17 00:00:00 2001 From: Brandon Mak Date: Fri, 9 Sep 2022 14:34:09 +0800 Subject: [PATCH] Getter for renderpass in render node --- .../Graphics/RenderGraph/SHRenderGraph.cpp | 24 +++++++++++++++++++ .../src/Graphics/RenderGraph/SHRenderGraph.h | 10 ++++++++ 2 files changed, 34 insertions(+) diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp index a86913e4..68af135f 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp @@ -517,6 +517,22 @@ namespace SHADE return subpasses.at(subpassIndexing[subpassName]); } + /***************************************************************************/ + /*! + + \brief + Get the renderpass from the node. + + \return + Handle to the renderpass. + + */ + /***************************************************************************/ + Handle SHRenderGraphNode::GetRenderpass(void) const noexcept + { + return renderpass; + } + /***************************************************************************/ /*! @@ -938,4 +954,12 @@ namespace SHADE ConfigureFramebuffers(); } + Handle SHRenderGraph::GetNode(std::string const& nodeName) const noexcept + { + if (nodeIndexing.contains(nodeName)) + return nodes[nodeIndexing.at(nodeName)]; + + return {}; + } + } \ No newline at end of file diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h index f81e84bd..dc6b7c42 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h @@ -180,6 +180,11 @@ namespace SHADE /*-----------------------------------------------------------------------*/ Handle AddSubpass (std::string subpassName) noexcept; + /*-----------------------------------------------------------------------*/ + /* SETTERS AND GETTERS */ + /*-----------------------------------------------------------------------*/ + Handle 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(-1), uint32_t h = static_cast(-1), vk::Format format = vk::Format::eB8G8R8A8Unorm, uint32_t levels = 1, vk::ImageCreateFlagBits createFlags = {}); Handle AddNode (std::string nodeName, std::initializer_list resourceNames, std::initializer_list predecessorNodes) noexcept; void Generate (void) noexcept; + + /*-----------------------------------------------------------------------*/ + /* SETTERS AND GETTERS */ + /*-----------------------------------------------------------------------*/ + Handle GetNode (std::string const& nodeName) const noexcept; }; }