vulkan-utils-0.5.11.0: Utils for the vulkan package
Safe HaskellNone
LanguageHaskell2010

Vulkan.Utils.Barrier

Description

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, …).

Synopsis

Documentation

transitionColorAttachment :: MonadIO m => CommandBuffer -> Image -> m () Source #

transitionPresent :: MonadIO m => CommandBuffer -> Image -> m () Source #

transitionDepthAttachment :: MonadIO m => CommandBuffer -> Image -> m () Source #

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.

imageBarrier Source #

Arguments

:: ImageAspectFlags 
-> AccessFlags

Source access mask.

-> AccessFlags

Destination access mask.

-> ImageLayout

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

-> ImageLayout

New layout.

-> Image 
-> 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.

bufferBarrier Source #

Arguments

:: AccessFlags

Source access mask.

-> AccessFlags

Destination access mask.

-> Buffer 
-> SomeStruct BufferMemoryBarrier 

A whole-buffer memory barrier from one access scope to another, with no queue-family ownership transfer. As with imageBarrier, the execution scopes (stage masks) live on the enclosing cmdPipelineBarrier call.