UgPipeline
Vulkan graphics pipeline creation helpers
createDynamicState
Build the dynamic state create info enabling viewport and scissor
VkPipelineDynamicStateCreateInfo createDynamicState();Returns — Populated dynamic state create info
createInputAssembly
Build the input assembly create info for triangle list topology
VkPipelineInputAssemblyStateCreateInfo createInputAssembly();Returns — Populated input assembly create info
createViewport
Build a viewport covering the full swapchain extent
VkViewport createViewport(UgContext.It& ctx, UgSwapchain.It& swapchain);Parameters
ctx— Vulkan contextswapchain— Swapchain whose extent defines the viewport
Returns — Populated VkViewport
createScissor
Build a scissor rect covering the full swapchain extent
VkRect2D createScissor(UgContext.It& ctx, UgSwapchain.It& swapchain);Parameters
ctx— Vulkan contextswapchain— Swapchain whose extent defines the scissor
Returns — Populated VkRect2D
createViewportState
Build the viewport state create info from a viewport and scissor pair
VkPipelineViewportStateCreateInfo createViewportState(VkViewport* viewport, VkRect2D* scissor);Parameters
viewport— Pointer to the viewportscissor— Pointer to the scissor rect
Returns — Populated viewport state create info
createRasterizerState
Build the rasterizer state create info from vertex settings
VkPipelineRasterizationStateCreateInfo createRasterizerState(const UgVertexSettings.It& settings);Parameters
settings— Vertex and rasterizer settings
Returns — Populated rasterization state create info
createMultisamplingState
Build the multisampling state create info with MSAA disabled
VkPipelineMultisampleStateCreateInfo createMultisamplingState();Returns — Populated multisample state create info
createColorBlendAttachmentState
Build the color blend attachment state from vertex settings
VkPipelineColorBlendAttachmentState createColorBlendAttachmentState(const UgVertexSettings.It& settings);Parameters
settings— Vertex and blending settings
Returns — Populated color blend attachment state
createColorBlendState
Build the color blend state create info referencing an attachment state
VkPipelineColorBlendStateCreateInfo createColorBlendState(VkPipelineColorBlendAttachmentState* colorBlendAttachment);Parameters
colorBlendAttachment— Pointer to the color blend attachment state
Returns — Populated color blend state create info
destroy
Destroy a graphics pipeline
U0 destroy(UgContext.It& ctx, VkPipeline graphicsPipeline);Parameters
ctx— Vulkan contextgraphicsPipeline— Pipeline to destroy
create
Create a graphics pipeline from all required components
VkPipeline create(UgContext.It& ctx, VkPipelineLayout layout, UgSwapchain.It& swapchain, UgShaderProgram.It& shaderProgram, VkRenderPass renderPass, VkPipelineVertexInputStateCreateInfo* vertexInput, const UgVertexSettings.It& settings);Parameters
ctx— Vulkan contextlayout— Pipeline layout with descriptor set layouts and push constantsswapchain— Swapchain whose extent defines the viewportshaderProgram— Vertex and fragment shader programrenderPass— Render pass the pipeline is compatible withvertexInput— Vertex input state describing attribute bindingssettings— Rasterizer and blending settings
Returns — Newly created graphics pipeline handle
createDepthStencil
Build the depth/stencil state create info with depth test enabled
VkPipelineDepthStencilStateCreateInfo createDepthStencil();Returns — Populated depth stencil state create info