From 7b7533420eca64a859209f782e3ef2689afb3a23 Mon Sep 17 00:00:00 2001 From: Brandon Mak Date: Tue, 18 Oct 2022 01:12:03 +0800 Subject: [PATCH] WIP --- .../MiddleEnd/Interface/SHGraphicsConstants.h | 6 ++ .../MiddleEnd/Interface/SHGraphicsSystem.cpp | 75 ++++++++++++++----- .../MiddleEnd/Interface/SHGraphicsSystem.h | 19 +++-- .../MiddleEnd/Interface/SHMousePickSystem.cpp | 3 + .../MiddleEnd/Interface/SHRenderer.cpp | 11 ++- .../Graphics/RenderGraph/SHRenderGraph.cpp | 15 ++-- .../src/Graphics/RenderGraph/SHRenderGraph.h | 3 +- .../RenderGraph/SHRenderGraphNode.cpp | 15 ++-- .../Graphics/RenderGraph/SHRenderGraphNode.h | 4 +- .../src/Graphics/RenderGraph/SHSubpass.cpp | 6 +- .../src/Graphics/RenderGraph/SHSubpass.h | 2 +- .../Graphics/Renderpass/SHVkRenderpass.cpp | 3 +- SHADE_Engine/src/Resource/SparseSet.h | 6 +- 13 files changed, 118 insertions(+), 50 deletions(-) diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h index ac2f1f8c..67cbc001 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsConstants.h @@ -25,6 +25,12 @@ namespace SHADE struct SHGraphicsConstants { public: + struct RenderGraphIndices + { + static constexpr uint32_t WORLD = 0; + static constexpr uint32_t EDITOR = 0; + }; + struct DescriptorSetIndex { /***************************************************************************/ diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index d5a45cf7..929e5d54 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -119,7 +119,6 @@ namespace SHADE /*-----------------------------------------------------------------------*/ auto windowDims = window->GetWindowSize(); - SHGraphicsGlobalData::Init(device); // Set Up Cameras screenCamera = resourceManager.Create(); @@ -134,7 +133,7 @@ namespace SHADE defaultViewport = AddViewport(vk::Viewport(0.0f, 0.0f, static_cast(window->GetWindowSize().first), static_cast(window->GetWindowSize().second), 0.0f, 1.0f)); // Get render graph from default viewport world renderer - sceneRenderGraph = resourceManager.Create(); + worldRenderGraph = resourceManager.Create(); std::vector> renderContextCmdPools{ swapchain->GetNumImages() }; for (uint32_t i = 0; i < renderContextCmdPools.size(); ++i) @@ -143,35 +142,36 @@ namespace SHADE } // Initialize world render graph - sceneRenderGraph->Init(device, swapchain); - sceneRenderGraph->AddResource("Present", { SH_ATT_DESC_TYPE_FLAGS::COLOR_PRESENT }, windowDims.first, windowDims.second); - sceneRenderGraph->AddResource("Scene", { SH_ATT_DESC_TYPE_FLAGS::COLOR, SH_ATT_DESC_TYPE_FLAGS::INPUT }, windowDims.first, windowDims.second); - sceneRenderGraph->AddResource("Depth Buffer", { SH_ATT_DESC_TYPE_FLAGS::DEPTH_STENCIL }, windowDims.first, windowDims.second, vk::Format::eD32SfloatS8Uint); - sceneRenderGraph->AddResource("Entity ID", { SH_ATT_DESC_TYPE_FLAGS::COLOR }, windowDims.first, windowDims.second, vk::Format::eR32Uint, 1, vk::ImageUsageFlagBits::eTransferSrc); + worldRenderGraph->Init(device, swapchain); + //worldRenderGraph->AddResource("Present", { SH_ATT_DESC_TYPE_FLAGS::COLOR_PRESENT }, windowDims.first, windowDims.second); + worldRenderGraph->AddResource("Scene", { SH_ATT_DESC_TYPE_FLAGS::COLOR, SH_ATT_DESC_TYPE_FLAGS::INPUT }, windowDims.first, windowDims.second); + worldRenderGraph->AddResource("Depth Buffer", { SH_ATT_DESC_TYPE_FLAGS::DEPTH_STENCIL }, windowDims.first, windowDims.second, vk::Format::eD32SfloatS8Uint); + worldRenderGraph->AddResource("Entity ID", { SH_ATT_DESC_TYPE_FLAGS::COLOR }, windowDims.first, windowDims.second, vk::Format::eR32Uint, 1, vk::ImageUsageFlagBits::eTransferSrc); - auto node = sceneRenderGraph->AddNode("G-Buffer", { "Entity ID", "Depth Buffer", "Scene" }, {}); // no predecessors + auto node = worldRenderGraph->AddNode("G-Buffer", { /*"Present", */"Entity ID", "Depth Buffer", "Scene"}, {}); // no predecessors //First subpass to write to G-Buffer auto gBufferWriteSubpass = node->AddSubpass("G-Buffer Write"); gBufferWriteSubpass->AddColorOutput("Scene"); gBufferWriteSubpass->AddColorOutput("Entity ID"); + //gBufferWriteSubpass->AddColorOutput("Present"); gBufferWriteSubpass->AddDepthOutput("Depth Buffer", SH_ATT_DESC_TYPE_FLAGS::DEPTH_STENCIL); // We do this to just transition our scene layout to shader read auto sceneLayoutTransitionSubpass = node->AddSubpass("Scene Layout Transition"); sceneLayoutTransitionSubpass->AddInput("Scene"); -#ifdef SHEDITOR - auto imguiNode = sceneRenderGraph->AddNode("ImGui Node", { "Present" }, { "G-Buffer" }); - auto imguiSubpass = imguiNode->AddSubpass("ImGui Draw"); - imguiSubpass->AddColorOutput("Present"); -#endif +//#ifdef SHEDITOR +// auto imguiNode = worldRenderGraph->AddNode("ImGui Node", { "Present" }, { "G-Buffer" }); +// auto imguiSubpass = imguiNode->AddSubpass("ImGui Draw"); +// imguiSubpass->AddColorOutput("Present"); +//#endif // Generate world render graph - sceneRenderGraph->Generate(); + worldRenderGraph->Generate(); // Add world renderer to default viewport - worldRenderer = defaultViewport->AddRenderer(resourceManager, swapchain->GetNumImages(), renderContextCmdPools, descPool, SHGraphicsGlobalData::GetDescSetLayouts()[SHGraphicsConstants::DescriptorSetIndex::HIGH_FREQUENCY_GLOBALS], sceneRenderGraph); + worldRenderer = defaultViewport->AddRenderer(resourceManager, swapchain->GetNumImages(), renderContextCmdPools, descPool, SHGraphicsGlobalData::GetDescSetLayouts()[SHGraphicsConstants::DescriptorSetIndex::HIGH_FREQUENCY_GLOBALS], worldRenderGraph); worldRenderer->SetCamera(worldCamera); @@ -192,8 +192,14 @@ namespace SHADE void SHGraphicsSystem::InitMiddleEnd(void) noexcept { + SHGraphicsGlobalData::Init(device); + InitSceneRenderGraph(); +#ifdef SHEDITOR + InitEditorRenderGraph(); +#endif + // Create Semaphore for (auto& semaHandle : graphSemaphores) { @@ -211,13 +217,45 @@ namespace SHADE for (uint32_t i = 0; i < swapchain->GetNumImages(); ++i) cmdPools.push_back(renderContext.GetFrameData(i).cmdPoolHdls[0]); - mousePickSystem->Init(device, cmdPools, sceneRenderGraph->GetRenderGraphResource("Entity ID")); + mousePickSystem->Init(device, cmdPools, worldRenderGraph->GetRenderGraphResource("Entity ID")); // Register the post offscreen render to the system postOffscreenRender = resourceManager.Create(); - postOffscreenRender->Init(device, sceneRenderGraph->GetRenderGraphResource("Scene"), descPool); + postOffscreenRender->Init(device, worldRenderGraph->GetRenderGraphResource("Scene"), descPool); } +#ifdef SHEDITOR + void SHGraphicsSystem::InitEditorRenderGraph(void) noexcept + { + auto windowDims = window->GetWindowSize(); + + // Create Default Viewport + editorViewport = AddViewport(vk::Viewport(0.0f, 0.0f, static_cast(windowDims.first), static_cast(windowDims.second), 0.0f, 1.0f)); + + // Get render graph from viewport editor renderer + editorRenderGraph = resourceManager.Create(); + + std::vector> renderContextCmdPools{ swapchain->GetNumImages() }; + for (uint32_t i = 0; i < renderContextCmdPools.size(); ++i) + renderContextCmdPools[i] = renderContext.GetFrameData(i).cmdPoolHdls[0]; + + editorRenderGraph->Init(device, swapchain); + editorRenderGraph->AddResource("Present", { SH_ATT_DESC_TYPE_FLAGS::COLOR_PRESENT }, windowDims.first, windowDims.second); + + + auto imguiNode = editorRenderGraph->AddNode("ImGui Node", { "Present"}, {}); + auto imguiSubpass = imguiNode->AddSubpass("ImGui Draw"); + imguiSubpass->AddColorOutput("Present"); + + // Generate world render graph + editorRenderGraph->Generate(); + + // Add world renderer to default viewport + editorRenderer = editorViewport->AddRenderer(resourceManager, swapchain->GetNumImages(), renderContextCmdPools, descPool, SHGraphicsGlobalData::GetDescSetLayouts()[SHGraphicsConstants::DescriptorSetIndex::HIGH_FREQUENCY_GLOBALS], editorRenderGraph); + editorRenderer->SetCamera(worldCamera); + } +#endif + /*---------------------------------------------------------------------------------*/ /* Constructor/Destructors */ /*---------------------------------------------------------------------------------*/ @@ -664,7 +702,8 @@ namespace SHADE renderContext.HandleResize(); - sceneRenderGraph->HandleResize(resizeWidth, resizeHeight); + worldRenderGraph->HandleResize(resizeWidth, resizeHeight); + editorRenderGraph->HandleResize(windowDims.first, windowDims.second); mousePickSystem->HandleResize(); postOffscreenRender->HandleResize(); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h index e6739715..0e1e2f78 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.h @@ -68,10 +68,14 @@ namespace SHADE class SH_API SHGraphicsSystem : public SHSystem { private: - void InitBoilerplate (void) noexcept; - void InitSceneRenderGraph(void) noexcept; - void InitMiddleEnd (void) noexcept; - void InitSubsystems (void) noexcept; + void InitBoilerplate (void) noexcept; + void InitSceneRenderGraph (void) noexcept; + void InitMiddleEnd (void) noexcept; + void InitSubsystems (void) noexcept; + +#ifdef SHEDITOR + void InitEditorRenderGraph (void) noexcept; +#endif public: class SH_API BeginRoutine final : public SHSystemRoutine @@ -277,6 +281,9 @@ namespace SHADE Handle GetQueue() const { return graphicsQueue; } Handle GetDescriptorPool() const { return descPool; } Handle GetDefaultViewport() const {return defaultViewport;} +#ifdef SHEDITOR + Handle GetEditorViewport () const {return editorViewport;}; +#endif Handle GetMousePickSystem(void) const noexcept {return mousePickSystem;}; Handle GetPostOffscreenRenderSystem(void) const noexcept {return postOffscreenRender;}; //SHRenderGraph const& GetRenderGraph(void) const noexcept; @@ -306,7 +313,7 @@ namespace SHADE SHWindow* window = nullptr; // Middle End Resources - ResourceManager resourceManager; + ResourceManager resourceManager; SHMeshLibrary meshLibrary; SHTextureLibrary texLibrary; SHSamplerCache samplerCache; @@ -339,7 +346,7 @@ namespace SHADE // Temp Materials Handle defaultMaterial; - Handle sceneRenderGraph; + Handle worldRenderGraph; // Sub systems Handle mousePickSystem; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHMousePickSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHMousePickSystem.cpp index e4ac92e5..1dd8212d 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHMousePickSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHMousePickSystem.cpp @@ -62,7 +62,10 @@ namespace SHADE void SHMousePickSystem::HandleResize(void) noexcept { if (afterCopyFence) + { + afterCopyFence->Reset(); afterCopyFence.Free(); + } if (imageDataDstBuffer) imageDataDstBuffer.Free(); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHRenderer.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHRenderer.cpp index 14af56ee..425e9c81 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHRenderer.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHRenderer.cpp @@ -75,12 +75,15 @@ namespace SHADE void SHRenderer::UpdateDataAndBind(Handle cmdBuffer, uint32_t frameIndex) noexcept { - cpuCameraData.viewProjectionMatrix = camera->GetViewProjectionMatrix(); - cameraBuffer->WriteToMemory(&cpuCameraData, sizeof(SHShaderCameraData), 0, cameraDataAlignedSize * frameIndex); + if (camera) + { + cpuCameraData.viewProjectionMatrix = camera->GetViewProjectionMatrix(); + cameraBuffer->WriteToMemory(&cpuCameraData, sizeof(SHShaderCameraData), 0, cameraDataAlignedSize * frameIndex); - std::array dynamicOffsets{ frameIndex * cameraDataAlignedSize }; + std::array dynamicOffsets{ frameIndex * cameraDataAlignedSize }; - cmdBuffer->BindDescriptorSet(cameraDescriptorSet, vk::PipelineBindPoint::eGraphics, SHGraphicsConstants::DescriptorSetIndex::HIGH_FREQUENCY_GLOBALS, std::span{ dynamicOffsets.data(), 1 }); + cmdBuffer->BindDescriptorSet(cameraDescriptorSet, vk::PipelineBindPoint::eGraphics, SHGraphicsConstants::DescriptorSetIndex::HIGH_FREQUENCY_GLOBALS, std::span{ dynamicOffsets.data(), 1 }); + } } void SHRenderer::UpdateCameraDataToBuffer(void) noexcept diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp index 51584300..98cb6709 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.cpp @@ -57,7 +57,7 @@ namespace SHADE format = swapchainHdl->GetSurfaceFormatKHR().format; } - graphResources.try_emplace(resourceName, resourceManager.Create(logicalDeviceHdl, swapchainHdl, resourceName, typeFlags, format, w, h, levels, usageFlags, createFlags)); + graphResources.try_emplace(resourceName, resourceManager->Create(logicalDeviceHdl, swapchainHdl, resourceName, typeFlags, format, w, h, levels, usageFlags, createFlags)); } /***************************************************************************/ @@ -102,11 +102,11 @@ namespace SHADE resourceAttLayouts[input.attachment] = input.layout; } - for (uint32_t i = 0; i < node->attachmentDescriptions.size(); ++i) + for (uint32_t j = 0; j < node->attachmentDescriptions.size(); ++j) { - auto& att = node->attachmentDescriptions[i]; + auto& att = node->attachmentDescriptions[j]; att.initialLayout = vk::ImageLayout::eUndefined; - att.finalLayout = resourceAttLayouts[i]; + att.finalLayout = resourceAttLayouts[j]; } ++i; } @@ -365,10 +365,9 @@ namespace SHADE , swapchainHdl{ } , nodes{} , graphResources{} - , resourceManager{} - + , resourceManager{nullptr} { - + resourceManager = std::make_shared(); } SHRenderGraph::SHRenderGraph(SHRenderGraph&& rhs) noexcept @@ -457,7 +456,7 @@ namespace SHADE } } - nodes.emplace_back(resourceManager.Create(resourceManager, logicalDeviceHdl, swapchainHdl, std::move(descInitParams), std::move(predecessors), &graphResources)); + nodes.emplace_back(resourceManager->Create(resourceManager, logicalDeviceHdl, swapchainHdl, std::move(descInitParams), std::move(predecessors), &graphResources)); nodeIndexing.emplace(nodeName, static_cast(nodes.size()) - 1u); return nodes.at(nodeIndexing[nodeName]); } diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h index 8eb458aa..952c6d8f 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraph.h @@ -16,6 +16,7 @@ #include #include +#include namespace SHADE { @@ -70,7 +71,7 @@ namespace SHADE std::unordered_map> graphResources; //! Resource library for graph handles - ResourceManager resourceManager; + std::shared_ptr resourceManager; public: /*-----------------------------------------------------------------------*/ diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.cpp b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.cpp index 0ff8fe96..ec184386 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.cpp +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.cpp @@ -104,7 +104,7 @@ namespace SHADE */ /***************************************************************************/ - SHRenderGraphNode::SHRenderGraphNode(ResourceManager& rm, Handle const& logicalDevice, Handle const& swapchain, std::vector attDescInitParams, std::vector> predecessors, std::unordered_map> const* resources) noexcept + SHRenderGraphNode::SHRenderGraphNode(std::shared_ptr rm, Handle const& logicalDevice, Handle const& swapchain, std::vector attDescInitParams, std::vector> predecessors, std::unordered_map> const* resources) noexcept : logicalDeviceHdl{ logicalDevice } , renderpass{} , framebuffers{} @@ -162,7 +162,7 @@ namespace SHADE } SHRenderGraphNode::SHRenderGraphNode(SHRenderGraphNode&& rhs) noexcept - : resourceManager{ rhs.resourceManager } + : resourceManager{ std::move (rhs.resourceManager) } , logicalDeviceHdl{ rhs.logicalDeviceHdl } , renderpass{ rhs.renderpass } , framebuffers{ std::move(rhs.framebuffers) } @@ -177,6 +177,8 @@ namespace SHADE , ptrToResources{ rhs.ptrToResources } , pipelineLibrary{ std::move(rhs.pipelineLibrary) } , batcher{ std::move(rhs.batcher) } + , spDescs{ std::move(rhs.spDescs) } + , spDeps{ std::move(rhs.spDeps) } { rhs.renderpass = {}; @@ -187,7 +189,7 @@ namespace SHADE if (&rhs == this) return *this; - resourceManager = rhs.resourceManager; + resourceManager = std::move(rhs.resourceManager); logicalDeviceHdl = rhs.logicalDeviceHdl; renderpass = rhs.renderpass; framebuffers = std::move(rhs.framebuffers); @@ -200,6 +202,9 @@ namespace SHADE ptrToResources = std::move(rhs.ptrToResources); pipelineLibrary = std::move(rhs.pipelineLibrary); batcher = std::move(rhs.batcher); + spDescs = std::move(rhs.spDescs); + spDeps = std::move(rhs.spDeps); + rhs.renderpass = {}; @@ -230,10 +235,10 @@ namespace SHADE } // Add subpass to container and create mapping for it - subpasses.emplace_back(resourceManager.Create(resourceManager, GetHandle(), subpasses.size(), &resourceAttachmentMapping, ptrToResources)); + subpasses.emplace_back(resourceManager->Create(GetHandle(), subpasses.size(), &resourceAttachmentMapping, ptrToResources)); subpassIndexing.try_emplace(subpassName, static_cast(subpasses.size()) - 1u); Handle subpass = subpasses.back(); - subpass->Init(resourceManager); + subpass->Init(*resourceManager); // Register the SuperBatch batcher.RegisterSuperBatch(subpass->GetSuperBatch()); diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.h b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.h index f36e7622..77861108 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.h +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHRenderGraphNode.h @@ -26,7 +26,7 @@ namespace SHADE /*-----------------------------------------------------------------------*/ /* PRIVATE MEMBER VARIABLES */ /*-----------------------------------------------------------------------*/ - ResourceManager& resourceManager; + std::shared_ptr resourceManager; //! For Vulkan object creation Handle logicalDeviceHdl; @@ -88,7 +88,7 @@ namespace SHADE /*-----------------------------------------------------------------------*/ /* CTORS AND DTORS */ /*-----------------------------------------------------------------------*/ - SHRenderGraphNode(ResourceManager& rm, Handle const& logicalDevice, Handle const& swapchain, std::vector attDescInitParams, std::vector> predecessors, std::unordered_map> const* resources) noexcept; + SHRenderGraphNode(std::shared_ptr rm, Handle const& logicalDevice, Handle const& swapchain, std::vector attDescInitParams, std::vector> predecessors, std::unordered_map> const* resources) noexcept; SHRenderGraphNode(SHRenderGraphNode&& rhs) noexcept; SHRenderGraphNode& operator= (SHRenderGraphNode&& rhs) noexcept; diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.cpp b/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.cpp index 6afbfb09..ffbe4ff0 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.cpp +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.cpp @@ -23,7 +23,7 @@ namespace SHADE */ /***************************************************************************/ - SHSubpass::SHSubpass(ResourceManager& rm, Handle const& parent, uint32_t index, std::unordered_map const* mapping, std::unordered_map> const* resources) noexcept + SHSubpass::SHSubpass(Handle const& parent, uint32_t index, std::unordered_map const* mapping, std::unordered_map> const* resources) noexcept : resourceAttachmentMapping{ mapping } , ptrToResources{ resources } , parentNode{ parent } @@ -55,6 +55,8 @@ namespace SHADE , inputReferences{ std::move(rhs.inputReferences) } , resourceAttachmentMapping{ rhs.resourceAttachmentMapping } , ptrToResources{ rhs.ptrToResources } + , descriptorSetLayout{ rhs.descriptorSetLayout } + , exteriorDrawCalls{ std::move (rhs.exteriorDrawCalls) } { } @@ -83,6 +85,8 @@ namespace SHADE inputReferences = std::move(rhs.inputReferences); resourceAttachmentMapping = rhs.resourceAttachmentMapping; ptrToResources = rhs.ptrToResources; + descriptorSetLayout = rhs.descriptorSetLayout; + exteriorDrawCalls = std::move(rhs.exteriorDrawCalls); return *this; } diff --git a/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.h b/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.h index 2e883ebc..c567a897 100644 --- a/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.h +++ b/SHADE_Engine/src/Graphics/RenderGraph/SHSubpass.h @@ -62,7 +62,7 @@ namespace SHADE /*-----------------------------------------------------------------------*/ /* CTORS AND DTORS */ /*-----------------------------------------------------------------------*/ - SHSubpass(ResourceManager& rm, Handle const& parent, uint32_t index, std::unordered_map const* mapping, std::unordered_map> const* ptrToResources) noexcept; + SHSubpass(Handle const& parent, uint32_t index, std::unordered_map const* mapping, std::unordered_map> const* ptrToResources) noexcept; SHSubpass(SHSubpass&& rhs) noexcept; SHSubpass& operator=(SHSubpass&& rhs) noexcept; diff --git a/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp b/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp index fee23f13..74128ec8 100644 --- a/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp +++ b/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp @@ -253,7 +253,8 @@ namespace SHADE SHVkRenderpass::~SHVkRenderpass(void) noexcept { - logicalDeviceHdl->GetVkLogicalDevice().destroyRenderPass(vkRenderpass, nullptr); + if (vkRenderpass) + logicalDeviceHdl->GetVkLogicalDevice().destroyRenderPass(vkRenderpass, nullptr); } diff --git a/SHADE_Engine/src/Resource/SparseSet.h b/SHADE_Engine/src/Resource/SparseSet.h index 8a3f9c6e..fb4a8311 100644 --- a/SHADE_Engine/src/Resource/SparseSet.h +++ b/SHADE_Engine/src/Resource/SparseSet.h @@ -59,9 +59,9 @@ namespace SHADE SparseSet(); ~SparseSet() = default; - // Disallow moving or copying - SparseSet(const SparseSet&) = delete; - SparseSet(SparseSet&&) = delete; + //// Disallow moving or copying + //SparseSet(const SparseSet&) = delete; + //SparseSet(SparseSet&&) = delete; /*-----------------------------------------------------------------------------*/ /* Usage Functions */