38 void addAttributes(VkFormat format, uint32_t offset = 0);
39 void addAttributes(uint32_t location, VkFormat format, uint32_t offset = 0);
62 void addViewport(
const VkViewport& viewport);
63 void addScissor(
const VkRect2D& scissor);
85 void enableDepthClamp();
86 void disableDepthClamp();
88 void enableRasterizerDiscard();
89 void disableRasterizerDiscard();
91 void setPolygonMode(VkPolygonMode polygonMode);
92 void setCullMode(VkCullModeFlagBits cullMode);
93 void setFrontFace(VkFrontFace frontFace);
95 void enableDepthBias(
float constantFactor,
float clamp,
float slopeFactor);
96 void disableDepthBias();
98 void setLineWidth(
float lineWidth);
120 void setRasterizationSamples(VkSampleCountFlagBits rasterizationSamples);
122 void enableSampleShading();
123 void disableSampleShading();
125 void setMinSampleShading(
float minSampleShading);
129 void enableAlphaToCoverage();
130 void disableAlphaToCoverage();
132 void enableAlphaToOne();
133 void disableAlphaToOne();
155 void enableDepthTest(VkCompareOp depthCompareOp);
156 void disableDepthTest();
158 void enableDepthWrite();
159 void disableDepthWrite();
161 void enableDepthBoundsTest(
float minDepthBounds,
float maxDepthBounds);
162 void disableDepthBoundsTest();
164 void enableStencilTest(
const VkStencilOpState& front,
const VkStencilOpState& back);
165 void disableStencilTest();
187 void enableLogicOp(VkLogicOp logicOp);
188 void disableLogicOp();
190 void addAttachment(
const VkPipelineColorBlendAttachmentState& attachment);
213 void setShader(VkShaderStageFlagBits stage,
const char* entry,
API::ShaderModule shaderModule);
214 bool setShaderFromFile(VkShaderStageFlagBits stage,
const char* entry,
const std::string& filename);
215 bool setShaderFromData(VkShaderStageFlagBits stage,
const char* entry,
const std::vector<uint32_t>& data);
217 InputBinding addInputBinding(uint32_t stride, VkVertexInputRate inputRate = VK_VERTEX_INPUT_RATE_VERTEX);
218 InputBinding addInputBinding(uint32_t binding, uint32_t stride, VkVertexInputRate inputRate = VK_VERTEX_INPUT_RATE_VERTEX);
220 void setInputAssemblyInfo(VkPrimitiveTopology topology,
bool primitiveRestartEnable);
221 void setDynamicStates(
const std::set<VkDynamicState>& dynamicStates);
225 void setPipelineCache(VkPipelineCache pipelineCache);
236 std::unique_ptr<API::GraphicsPipeline>
build(VkResult* returnResult =
nullptr);
250 VkPrimitiveTopology _topology{VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST};
251 bool _primitiveRestartEnable{VK_FALSE};
254 VkPipelineViewportStateCreateInfo _viewportState{
255 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
268 VkPipelineRasterizationStateCreateInfo _rasterizationState{
269 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
274 VK_POLYGON_MODE_FILL,
275 VK_CULL_MODE_BACK_BIT,
276 VK_FRONT_FACE_COUNTER_CLOCKWISE,
285 VkPipelineMultisampleStateCreateInfo _multisampleState{
286 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
289 VK_SAMPLE_COUNT_1_BIT,
298 VkPipelineDepthStencilStateCreateInfo _depthStencilState{
299 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,
314 VkPipelineColorBlendStateCreateInfo _colorBlendState{
315 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
322 {0.0f, 0.0f, 0.0f, 0.0f}
333 uint32_t _subpass{0};
334 VkPipelineCache _pipelineCache{VK_NULL_HANDLE};
GraphicsPipeline & _graphicPipelineBuilder
std::vector< VkRect2D > _scissors
void setBlendConstants(const float blendConstants[4]) const
std::set< VkDynamicState > _dynamicStates
const API::Device & _device
std::vector< VkPipelineShaderStageCreateInfo > _shaderStages
std::vector< VkVertexInputAttributeDescription > _inputAttributes
std::vector< VkViewport > _viewports
GraphicsPipeline & _graphicPipelineBuilder
Resource::SharedPtr< lug::Graphics::Render::Material > build(const ::lug::Graphics::Builder::Material &builder)
API::RenderPass _renderPass
GraphicsPipeline & _graphicPipelineBuilder
GraphicsPipeline & _graphicPipelineBuilder
std::vector< VkPipelineColorBlendAttachmentState > _colorBlendAttachments
std::vector< API::ShaderModule > _shaderModules
std::vector< VkVertexInputBindingDescription > _inputBindings
API::PipelineLayout _pipelineLayout
GraphicsPipeline & _graphicPipelineBuilder