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 context
  • swapchain — 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 context
  • swapchain — 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 viewport
  • scissor — 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 context
  • graphicsPipeline — 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 context
  • layout — Pipeline layout with descriptor set layouts and push constants
  • swapchain — Swapchain whose extent defines the viewport
  • shaderProgram — Vertex and fragment shader program
  • renderPass — Render pass the pipeline is compatible with
  • vertexInput — Vertex input state describing attribute bindings
  • settings — 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