Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_pipelinebuilder.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../foray_basics.hpp"
4#include "../foray_vulkan.hpp"
5#include "../scene/foray_geo.hpp"
6#include <vector>
7
8namespace foray::util {
9
15 {
16 public:
17 PipelineBuilder() = default;
18 ~PipelineBuilder() = default;
21
22 VkPipeline Build();
23
24 FORAY_PROPERTY_V(Context)
25 FORAY_PROPERTY_V(RenderPass)
26 FORAY_PROPERTY_V(CullMode)
27 FORAY_PROPERTY_V(PolygonMode)
28 FORAY_PROPERTY_V(DynamicStates)
30 FORAY_PROPERTY_V(DepthTestEnable)
31 FORAY_PROPERTY_V(DepthWriteEnable)
32 FORAY_PROPERTY_V(ColorBlendAttachmentStates)
33 FORAY_PROPERTY_V(SampleCountFlags)
34 FORAY_PROPERTY_V(VertexInputStateBuilder)
35 FORAY_PROPERTY_V(PrimitiveTopology)
37 FORAY_PROPERTY_V(PipelineCache)
38 FORAY_PROPERTY_V(ColorAttachmentBlendCount)
39
40 protected:
42
43 VkPipelineLayout mPipelineLayout{};
44
45 VkPrimitiveTopology mPrimitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
46 VkRenderPass mRenderPass{};
47 std::vector<VkPipelineShaderStageCreateInfo>* mShaderStageCreateInfos{};
48 VkCullModeFlags mCullMode{VK_CULL_MODE_BACK_BIT};
49 VkPolygonMode mPolygonMode{VK_POLYGON_MODE_FILL};
50 const std::vector<VkDynamicState>* mDynamicStates{};
51 std::vector<VkPipelineColorBlendAttachmentState>* mColorBlendAttachmentStates{};
52 VkBool32 mDepthTestEnable{VK_TRUE};
53 VkBool32 mDepthWriteEnable{VK_TRUE};
54 VkSampleCountFlags mSampleCountFlags{0};
56 VkPipelineCache mPipelineCache{};
58 };
59
60} // namespace foray::util
Class to quickly build a default pipeline. Ownership is transfered to caller. TODO: THIS CLASS SHOULD...
Definition foray_pipelinebuilder.hpp:15
VkRenderPass mRenderPass
Definition foray_pipelinebuilder.hpp:46
VkCullModeFlags mCullMode
Definition foray_pipelinebuilder.hpp:48
VkSampleCountFlags mSampleCountFlags
Definition foray_pipelinebuilder.hpp:54
VkPrimitiveTopology mPrimitiveTopology
Definition foray_pipelinebuilder.hpp:45
PipelineBuilder(const PipelineBuilder &)=delete
VkPipelineLayout mPipelineLayout
Definition foray_pipelinebuilder.hpp:43
core::Context * mContext
Definition foray_pipelinebuilder.hpp:41
const std::vector< VkDynamicState > * mDynamicStates
Definition foray_pipelinebuilder.hpp:50
VkBool32 mDepthWriteEnable
Definition foray_pipelinebuilder.hpp:53
PipelineBuilder & operator=(const PipelineBuilder &)=delete
VkPipelineCache mPipelineCache
Definition foray_pipelinebuilder.hpp:56
std::vector< VkPipelineShaderStageCreateInfo > * mShaderStageCreateInfos
Definition foray_pipelinebuilder.hpp:47
scene::VertexInputStateBuilder * mVertexInputStateBuilder
Definition foray_pipelinebuilder.hpp:55
VkPolygonMode mPolygonMode
Definition foray_pipelinebuilder.hpp:49
std::vector< VkPipelineColorBlendAttachmentState > * mColorBlendAttachmentStates
Definition foray_pipelinebuilder.hpp:51
VkBool32 mDepthTestEnable
Definition foray_pipelinebuilder.hpp:52
uint32_t mColorAttachmentBlendCount
Definition foray_pipelinebuilder.hpp:57
Class that holds memory ownership of a vulkan pipeline layout.
Definition foray_pipelinelayout.hpp:12
Helper to create a simple set of shader stage create infos, that all use main as shader start point....
Definition foray_shaderstagecreateinfos.hpp:11
#define FORAY_PROPERTY_V(member)
Getter+Setter shorthand for value types.
Definition foray_basics.hpp:81
Definition foray_dualbuffer.hpp:5
Non owning context object.
Definition foray_context.hpp:16
Helper for building a VkPipelineVertexInputStateCreateInfo struct.
Definition foray_geo.hpp:29