15 #include <vsg/state/PipelineLayout.h>
16 #include <vsg/state/ShaderStage.h>
17 #include <vsg/state/StateCommand.h>
18 #include <vsg/vk/RenderPass.h>
39 void read(
Input& input)
override;
40 void write(
Output& output)
const override;
42 virtual void apply(
Context& context, VkGraphicsPipelineCreateInfo& pipelineInfo)
const = 0;
49 using GraphicsPipelineStates = std::vector<ref_ptr<GraphicsPipelineState>>;
50 extern VSG_DECLSPEC
void mergeGraphicsPipelineStates(Mask mask, GraphicsPipelineStates& dest_PipelineStates, ref_ptr<GraphicsPipelineState> src_PipelineState);
51 extern VSG_DECLSPEC
void mergeGraphicsPipelineStates(Mask mask, GraphicsPipelineStates& dest_PipelineStates,
const GraphicsPipelineStates& src_PipelineStates);
59 GraphicsPipeline(
PipelineLayout* pipelineLayout,
const ShaderStages& shaderStages,
const GraphicsPipelineStates& pipelineStates, uint32_t subpass = 0);
62 VkPipeline
vk(uint32_t viewID)
const {
return _implementation[viewID]->_pipeline; }
65 VkPipeline
validated_vk(uint32_t viewID)
const {
return (viewID < _implementation.size()) ? (_implementation[viewID] ? _implementation[viewID]->_pipeline : 0) : 0; }
69 GraphicsPipelineStates pipelineStates;
75 void read(
Input& input)
override;
76 void write(
Output& output)
const override;
82 void release(uint32_t viewID) { _implementation[viewID] = {}; }
83 void release() { _implementation.clear(); }
86 virtual ~GraphicsPipeline();
99 std::vector<ref_ptr<Implementation>> _implementation;
114 void read(
Input& input)
override;
115 void write(
Output& output)
const override;
120 void compile(
Context& context)
override;
122 virtual void release();
BindGraphicsPipeline state command encapsulates the vkCmdBindPipeline call for a GraphicsPipeline.
Definition: GraphicsPipeline.h:105
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
ref_ptr< GraphicsPipeline > pipeline
pipeline to pass in the vkCmdBindPipeline call;
Definition: GraphicsPipeline.h:110
CommandBuffer encapsulates VkCommandBuffer.
Definition: CommandBuffer.h:27
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition: Device.h:37
Definition: GraphicsPipeline.h:29
Mask mask
apply GraphicsPipelineState when (mask & view.mask) is non zero
Definition: GraphicsPipeline.h:36
int compare(const Object &rhs) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
GraphicsPipeline encapsulates graphics VkPipeline and the VkGraphicsPipelineCreateInfo settings used ...
Definition: GraphicsPipeline.h:55
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
VkPipeline validated_vk(uint32_t viewID) const
variant of vk(viewID) method that is slower but adds validation of the viewID parameter
Definition: GraphicsPipeline.h:65
ShaderStages stages
VkGraphicsPipelineCreateInfo settings.
Definition: GraphicsPipeline.h:68
VkPipeline vk(uint32_t viewID) const
return the Vulkan Pipeline for specified viewID.
Definition: GraphicsPipeline.h:62
PipelineLayout encapsulates VkPipelineLayout and the VkPipelineLayoutCreateInfo settings used to set ...
Definition: PipelineLayout.h:27
RenderPass encapsulation of VkRenderPass.
Definition: RenderPass.h:86
Definition: GraphicsPipeline.h:89