diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp index 65b0d9ca..5ed17511 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp +++ b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.cpp @@ -493,9 +493,9 @@ namespace SHADE */ /***************************************************************************/ - Handle SHVkLogicalDevice::CreatePipeline(Handle const& pipelineLayoutHdl, SHVkPipelineState const* const state, Handle const& renderpassHdl, Handle subpass, SH_PIPELINE_TYPE type) noexcept + Handle SHVkLogicalDevice::CreateGraphicsPipeline(Handle const& pipelineLayoutHdl, SHVkPipelineState const* const state, Handle const& renderpassHdl, Handle subpass) noexcept { - return SHVkInstance::GetResourceManager().Create (GetHandle(), pipelineLayoutHdl, state, renderpassHdl, subpass, type); + return SHVkInstance::GetResourceManager().Create (GetHandle(), pipelineLayoutHdl, state, renderpassHdl, subpass); } diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.h b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.h index 3a27e4b1..8a197ef8 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.h +++ b/SHADE_Engine/src/Graphics/Devices/SHVkLogicalDevice.h @@ -21,6 +21,7 @@ #include "Graphics/Descriptors/SHVkDescriptorSetLayout.h" #include "Graphics/Images/SHVkImage.h" + namespace SHADE { /*-----------------------------------------------------------------------*/ @@ -171,12 +172,11 @@ namespace SHADE std::string const& shaderName ) noexcept; - Handle CreatePipeline ( + Handle CreateGraphicsPipeline ( Handle const& pipelineLayoutHdl, SHVkPipelineState const* const state, Handle const& renderpassHdl, - Handle subpass, - SH_PIPELINE_TYPE type + Handle subpass ) noexcept; Handle CreateRenderpass (std::span const vkDescriptions, std::vector const& subpasses) noexcept; diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Pipeline/SHPipelineLibrary.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Pipeline/SHPipelineLibrary.cpp index e09a4945..92d832f1 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Pipeline/SHPipelineLibrary.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Pipeline/SHPipelineLibrary.cpp @@ -18,7 +18,7 @@ namespace SHADE auto pipelineLayout = logicalDevice->CreatePipelineLayout(params); // Create the pipeline and configure the default vertex input state - auto newPipeline = logicalDevice->CreatePipeline(pipelineLayout, nullptr, renderpass, subpass, SH_PIPELINE_TYPE::GRAPHICS); + auto newPipeline = logicalDevice->CreateGraphicsPipeline(pipelineLayout, nullptr, renderpass, subpass); newPipeline->GetPipelineState().SetVertexInputState(globalData->GetDefaultViState()); // Actually construct the pipeline diff --git a/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.cpp b/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.cpp index 1c47c21a..c03fd2a7 100644 --- a/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.cpp +++ b/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.cpp @@ -179,7 +179,7 @@ namespace SHADE /*! \brief - Non-default ctor. + Non-default ctor for creating graphics pipeline. \param inLogicalDeviceHdl Needed for creation and destruction. @@ -200,14 +200,12 @@ namespace SHADE The subpass that this pipeline will be used in. If state is not nullptr, this parameter is ignored. - \param type - The type of the pipeline. */ /***************************************************************************/ - SHVkPipeline::SHVkPipeline(Handle const& inLogicalDeviceHdl, Handle const& inPipelineLayout, SHVkPipelineState const* const state, Handle const& renderpassHdl, Handle subpass, SH_PIPELINE_TYPE type) noexcept + SHVkPipeline::SHVkPipeline(Handle const& inLogicalDeviceHdl, Handle const& inPipelineLayout, SHVkPipelineState const* const state, Handle const& renderpassHdl, Handle subpass) noexcept : pipelineState{ } - , pipelineType {type} + , pipelineType {SH_PIPELINE_TYPE::GRAPHICS} , vkPipeline {VK_NULL_HANDLE} , logicalDeviceHdl{ inLogicalDeviceHdl } , pipelineLayout { inPipelineLayout } @@ -250,6 +248,33 @@ namespace SHADE vkPipeline = VK_NULL_HANDLE; } + /***************************************************************************/ + /*! + + \brief + Just to differentiate between compute and graphics pipeline, we will + have a constructor that takes in less parameters; sufficient for the + compute pipeline to be created. + + \param inLogicalDeviceHdl + \param inPipelineLayout + + \return + + */ + /***************************************************************************/ + SHVkPipeline::SHVkPipeline(Handle const& inLogicalDeviceHdl, Handle const& inPipelineLayout) noexcept + : pipelineState{ } + , pipelineType{ SH_PIPELINE_TYPE::COMPUTE } + , vkPipeline{ VK_NULL_HANDLE } + , logicalDeviceHdl{ inLogicalDeviceHdl } + , pipelineLayout{ inPipelineLayout } + , created{ false } + + { + + } + /***************************************************************************/ /*! diff --git a/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.h b/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.h index 6edf0e98..fe55a41e 100644 --- a/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.h +++ b/SHADE_Engine/src/Graphics/Pipeline/SHVkPipeline.h @@ -51,8 +51,10 @@ namespace SHADE Handle const& inPipelineLayout, SHVkPipelineState const* const state, Handle const& renderpassHdl, - Handle subpass, - SH_PIPELINE_TYPE type) noexcept; + Handle subpass) noexcept; + + SHVkPipeline(Handle const& inLogicalDeviceHdl, + Handle const& inPipelineLayout) noexcept; SHVkPipeline (SHVkPipeline&& rhs) noexcept; ~SHVkPipeline (void) noexcept;