Vookoo
Public Member Functions | List of all members
vku::PipelineMaker Class Reference

#include <vku.hpp>

Public Member Functions

 PipelineMaker (uint32_t width, uint32_t height)
 
vk::UniquePipeline createUnique (const vk::Device &device, const vk::PipelineCache &pipelineCache, const vk::PipelineLayout &pipelineLayout, const vk::RenderPass &renderPass, bool defaultBlend=true)
 
void shader (vk::ShaderStageFlagBits stage, vku::ShaderModule &shader, const char *entryPoint="main")
 Add a shader module to the pipeline.
 
void colorBlend (const vk::PipelineColorBlendAttachmentState &state)
 
void subPass (uint32_t subpass)
 
void blendBegin (vk::Bool32 enable)
 
void blendEnable (vk::Bool32 value)
 Enable or disable blending (called after blendBegin())
 
void blendSrcColorBlendFactor (vk::BlendFactor value)
 Source colour blend factor (called after blendBegin())
 
void blendDstColorBlendFactor (vk::BlendFactor value)
 Destination colour blend factor (called after blendBegin())
 
void blendColorBlendOp (vk::BlendOp value)
 Blend operation (called after blendBegin())
 
void blendSrcAlphaBlendFactor (vk::BlendFactor value)
 Source alpha blend factor (called after blendBegin())
 
void blendDstAlphaBlendFactor (vk::BlendFactor value)
 Destination alpha blend factor (called after blendBegin())
 
void blendAlphaBlendOp (vk::BlendOp value)
 Alpha operation (called after blendBegin())
 
void blendColorWriteMask (vk::ColorComponentFlags value)
 Colour write mask (called after blendBegin())
 
void vertexAttribute (uint32_t location_, uint32_t binding_, vk::Format format_, uint32_t offset_)
 Add a vertex attribute to the pipeline.
 
void vertexAttribute (const vk::VertexInputAttributeDescription &desc)
 Add a vertex attribute to the pipeline.
 
void vertexBinding (uint32_t binding_, uint32_t stride_, vk::VertexInputRate inputRate_=vk::VertexInputRate::eVertex)
 
void vertexBinding (const vk::VertexInputBindingDescription &desc)
 
PipelineMakertopology (vk::PrimitiveTopology topology)
 
PipelineMakerprimitiveRestartEnable (vk::Bool32 primitiveRestartEnable)
 
PipelineMakerinputAssemblyState (const vk::PipelineInputAssemblyStateCreateInfo &value)
 
PipelineMakerviewport (const vk::Viewport &value)
 
PipelineMakerscissor (const vk::Rect2D &value)
 
PipelineMakerrasterizationState (const vk::PipelineRasterizationStateCreateInfo &value)
 
PipelineMakerdepthClampEnable (vk::Bool32 value)
 
PipelineMakerrasterizerDiscardEnable (vk::Bool32 value)
 
PipelineMakerpolygonMode (vk::PolygonMode value)
 
PipelineMakercullMode (vk::CullModeFlags value)
 
PipelineMakerfrontFace (vk::FrontFace value)
 
PipelineMakerdepthBiasEnable (vk::Bool32 value)
 
PipelineMakerdepthBiasConstantFactor (float value)
 
PipelineMakerdepthBiasClamp (float value)
 
PipelineMakerdepthBiasSlopeFactor (float value)
 
PipelineMakerlineWidth (float value)
 
PipelineMakermultisampleState (const vk::PipelineMultisampleStateCreateInfo &value)
 
PipelineMakerrasterizationSamples (vk::SampleCountFlagBits value)
 
PipelineMakersampleShadingEnable (vk::Bool32 value)
 
PipelineMakerminSampleShading (float value)
 
PipelineMakerpSampleMask (const vk::SampleMask *value)
 
PipelineMakeralphaToCoverageEnable (vk::Bool32 value)
 
PipelineMakeralphaToOneEnable (vk::Bool32 value)
 
PipelineMakerdepthStencilState (const vk::PipelineDepthStencilStateCreateInfo &value)
 
PipelineMakerdepthTestEnable (vk::Bool32 value)
 
PipelineMakerdepthWriteEnable (vk::Bool32 value)
 
