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

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Barrier

Whole-resource pipeline barriers. The transition* helpers issue the common swapchain-and-attachment transitions as complete cmdPipelineBarrier calls; imageBarrier is the building block behind them, exposed for assembling barriers they don't cover (handing a rendered image to a compute pass, a storage image to a blit, …) — combining several into one cmdPipelineBarrier call where the stage scopes allow. bufferBarrier is its buffer-flavoured sibling (a compute-written vertex SSBO handed to the vertex shader, …).

  • 5 values

Transition a depth image from UNDEFINED (discarding any previous contents) to DEPTH_ATTACHMENT_OPTIMAL, ready to be used as a depth attachment. Issue it before rendering whenever the attachment is about to be cleared on load — every frame, like the colour images.

The destination scope covers both fragment-test stages with read and write access: the loadOp clear and late depth writes are writes, the depth test itself is a read, and all of them must see the transition.

valueimageBarrier
  1. :: ImageAspectFlags
  2. -> AccessFlags

    Source access mask.

  3. -> AccessFlags

    Destination access mask.

  4. -> ImageLayout

    Old layout; UNDEFINED discards the image's previous contents.

  5. -> ImageLayout

    New layout.

  6. -> Image
  7. -> SomeStruct ImageMemoryBarrier
#

A whole-image memory barrier over the given aspect, from one (access mask, layout) scope to another, with no queue-family ownership transfer. The execution scopes (stage masks) live on the enclosing cmdPipelineBarrier call, shared by every barrier in it.