HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Pipeline.Internal

Shared graphics-pipeline construction behind the two rendering paths, Vulkan.Utils.RenderPass and Vulkan.Utils.DynamicRendering. Not meant for direct use — import one of those modules instead.

The only difference between the paths is whether the pipeline references a RenderPass or carries a PipelineRenderingCreateInfo in its pNext chain, so everything else (the vanilla rasterizerblenddynamic-state config, the transient empty layout, the shader-module lifetime) lives here once.

  • 3 values
valuebasePipelineCreateInfo
  1. :: PipelineLayout
  2. -> Maybe RenderPass
  3. -> Int

    Colour attachment count (blend attachments); 0 for depth-only.

  4. -> Bool

    Whether a depth attachment is present.

  5. -> PipelineVertexInputStateCreateInfo '[]

    Vertex input (bindings + attributes); zero for none.

  6. -> Vector DynamicState
  7. -> Vector (SomeStruct PipelineShaderStageCreateInfo)
  8. -> GraphicsPipelineCreateInfo '[]
#

The shared body of the vanilla graphics pipeline: the given dynamicStates, colorAttachmentCount identical non-blended color attachments, an optional depth-stencil state, and empty vertex input. The static values left in the create-info (cull mode, topology, …) are the baked defaults for any state not listed dynamic; states that are listed dynamic ignore them, so callers MUST emit the matching cmdSet* before drawing.

The colour and depth shape MUST match the attachments the pipeline renders to — the render pass (render-pass path) or the PipelineRenderingCreateInfo formats (dynamic-rendering path):

  • colorAttachmentCount == 0 omits colorBlendState entirely (a depth-only pipeline); otherwise one RGBA, non-blended attachment per colour target.

  • depth adds a zeroed depthStencilState — present (non-NULL) is required whenever a depth attachment is used; the actual test config is dynamic, so a zeroed struct is correct.

Pass Just the target render pass (render-pass path), or Nothing and attach a PipelineRenderingCreateInfo to the returned struct's pNext chain (dynamic-rendering path).

Build a single graphics pipeline from the given create-info builder. With Nothing, a transient empty pipeline layout is allocated and freed after the build (the historical behaviour: no descriptor sets, no push constants); with Just layout, the caller's layout is used and remains owned (and kept alive) by the caller. The returned ReleaseKey frees the pipeline.