Talvos  0.1
SPIR-V interpreter and dynamic analysis framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GraphicsPipeline.h
Go to the documentation of this file.
1 // Copyright (c) 2018 the Talvos developers. All rights reserved.
2 //
3 // This file is distributed under a three-clause BSD license. For full license
4 // terms please see the LICENSE file distributed with this source code.
5 
8 
9 #ifndef TALVOS_GRAPHICSPIPELINE_H
10 #define TALVOS_GRAPHICSPIPELINE_H
11 
12 #include <array>
13 #include <vector>
14 
15 #include "vulkan/vulkan_core.h"
16 
17 namespace talvos
18 {
19 
21 
23 typedef std::vector<VkVertexInputAttributeDescription>
25 
27 typedef std::vector<VkVertexInputBindingDescription>
29 
31 typedef std::vector<VkPipelineColorBlendAttachmentState>
33 
36 {
37 public:
41  VkPrimitiveTopology Topology, PipelineStage *VertexStage,
45  const VkPipelineRasterizationStateCreateInfo &RasterizationState,
47  const std::array<float, 4> &BlendConstants,
48  const std::vector<VkViewport> &Viewports,
49  const std::vector<VkRect2D> &Scissors)
50  : Topology(Topology), VertexStage(VertexStage),
51  FragmentStage(FragmentStage),
52  VertexBindingDescriptions(VertexBindingDescriptions),
53  VertexAttributeDescriptions(VertexAttributeDescriptions),
54  RasterizationState(RasterizationState),
55  BlendAttachmentStates(BlendAttachmentStates),
56  BlendConstants(BlendConstants), Viewports(Viewports),
57  Scissors(Scissors){};
58 
61 
62  // Do not allow GraphicsPipeline objects to be copied.
64  GraphicsPipeline(const GraphicsPipeline &) = delete;
65  GraphicsPipeline &operator=(const GraphicsPipeline &) = delete;
67 
70  {
71  return BlendAttachmentStates;
72  }
73 
75  const std::array<float, 4> &getBlendConstants() const
76  {
77  return BlendConstants;
78  }
79 
81  const PipelineStage *getFragmentStage() const { return FragmentStage; }
82 
84  const VkPipelineRasterizationStateCreateInfo &getRasterizationState() const
85  {
86  return RasterizationState;
87  }
88 
90  const std::vector<VkRect2D> &getScissors() const { return Scissors; }
91 
93  VkPrimitiveTopology getTopology() const { return Topology; }
94 
96  const PipelineStage *getVertexStage() const { return VertexStage; }
97 
100  {
102  }
103 
106  {
108  }
109 
111  const std::vector<VkViewport> &getViewports() const { return Viewports; }
112 
113 private:
115  VkPrimitiveTopology Topology;
116 
119 
122 
125 
128 
130  VkPipelineRasterizationStateCreateInfo RasterizationState;
131 
134 
136  std::array<float, 4> BlendConstants;
137 
139  std::vector<VkViewport> Viewports;
140 
142  std::vector<VkRect2D> Scissors;
143 };
144 
145 } // namespace talvos
146 
147 #endif
VertexAttributeDescriptionList VertexAttributeDescriptions
The vertex attribute descriptions.
const VkPipelineRasterizationStateCreateInfo & getRasterizationState() const
Returns the rasterization state used by this pipeline.
BlendAttachmentStateList BlendAttachmentStates
The color blend attachement states.
PipelineStage * VertexStage
The vertex pipeline stage in this pipeline.
GraphicsPipeline & operator=(const GraphicsPipeline &)=delete
const BlendAttachmentStateList & getBlendAttachmentStates() const
Returns the list of blend attachment states.
std::vector< VkRect2D > Scissors
The static scissor rectangles used by this pipeline.
std::vector< VkVertexInputBindingDescription > VertexBindingDescriptionList
A list of vertex binding descriptions.
PipelineStage * FragmentStage
The fragment pipeline stage in this pipeline.
VkPrimitiveTopology getTopology() const
Returns the primitive topology used by this pipeline.
VertexBindingDescriptionList VertexBindingDescriptions
The vertex binding descriptions.
VkPrimitiveTopology Topology
The primitive topology used by this pipeline.
const PipelineStage * getFragmentStage() const
Returns the fragment pipeline stage.
std::vector< VkPipelineColorBlendAttachmentState > BlendAttachmentStateList
A list of pipeline color blend attachment states.
const VertexAttributeDescriptionList & getVertexAttributeDescriptions() const
Returns the list of vertex attribute descriptions.
const std::array< float, 4 > & getBlendConstants() const
Returns the blend constants.
This class encapsulates a graphics pipeline.
GraphicsPipeline(VkPrimitiveTopology Topology, PipelineStage *VertexStage, PipelineStage *FragmentStage, const VertexBindingDescriptionList &VertexBindingDescriptions, const VertexAttributeDescriptionList &VertexAttributeDescriptions, const VkPipelineRasterizationStateCreateInfo &RasterizationState, const BlendAttachmentStateList &BlendAttachmentStates, const std::array< float, 4 > &BlendConstants, const std::vector< VkViewport > &Viewports, const std::vector< VkRect2D > &Scissors)
Create a graphics pipeline.
const std::vector< VkViewport > & getViewports() const
Returns the static viewports used by this pipeline.
This class encapsulates information about a pipeline stage.
Definition: PipelineStage.h:30
std::vector< VkViewport > Viewports
The static viewports used by this pipeline.
const VertexBindingDescriptionList & getVertexBindingDescriptions() const
Returns the list of vertex binding descriptions.
~GraphicsPipeline()
Destroy the pipeline.
std::array< float, 4 > BlendConstants
The blend constants.
const PipelineStage * getVertexStage() const
Returns the vertex pipeline stage.
const std::vector< VkRect2D > & getScissors() const
Returns the static scissor rectangles used by this pipeline.
VkPipelineRasterizationStateCreateInfo RasterizationState
The rasterization state.
std::vector< VkVertexInputAttributeDescription > VertexAttributeDescriptionList
A list of vertex attribute descriptions.