| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- mergeDescriptorSetLayoutBindings :: Foldable f => f DescriptorSetLayoutBinding -> Either DescriptorBindingConflict [DescriptorSetLayoutBinding]
- mergePushConstantRanges :: Foldable f => f PushConstantRange -> [PushConstantRange]
- data DescriptorBindingConflict = DescriptorBindingConflict {}
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 | |
Instances
| Show DescriptorBindingConflict Source # | |
Defined in Vulkan.Utils.PipelineLayout Methods showsPrec :: Int -> DescriptorBindingConflict -> ShowS # show :: DescriptorBindingConflict -> String # showList :: [DescriptorBindingConflict] -> ShowS # | |
| Eq DescriptorBindingConflict Source # | |
Defined in Vulkan.Utils.PipelineLayout Methods (==) :: DescriptorBindingConflict -> DescriptorBindingConflict -> Bool # (/=) :: DescriptorBindingConflict -> DescriptorBindingConflict -> Bool # | |