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

Vulkan.Utils.PipelineLayout

Description

Assemble a pipeline's descriptor-set-layout bindings and push-constant ranges from the per-stage contributions of several shaders.

A binding (or push-constant range) declared by more than one stage must become a single entry whose stageFlags is the OR of the contributing stages — that is what a pipeline layout shared between, say, a vertex and a fragment shader needs. mergeDescriptorSetLayoutBindings and mergePushConstantRanges do that merge on plain Vulkan values, independent of where the per-stage bindings came from (hand written, or reflected — see vulkan-utils-spirv).

Synopsis

Documentation

mergeDescriptorSetLayoutBindings :: Foldable f => f DescriptorSetLayoutBinding -> Either DescriptorBindingConflict [DescriptorSetLayoutBinding] Source #

Merge the descriptor-set-layout bindings contributed by several stages for a single descriptor set. Bindings sharing a binding number are combined: their stageFlags are OR-ed and their descriptorCounts maxed. A descriptorType disagreement is a Left. The result is ascending by binding number.

Each input binding should carry the one stage that declares it (its stageFlags set to that stage); the merge turns the per-stage bindings into one multi-stage binding per binding number.

mergePushConstantRanges :: Foldable f => f PushConstantRange -> [PushConstantRange] Source #

Merge the push-constant ranges contributed by several stages: ranges sharing the same (offset, size) have their stageFlags OR-ed. The result is ascending by offset.

data DescriptorBindingConflict Source #

Two stages declared the same binding number with different descriptor types, which cannot be reconciled into one binding.

Constructors

DescriptorBindingConflict 

Fields

  • binding :: Word32

    The binding number the stages disagree on.

  • types :: (DescriptorType, DescriptorType)

    The two differing descriptor types.