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

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

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Pipeline

A pipeline bundled with everything needed to drive it.

Layout keeps, next to the created handles, the inputs they were created from: the per-set DescriptorSetLayoutCreateInfos and the push-constant ranges. Descriptor-set allocation and push recording need exactly those — allocateSet sizes its pool from the kept set info and push takes its stage flags and byte count from the kept range — so neither is hand-counted at call sites, where it drifts from the shaders. The infos can be hand written or reflected from SPIR-V (Vulkan.Utils.SpirV.Pipeline in vulkan-utils-spirv produces these types).

Designed for qualified import:

import Vulkan.Utils.Pipeline (Pipeline)
import qualified Vulkan.Utils.Pipeline as Pipeline

Pipeline.bind cb pl
Pipeline.push cb pl params
set <- Pipeline.allocateSet dev pl 0
Pipeline.bindSet cb pl 0 set
  • 3 types
  • 9 values
valuepush :: (Storable a, MonadIO m) => CommandBuffer -> Pipeline -> a -> m ()
#

Push a as the layout's single push-constant range: its stage flags, its size.

The range's size is what the layout accepts — often less than a's sizeOf (std430 blocks trailing-pad) — so exactly that many of a's leading bytes are pushed; a value too small to cover the range is an error, not an out-of-bounds read. Layouts with several ranges (or a range off 0) need cmdPushConstants directly.

Create the pipeline layout over the sets' layouts and the ranges.

Sharing a Set between layouts keeps them set-compatible on that number. Set numbers must be contiguous from 0 (pad gaps with empty sets) — bindSet addresses sets by number, which has to agree with the layout's slot order — and anything else fails here rather than misbinding at record time.