11#ifdef CORRELATION_USE_VULKAN
12#include <vulkan/vulkan.h>
19#ifdef CORRELATION_USE_VULKAN
26class VulkanPipelineManager {
28 VulkanPipelineManager() noexcept = default;
29 ~VulkanPipelineManager() noexcept { destroy(); }
31 VulkanPipelineManager(
const VulkanPipelineManager &) =
delete;
32 VulkanPipelineManager &operator=(
const VulkanPipelineManager &) =
delete;
34 VulkanPipelineManager(VulkanPipelineManager &&other)
noexcept { moveFrom(other); }
35 VulkanPipelineManager &operator=(VulkanPipelineManager &&other)
noexcept {
49 [[nodiscard]]
bool initialize(VkDevice device, VkRenderPass render_pass);
54 void destroy() noexcept;
56 [[nodiscard]] VkPipeline spherePipeline() const noexcept {
return sphere_pipeline_; }
57 [[nodiscard]] VkPipeline haloPipeline() const noexcept {
return halo_pipeline_; }
58 [[nodiscard]] VkPipeline cylinderPipeline() const noexcept {
return cylinder_pipeline_; }
59 [[nodiscard]] VkPipeline wireframePipeline() const noexcept {
return wireframe_pipeline_; }
60 [[nodiscard]] VkPipelineLayout pipelineLayout() const noexcept {
return pipeline_layout_; }
61 [[nodiscard]] VkDescriptorSetLayout descriptorSetLayout() const noexcept {
62 return descriptor_set_layout_;
64 [[nodiscard]]
bool isValid() const noexcept {
return sphere_pipeline_ != VK_NULL_HANDLE; }
67 void moveFrom(VulkanPipelineManager &other)
noexcept;
68 [[nodiscard]] VkShaderModule createShaderModule(std::span<const uint32_t> spv_code)
const;
69 [[nodiscard]]
bool createDescriptorSetLayout();
70 [[nodiscard]]
bool createPipelineLayout();
71 [[nodiscard]]
bool createSpherePipeline(VkRenderPass render_pass);
72 [[nodiscard]]
bool createHaloPipeline(VkRenderPass render_pass);
73 [[nodiscard]]
bool createSphereOrHaloPipeline(VkRenderPass render_pass,
74 std::span<const uint32_t> frag_spv,
75 bool depth_write_enable, VkPipeline &out_pipeline);
76 [[nodiscard]]
bool createCylinderPipeline(VkRenderPass render_pass);
77 [[nodiscard]]
bool createWireframePipeline(VkRenderPass render_pass);
79 VkDevice device_{VK_NULL_HANDLE};
80 VkDescriptorSetLayout descriptor_set_layout_{VK_NULL_HANDLE};
81 VkPipelineLayout pipeline_layout_{VK_NULL_HANDLE};
82 VkPipeline sphere_pipeline_{VK_NULL_HANDLE};
83 VkPipeline halo_pipeline_{VK_NULL_HANDLE};
84 VkPipeline cylinder_pipeline_{VK_NULL_HANDLE};
85 VkPipeline wireframe_pipeline_{VK_NULL_HANDLE};
Definition VulkanComputeService.hpp:24