Polyphase Game Engine
Loading...
Searching...
No Matches
Pipeline.h
Go to the documentation of this file.
1#pragma once
2
3#if API_VULKAN
4
5#include <vulkan/vulkan.h>
6#include <string>
7#include <vector>
8
9#include "Vertex.h"
10#include "Shader.h"
11
14
15struct VertexConfig
16{
17 VertexType mVertexType = VertexType::Vertex;
18 std::string mVertexShaderPath;
19};
20
21class Pipeline
22{
23
24public:
25
26 Pipeline();
27
28 virtual ~Pipeline();
29
30 void Create(const PipelineState& state, VkPipelineCache cache, VkSpecializationInfo* specInfo = nullptr);
31
32 VkPipeline GetVkPipeline() const;
33
34 void Bind(VkCommandBuffer commandBuffer);
35
36 VkDescriptorSetLayout GetDescriptorSetLayout(uint32_t index);
37 VkPipelineLayout GetPipelineLayout();
38
39 bool IsComputePipeline() const;
40
41 void Destroy();
42
43 void CreateGraphicsPipeline(VkPipelineCache cache, VkSpecializationInfo* specInfo);
44 void CreateComputePipeline(VkPipelineCache cache, VkSpecializationInfo* specInfo);
45
46 void CreateDescriptorSetLayouts();
47 void CreatePipelineLayout();
48
49public:
50
51 VkPipeline mPipeline = VK_NULL_HANDLE;
52 VkPipelineLayout mPipelineLayout = VK_NULL_HANDLE;
53 std::vector<VkDescriptorSetLayout> mDescriptorSetLayouts;
54
55 std::string mName;
56 bool mComputePipeline = false;
57
58 // Really only needed for debugging.
59 PipelineState mState;
60};
61
62#endif // API_VULKAN
VertexType
Definition Vertex.h:7
Definition VulkanTypes.h:30