6#include <unordered_map>
8#include <unordered_set>
11#include "render/general/pipeline/Pipeline.h"
12#include "shader/general/ShaderMacro.h"
13#include "render/general/pipeline/PipelineSharedPtr.h"
14#include "shader/ComputeShaderInterface.h"
15#include "render/general/pipeline/PipelineConfiguration.h"
16#include "render/general/pipeline/PipelineRegistry.hpp"
17#include "render/general/resource/frame/FrameResourceManager.h"
20#include "vulkan/vulkan_core.h"
26 class ComputeShaderInterface;
47 std::unordered_map<Pipeline*, std::unordered_set<ComputeShaderInterface*>>,
48 static_cast<size_t>(ComputeExecutionGroup::SIZE)>,
49 static_cast<size_t>(ComputeExecutionStage::SIZE)>
59 friend class DelayedPipelineResourcesCreation;
91 const std::string& sShaderResourceName,
92 VkDescriptorType descriptorType);
108 const std::string& sShaderResourceName,
109 VkDescriptorType descriptorType,
110 VkImageLayout imageLayout,
146 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
Material* pMaterial);
155 std::pair<std::recursive_mutex*, QueuedForExecutionComputeShaders*>
200 std::unordered_map<std::string, std::shared_ptr<Pipeline>>
pipelines;
255 [[nodiscard]] std::optional<Error>
272 std::pair<std::recursive_mutex*, QueuedForExecutionComputeShaders*>
289 std::unordered_map<
Pipeline*, std::unordered_set<ComputeShaderInterface*>>& pipelineShaders,
310 std::unordered_map<std::string, ShaderPipelines>& pipelines,
311 const std::string& sShaderNames,
312 const std::set<ShaderMacro>& macrosToUse,
313 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
345 std::unordered_map<std::string, ShaderPipelines>& pipelines,
346 const std::string& sKeyToLookFor,
347 const std::set<ShaderMacro>& macrosToLookFor,
348 std::unique_ptr<PipelineConfiguration> pPipelineConfiguration,
Definition: ComputeShaderInterface.h:46
static constexpr unsigned int getFrameResourceCount()
Definition: FrameResourceManager.h:74
Definition: GpuResource.h:16
Definition: Material.h:63
Definition: PipelineManager.h:54
void onPipelineNoLongerUsedByComputeShaderInterface(const std::string &sComputeShaderName, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:437
void onPipelineNoLongerUsedByMaterial(const std::string &sPipelineIdentifier)
Definition: PipelineManager.cpp:407
Renderer * getRenderer() const
Definition: PipelineManager.cpp:316
std::optional< Error > bindImageToAllVulkanPipelinesIfUsed(GpuResource *pImageResourceToBind, const std::string &sShaderResourceName, VkDescriptorType descriptorType, VkImageLayout imageLayout, VkSampler pSampler)
Definition: PipelineManager.cpp:51
size_t getCurrentGraphicsPipelineCount()
Definition: PipelineManager.cpp:297
std::variant< PipelineSharedPtr, Error > getGraphicsPipelineForMaterial(std::unique_ptr< PipelineConfiguration > pPipelineConfiguration, Material *pMaterial)
Definition: PipelineManager.cpp:113
Renderer *const pRenderer
Definition: PipelineManager.h:358
ComputePipelines computePipelines
Definition: PipelineManager.h:355
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:87
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:227
virtual ~PipelineManager()
Definition: PipelineManager.cpp:175
std::pair< std::recursive_mutex, GraphicsPipelineRegistry > * getGraphicsPipelines()
Definition: PipelineManager.h:169
std::optional< Error > recreateGraphicsPipelinesResources()
Definition: PipelineManager.cpp:318
size_t getCurrentComputePipelineCount()
Definition: PipelineManager.cpp:312
std::pair< std::recursive_mutex, GraphicsPipelineRegistry > mtxGraphicsPipelines
Definition: PipelineManager.h:352
std::pair< std::recursive_mutex *, QueuedForExecutionComputeShaders * > getComputeShadersForGraphicsQueueExecution()
Definition: PipelineManager.h:156
Definition: Pipeline.h:20
Definition: Renderer.h:43
Definition: PipelineManager.h:198
QueuedForExecutionComputeShaders queuedComputeShaders
Definition: PipelineManager.h:203
std::unordered_map< std::string, std::shared_ptr< Pipeline > > pipelines
Definition: PipelineManager.h:200
Definition: PipelineManager.h:196
size_t getComputePipelineCount()
Definition: PipelineManager.cpp:449
std::variant< PipelineSharedPtr, Error > getComputePipelineForShader(PipelineManager *pPipelineManager, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:454
std::optional< Error > onPipelineNoLongerUsedByComputeShaderInterface(const std::string &sComputeShaderName, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:485
static std::optional< Error > queueComputeShaderInterfaceForExecution(std::unordered_map< Pipeline *, std::unordered_set< ComputeShaderInterface * > > &pipelineShaders, ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:547
std::optional< Error > queueShaderExecutionOnGraphicsQueue(ComputeShaderInterface *pComputeShaderInterface)
Definition: PipelineManager.cpp:523
std::pair< std::recursive_mutex, Resources > mtxResources
Definition: PipelineManager.h:293
std::pair< std::recursive_mutex *, QueuedForExecutionComputeShaders * > getComputeShadersForGraphicsQueueExecution()
Definition: PipelineManager.h:273
Definition: PipelineManager.h:36
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:50