PipelineMakerdepthCompareOp (vk::CompareOp value)
 
PipelineMakerdepthBoundsTestEnable (vk::Bool32 value)
 
PipelineMakerstencilTestEnable (vk::Bool32 value)
 
PipelineMakerfront (vk::StencilOpState value)
 
PipelineMakerback (vk::StencilOpState value)
 
PipelineMakerminDepthBounds (float value)
 
PipelineMakermaxDepthBounds (float value)
 
PipelineMakercolorBlendState (const vk::PipelineColorBlendStateCreateInfo &value)
 
PipelineMakerlogicOpEnable (vk::Bool32 value)
 
PipelineMakerlogicOp (vk::LogicOp value)
 
PipelineMakerblendConstants (float r, float g, float b, float a)
 
PipelineMakerdynamicState (vk::DynamicState value)
 

Detailed Description

A class for building pipelines. All the state of the pipeline is exposed through individual calls. The pipeline encapsulates all the OpenGL state in a single object. This includes vertex buffer layouts, blend operations, shaders, line width etc. This class exposes all the values as individuals so a pipeline can be customised. The default is to generate a working pipeline.

Member Function Documentation

void vku::PipelineMaker::blendBegin ( vk::Bool32  enable)
inline

Begin setting colour blend value If you don't do this, a default is used. Follow this with blendEnable() blendSrcColorBlendFactor() etc. Default is a regular alpha blend.

void vku::PipelineMaker::colorBlend ( const vk::PipelineColorBlendAttachmentState &  state)
inline

Add a blend state to the pipeline for one colour attachment. If you don't do this, a default is used.

PipelineMaker& vku::PipelineMaker::colorBlendState ( const vk::PipelineColorBlendStateCreateInfo &  value)
inline

Set a whole colour blend state. Note you can set individual values with their own call

PipelineMaker& vku::PipelineMaker::depthStencilState ( const vk::PipelineDepthStencilStateCreateInfo &  value)
inline

Set a whole depth stencil state. Note you can set individual values with their own call

PipelineMaker& vku::PipelineMaker::inputAssemblyState ( const vk::PipelineInputAssemblyStateCreateInfo &  value)
inline

Set a whole new input assembly state. Note you can set individual values with their own call

PipelineMaker& vku::PipelineMaker::multisampleState ( const vk::PipelineMultisampleStateCreateInfo &  value)
inline

Set a whole multi sample state. Note you can set individual values with their own call

PipelineMaker& vku::PipelineMaker::primitiveRestartEnable ( vk::Bool32  primitiveRestartEnable)
inline

Enable or disable primitive restart. If using triangle strips, for example, this allows a special index value (0xffff or 0xffffffff) to start a new strip.

PipelineMaker& vku::PipelineMaker::rasterizationState ( const vk::PipelineRasterizationStateCreateInfo &  value)
inline

Set a whole rasterization state. Note you can set individual values with their own call

PipelineMaker& vku::PipelineMaker::scissor ( const vk::Rect2D &  value)
inline

Set the scissor value. This defines the area that the fragment shaders can write to. For example, if you are rendering a portal or a mirror.

PipelineMaker& vku::PipelineMaker::topology ( vk::PrimitiveTopology  topology)
inline

Specify the topology of the pipeline. Usually this is a triangle list, but points and lines are possible too.

void vku::PipelineMaker::vertexBinding ( uint32_t  binding_,
uint32_t  stride_,
vk::VertexInputRate  inputRate_ = vk::VertexInputRate::eVertex 
)
inline

Add a vertex binding to the pipeline. Usually only one of these is needed to specify the stride. Vertices can also be delivered one per instance.

void vku::PipelineMaker::vertexBinding ( const vk::VertexInputBindingDescription &  desc)
inline

Add a vertex binding to the pipeline. Usually only one of these is needed to specify the stride. Vertices can also be delivered one per instance.

PipelineMaker& vku::PipelineMaker::viewport ( const vk::Viewport &  value)
inline

Set the viewport value. Usually there is only one viewport, but you can have multiple viewports active for rendering cubemaps or VR stereo pair


The documentation for this class was generated from the following file: