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

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

Modulevulkan-3.27GHC2021

Vulkan.Core10.ComputePipeline

  • 11 types
  • 3 values
  • Packagevulkan-3.27
  • Exports49
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceComputePipeline.hs
valuecreateComputePipelines
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the compute pipelines.

  3. -> PipelineCache

    pipelineCache is either NULL_HANDLE, indicating that pipeline caching is disabled, or to enable caching, the handle of a valid PipelineCache object. The implementation must not access this object outside of the duration of this command.

  4. -> "createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)

    pCreateInfos is a pointer to an array of ComputePipelineCreateInfo structures.

  5. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  6. -> io (Result, "pipelines" ::: Vector Pipeline)
#

vkCreateComputePipelines - Creates a new compute pipeline object

Description

Pipelines are created and returned as described for Multiple Pipeline Creation.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If pipelineCache is not NULL_HANDLE, pipelineCache must be a valid PipelineCache handle

  • pCreateInfos must be a valid pointer to an array of createInfoCount valid ComputePipelineCreateInfo structures

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • pPipelines must be a valid pointer to an array of createInfoCount Pipeline handles

  • createInfoCount must be greater than 0

  • If pipelineCache is a valid handle, it must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, ComputePipelineCreateInfo, Device, Pipeline, PipelineCache

A convenience wrapper to make a compatible pair of calls to createComputePipelines and destroyPipeline

To ensure that destroyPipeline is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

valuedestroyPipeline
  1. :: MonadIO io
  2. => Device

    device is the logical device that destroys the pipeline.

  3. -> Pipeline

    pipeline is the handle of the pipeline to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkDestroyPipeline - Destroy a pipeline object

Valid Usage

  • All submitted commands that refer to pipeline must have completed execution

  • If AllocationCallbacks were provided when pipeline was created, a compatible set of callbacks must be provided here

  • If no AllocationCallbacks were provided when pipeline was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If pipeline is not NULL_HANDLE, pipeline must be a valid Pipeline handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • If pipeline is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to pipeline must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, Pipeline

VkSpecializationMapEntry - Structure specifying a specialization map entry

Description

If a constantID value is not a specialization constant ID used in the shader, that map entry does not affect the behavior of the pipeline.

Valid Usage

  • For a constantID specialization constant declared in a shader, size must match the byte size of the constantID. If the specialization constant is of type boolean, size must be the byte size of Bool32

See Also

VK_VERSION_1_0, SpecializationInfo

Constructors

  • SpecializationMapEntry
    • constantID :: Word32

      constantID is the ID of the specialization constant in SPIR-V.

    • offset :: Word32

      offset is the byte offset of the specialization constant value within the supplied data buffer.

    • size :: Word64

      size is the byte size of the specialization constant value within the supplied data buffer.

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
datadata SpecializationInfo
#

VkSpecializationInfo - Structure specifying specialization information

Valid Usage

  • The offset member of each element of pMapEntries must be less than dataSize

  • The size member of each element of pMapEntries must be less than or equal to dataSize minus offset

  • The constantID value of each element of pMapEntries must be unique within pMapEntries

Valid Usage (Implicit)

  • If mapEntryCount is not 0, pMapEntries must be a valid pointer to an array of mapEntryCount valid SpecializationMapEntry structures

  • If dataSize is not 0, pData must be a valid pointer to an array of dataSize bytes

See Also

VK_VERSION_1_0, DataGraphPipelineShaderModuleCreateInfoARM, PipelineShaderStageCreateInfo, ShaderCreateInfoEXT, SpecializationMapEntry

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero
datadata PipelineShaderStageCreateInfo (es :: [Type])
#

VkPipelineShaderStageCreateInfo - Structure specifying parameters of a newly created pipeline shader stage

Description

If module is not NULL_HANDLE, the shader code used by the pipeline is defined by module. If module is NULL_HANDLE, the shader code is defined by the chained ShaderModuleCreateInfo if present.

If the shaderModuleIdentifier feature is enabled, applications can omit shader code for stage and instead provide a module identifier. This is done by including a PipelineShaderStageModuleIdentifierCreateInfoEXT structure with identifierSize not equal to 0 in the pNext chain. A shader stage created in this way is equivalent to one created using a shader module with the same identifier. The identifier allows an implementation to look up a pipeline without consuming a valid SPIR-V module. If a pipeline is not found, pipeline compilation is not possible and the implementation must fail as specified by PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.

When an identifier is used in lieu of a shader module, implementations may fail pipeline compilation with PIPELINE_COMPILE_REQUIRED for any reason.

The rationale for the relaxed requirement on implementations to return a pipeline with PipelineShaderStageModuleIdentifierCreateInfoEXT is that layers or tools may intercept pipeline creation calls and require the full SPIR-V context to operate correctly. ICDs are not expected to fail pipeline compilation if the pipeline exists in a cache somewhere.

Applications can use identifiers when creating pipelines with PIPELINE_CREATE_LIBRARY_BIT_KHR. When creating such pipelines, SUCCESS may be returned, but subsequently fail when referencing the pipeline in a PipelineLibraryCreateInfoKHR struct. Applications must allow pipeline compilation to fail during link steps with PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT as it may not be possible to determine if a pipeline can be created from identifiers until the link step.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, ComputePipelineCreateInfo, ExecutionGraphPipelineCreateInfoAMDX, GraphicsPipelineCreateInfo, GraphicsShaderGroupCreateInfoNV, PipelineShaderStageCreateFlags, RayTracingPipelineCreateInfoKHR, RayTracingPipelineCreateInfoNV, ShaderModule, ShaderStageFlagBits, SpecializationInfo, StructureType

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata ComputePipelineCreateInfo (es :: [Type])
#

VkComputePipelineCreateInfo - Structure specifying parameters of a newly created compute pipeline

Description

The parameters basePipelineHandle and basePipelineIndex are described in more detail in Pipeline Derivatives.

If the pNext chain includes a PipelineCreateFlags2CreateInfo structure, PipelineCreateFlags2CreateInfo::flags from that structure is used instead of flags from this structure.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Pipeline, PipelineCreateFlags, PipelineLayout, PipelineShaderStageCreateInfo, StructureType, createComputePipelines, getPipelineIndirectMemoryRequirementsNV

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
newtypenewtype Pipeline
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
newtypenewtype PipelineCreateFlagBits
#

VkPipelineCreateFlagBits - Bitmask controlling how a pipeline is created

Description

It is valid to set both PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT and PIPELINE_CREATE_DERIVATIVE_BIT. This allows a pipeline to be both a parent and possibly a child in a pipeline hierarchy. See Pipeline Derivatives for more information.

When an implementation is looking up a pipeline in a pipeline cache, if that pipeline is being created using linked libraries, implementations should always return an equivalent pipeline created with PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT if available, whether or not that bit was specified.

Using PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT (or not) when linking pipeline libraries is intended as a performance tradeoff between host and device. If the bit is omitted, linking should be faster and produce a pipeline more rapidly, but performance of the pipeline on the target device may be reduced. If the bit is included, linking may be slower but should produce a pipeline with device performance comparable to a monolithically created pipeline. Using both options can allow latency-sensitive applications to generate a suboptimal but usable pipeline quickly, and then perform an optimal link in the background, substituting the result for the suboptimally linked pipeline as soon as it is available.

See Also

VK_VERSION_1_0, PipelineCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …

VkPipelineShaderStageCreateFlagBits - Bitmask controlling how a pipeline shader stage is created

Description

If PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT and PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT are specified and minSubgroupSize does not equal maxSubgroupSize and no required subgroup size is specified, then the only way to guarantee that the 'X' dimension of the local workgroup size is a multiple of SubgroupSize is to make it a multiple of maxSubgroupSize. Under these conditions, you are guaranteed full subgroups but not any particular subgroup size.

See Also

VK_VERSION_1_0, PipelineShaderStageCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype PipelineLayoutCreateFlagBits
#

VkPipelineLayoutCreateFlagBits - Pipeline layout creation flag bits

Description

See Also

VK_EXT_graphics_pipeline_library, VK_VERSION_1_0, PipelineLayoutCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …