6#include <unordered_map>
9#include <unordered_set>
12#include "render/general/pipeline/Pipeline.h"
13#include "shader/general/ShaderMacro.h"
14#include "render/general/pipeline/PipelineSharedPtr.h"
15#include "shader/ComputeShaderInterface.h"
16#include "render/general/pipeline/PipelineType.hpp"
17#include "render/general/pipeline/PipelineConfiguration.h"
18#include "render/general/pipeline/PipelineRegistry.hpp"
19#include "render/general/resource/frame/FrameResourceManager.h"
22#include "vulkan/vulkan_core.h"
28 class ComputeShaderInterface;
91 std::unordered_map<Pipeline*, std::unordered_set<ComputeShaderInterface*>>,
92 static_cast<size_t>(ComputeExecutionGroup::SIZE)>,
93 static_cast<size_t>(ComputeExecutionStage::SIZE)>
135 const std::string& sShaderResourceName,
136 VkDescriptorType descriptorType);
152 const std::string& sShaderResourceName,
153 VkDescriptorType descriptorType,
154 VkImageLayout imageLayout,
182 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
Material* pMaterial);
191 inline std::pair<std::recursive_mutex*, QueuedForExecutionComputeShaders*>
236 std::unordered_map<std::string, std::shared_ptr<Pipeline>>
pipelines;
291 [[nodiscard]] std::optional<Error>
308 inline std::pair<std::recursive_mutex*, QueuedForExecutionComputeShaders*>
325 std::unordered_map<
Pipeline*, std::unordered_set<ComputeShaderInterface*>>& pipelineShaders,
375 std::unordered_map<std::string, ShaderPipelines>& pipelines,
376 const std::string& sShaderNames,
377 const std::set<ShaderMacro>& macrosToUse,
378 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
410 std::unordered_map<std::string, ShaderPipelines>& pipelines,
411 const std::string& sKeyToLookFor,
412 const std::set<ShaderMacro>& macrosToLookFor,
413 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
Definition: ComputeShaderInterface.h:46
Definition: PipelineManager.h:38
PipelineManager * pPipelineManager
Definition: PipelineManager.h:69
void initialize()
Definition: PipelineManager.cpp:473
DelayedPipelineResourcesCreation(PipelineManager *pPipelineManager)
Definition: PipelineManager.h:54
void destroy()
Definition: PipelineManager.cpp:494
static constexpr unsigned int getFrameResourceCount()
Definition: FrameResourceManager.h:74
Definition: GpuResource.h:16
Definition: Material.h:63
Definition: PipelineManager.h:98
void onPipelineNoLongerUsedByComputeShaderInterface(const std::string &sComputeShaderName, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:461
void onPipelineNoLongerUsedByMaterial(const std::string &sPipelineIdentifier)
Definition: PipelineManager.cpp:431
Renderer * getRenderer() const
Definition: PipelineManager.cpp:314
std::optional< Error > bindImageToAllVulkanPipelinesIfUsed(GpuResource *pImageResourceToBind, const std::string &sShaderResourceName, VkDescriptorType descriptorType, VkImageLayout imageLayout, VkSampler pSampler)
Definition: PipelineManager.cpp:51
std::optional< Error > restoreInternalGraphicsPipelinesResources()
Definition: PipelineManager.cpp:340
DelayedPipelineResourcesCreation clearGraphicsPipelinesInternalResourcesAndDelayRestoring()
Definition: PipelineManager.cpp:88
size_t getCurrentGraphicsPipelineCount()
Definition: PipelineManager.cpp:295
std::variant< PipelineSharedPtr, Error > getGraphicsPipelineForMaterial(std::unique_ptr< PipelineConfiguration > pPipelineConfiguration, Material *pMaterial)
Definition: PipelineManager.cpp:118
Renderer *const pRenderer
Definition: PipelineManager.h:423
ComputePipelines computePipelines
Definition: PipelineManager.h:420
std::optional< Error > bindBuffersToAllVulkanPipelinesIfUsed(const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResources, const std::string &sShaderResourceName, VkDescriptorType descriptorType)
Definition: PipelineManager.cpp:17
std::variant< PipelineSharedPtr, Error > findOrCreatePipeline(std::unordered_map< std::string, ShaderPipelines > &pipelines, const std::string &sKeyToLookFor, const std::set< ShaderMacro > ¯osToLookFor, std::unique_ptr< PipelineConfiguration > pPipelineConfiguration, Material *pMaterial)
Definition: PipelineManager.cpp:92
std::variant< PipelineSharedPtr, Error > createGraphicsPipelineForMaterial(std::unordered_map< std::string, ShaderPipelines > &pipelines, const std::string &sShaderNames, const std::set< ShaderMacro > ¯osToUse, std::unique_ptr< PipelineConfiguration > pPipelineConfiguration, Material *pMaterial)
Definition: PipelineManager.cpp:225
virtual ~PipelineManager()
Definition: PipelineManager.cpp:173
std::optional< Error > releaseInternalGraphicsPipelinesResources()
Definition: PipelineManager.cpp:316
std::pair< std::recursive_mutex, GraphicsPipelineRegistry > * getGraphicsPipelines()
Definition: PipelineManager.h:205
size_t getCurrentComputePipelineCount()
Definition: PipelineManager.cpp:310
std::pair< std::recursive_mutex, GraphicsPipelineRegistry > mtxGraphicsPipelines
Definition: PipelineManager.h:417
std::pair< std::recursive_mutex *, QueuedForExecutionComputeShaders * > getComputeShadersForGraphicsQueueExecution()
Definition: PipelineManager.h:192
Definition: Pipeline.h:20
Definition: Renderer.h:43
Definition: PipelineManager.h:234
QueuedForExecutionComputeShaders queuedComputeShaders
Definition: PipelineManager.h:239
std::unordered_map< std::string, std::shared_ptr< Pipeline > > pipelines
Definition: PipelineManager.h:236
Definition: PipelineManager.h:232
size_t getComputePipelineCount()
Definition: PipelineManager.cpp:505
std::variant< PipelineSharedPtr, Error > getComputePipelineForShader(PipelineManager *pPipelineManager, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:510
std::optional< Error > onPipelineNoLongerUsedByComputeShaderInterface(const std::string &sComputeShaderName, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:541
static std::optional< Error > queueComputeShaderInterfaceForExecution(std::unordered_map< Pipeline *, std::unordered_set< ComputeShaderInterface * > > &pipelineShaders, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:603
std::optional< Error > queueShaderExecutionOnGraphicsQueue(ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:579
std::pair< std::recursive_mutex, Resources > mtxResources
Definition: PipelineManager.h:329
std::pair< std::recursive_mutex *, QueuedForExecutionComputeShaders * > getComputeShadersForGraphicsQueueExecution()
Definition: PipelineManager.h:309
Definition: PipelineManager.h:80
std::array< std::array< std::unordered_map< Pipeline *, std::unordered_set< ComputeShaderInterface * > >, static_cast< size_t >(ComputeExecutionGroup::SIZE)>, static_cast< size_t >(ComputeExecutionStage::SIZE)> vGraphicsQueueStagesGroups
Definition: PipelineManager.h:94