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-3.27GHC2021

Vulkan.Core10.GraphicsPipeline

  • 40 types
  • 2 values
  • Packagevulkan-3.27
  • Exports239
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceGraphicsPipeline.hs
valuecreateGraphicsPipelines
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the graphics 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 GraphicsPipelineCreateInfo)

    pCreateInfos is a pointer to an array of GraphicsPipelineCreateInfo structures.

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

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

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

vkCreateGraphicsPipelines - Create graphics pipelines

Description

The GraphicsPipelineCreateInfo structure includes an array of PipelineShaderStageCreateInfo structures for each of the desired active shader stages, as well as creation information for all relevant fixed-function stages, and a pipeline layout.

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

Valid Usage

An implicit cache may be provided by the implementation or a layer. For this reason, it is still valid to set PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT on flags for any element of pCreateInfos while passing NULL_HANDLE for pipelineCache.

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 GraphicsPipelineCreateInfo 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, Device, GraphicsPipelineCreateInfo, Pipeline, PipelineCache

A convenience wrapper to make a compatible pair of calls to createGraphicsPipelines 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.

datadata Viewport
#

VkViewport - Structure specifying a viewport

Description

Despite their names, minDepth can be less than, equal to, or greater than maxDepth.

The framebuffer depth coordinate zf may be represented using either a fixed-point or floating-point representation. However, a floating-point representation must be used if the depth/stencil attachment has a floating-point depth component. If an m-bit fixed-point representation is used, we assume that it represents each value \frac{k}{2^m - 1}, where k ∈ { 0, 1, …​, 2m-1 }, as k (e.g. 1.0 is represented in binary as a string of all ones).

The viewport parameters shown in the above equations are found from these values as

If a render pass transform is enabled, the values (px,py) and (ox, oy) defining the viewport are transformed as described in render pass transform before participating in the viewport transform.

The application can specify a negative term for height, which has the effect of negating the y coordinate in clip space before performing the transform. When using a negative height, the application should also adjust the y value to point to the lower left corner of the viewport instead of the upper left corner. Using the negative height allows the application to avoid having to negate the y component of the Position output from the last pre-rasterization shader stage.

The width and height of the implementation-dependent maximum viewport dimensions must be greater than or equal to the width and height of the largest image which can be created and attached to a framebuffer.

The floating-point viewport bounds are represented with an implementation-dependent precision.

Valid Usage

  • width must be greater than 0.0

  • width must be less than or equal to PhysicalDeviceLimits::maxViewportDimensions[0]

  • If the VK_KHR_maintenance1 extension is not enabled, the VK_AMD_negative_viewport_height extension is not enabled, and PhysicalDeviceProperties::apiVersion is less than Vulkan 1.1, height must be greater than 0.0

  • The absolute value of height must be less than or equal to PhysicalDeviceLimits::maxViewportDimensions[1]

  • x must be greater than or equal to viewportBoundsRange[0]

  • (x + width) must be less than or equal to viewportBoundsRange[1]

  • y must be greater than or equal to viewportBoundsRange[0]

  • y must be less than or equal to viewportBoundsRange[1]

  • (y + height) must be greater than or equal to viewportBoundsRange[0]

  • (y + height) must be less than or equal to viewportBoundsRange[1]

  • If the VK_EXT_depth_range_unrestricted extension is not enabled, minDepth must be between 0.0 and 1.0, inclusive

  • If the VK_EXT_depth_range_unrestricted extension is not enabled, maxDepth must be between 0.0 and 1.0, inclusive

See Also

VK_VERSION_1_0, CommandBufferInheritanceViewportScissorInfoNV, PipelineViewportStateCreateInfo, cmdSetViewport, cmdSetViewportWithCount, cmdSetViewportWithCount

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkVertexInputBindingDescription - Structure specifying vertex input binding description

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, PipelineVertexInputStateCreateInfo, VertexInputRate

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkVertexInputAttributeDescription - Structure specifying vertex input attribute description

Valid Usage

Valid Usage (Implicit)

  • format must be a valid Format value

See Also

VK_VERSION_1_0, Format, PipelineVertexInputStateCreateInfo

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineVertexInputStateCreateInfo - Structure specifying parameters of a newly created pipeline vertex input state

Valid Usage

  • vertexBindingDescriptionCount must be less than or equal to PhysicalDeviceLimits::maxVertexInputBindings

  • vertexAttributeDescriptionCount must be less than or equal to PhysicalDeviceLimits::maxVertexInputAttributes

  • For every binding specified by each element of pVertexAttributeDescriptions, a VertexInputBindingDescription must exist in pVertexBindingDescriptions with the same value of binding

  • All elements of pVertexBindingDescriptions must describe distinct binding numbers

  • All elements of pVertexAttributeDescriptions must describe distinct attribute locations

Valid Usage (Implicit)

  • pNext must be NULL or a pointer to a valid instance of PipelineVertexInputDivisorStateCreateInfo

  • The sType value of each structure in the pNext chain must be unique

  • flags must be 0

  • If vertexBindingDescriptionCount is not 0, pVertexBindingDescriptions must be a valid pointer to an array of vertexBindingDescriptionCount valid VertexInputBindingDescription structures

  • If vertexAttributeDescriptionCount is not 0, pVertexAttributeDescriptions must be a valid pointer to an array of vertexAttributeDescriptionCount valid VertexInputAttributeDescription structures

See Also

VK_VERSION_1_0, GraphicsPipelineCreateInfo, GraphicsShaderGroupCreateInfoNV, PipelineVertexInputStateCreateFlags, StructureType, VertexInputAttributeDescription, VertexInputBindingDescription

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineInputAssemblyStateCreateInfo - Structure specifying parameters of a newly created pipeline input assembly state

Description

Restarting the assembly of primitives discards the most recent index values if those elements formed an incomplete primitive, and restarts the primitive assembly using the subsequent indices, but only assembling the immediately following element through the end of the originally specified elements. The primitive restart index value comparison is performed before adding the vertexOffset value to the index value.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, GraphicsPipelineCreateInfo, PipelineInputAssemblyStateCreateFlags, PrimitiveTopology, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineTessellationStateCreateInfo - Structure specifying parameters of a newly created pipeline tessellation state

Valid Usage

  • patchControlPoints must be greater than zero and less than or equal to PhysicalDeviceLimits::maxTessellationPatchSize

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, GraphicsPipelineCreateInfo, GraphicsShaderGroupCreateInfoNV, PipelineTessellationStateCreateFlags, StructureType

Constructors

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

VkPipelineViewportStateCreateInfo - Structure specifying parameters of a newly created pipeline viewport state

Valid Usage

  • If the multiViewport feature is not enabled, viewportCount must not be greater than 1

  • If the multiViewport feature is not enabled, scissorCount must not be greater than 1

  • viewportCount must be less than or equal to PhysicalDeviceLimits::maxViewports

  • scissorCount must be less than or equal to PhysicalDeviceLimits::maxViewports

  • The x and y members of offset member of any element of pScissors must be greater than or equal to 0

  • Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow for any element of pScissors

  • Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow for any element of pScissors

  • If scissorCount and viewportCount are both not dynamic, then scissorCount and viewportCount must be identical

  • If the graphics pipeline is being created with DYNAMIC_STATE_VIEWPORT_WITH_COUNT set then viewportCount must be 0, otherwise viewportCount must be greater than 0

  • If the graphics pipeline is being created with DYNAMIC_STATE_SCISSOR_WITH_COUNT set then scissorCount must be 0, otherwise scissorCount must be greater than 0

  • If the viewportWScalingEnable member of a PipelineViewportWScalingStateCreateInfoNV structure included in the pNext chain is TRUE, the viewportCount member of the PipelineViewportWScalingStateCreateInfoNV structure must be greater than or equal to PipelineViewportStateCreateInfo::viewportCount

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, GraphicsPipelineCreateInfo, PipelineViewportStateCreateFlags, Rect2D, StructureType, Viewport

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineRasterizationStateCreateInfo - Structure specifying parameters of a newly created pipeline rasterization state

Description

The application can also add a PipelineRasterizationStateRasterizationOrderAMD structure to the pNext chain of a PipelineRasterizationStateCreateInfo structure. This structure enables selecting the rasterization order to use when rendering with the corresponding graphics pipeline as described in Rasterization Order.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, CullModeFlags, FrontFace, GraphicsPipelineCreateInfo, PipelineRasterizationStateCreateFlags, PolygonMode, StructureType

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineMultisampleStateCreateInfo - Structure specifying parameters of a newly created pipeline multisample state

Description

Each bit in the sample mask is associated with a unique sample index as defined for the coverage mask. Each bit b for mask word w in the sample mask corresponds to sample index i, where i = 32 × w + b. pSampleMask has a length equal to ⌈ rasterizationSamples / 32 ⌉ words.

If pSampleMask is NULL, it is treated as if the mask has all bits set to 1.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, GraphicsPipelineCreateInfo, PipelineMultisampleStateCreateFlags, SampleCountFlagBits, SampleMask, StructureType

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineColorBlendAttachmentState - Structure specifying a pipeline color blend attachment state

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, BlendFactor, BlendOp, Bool32, ColorComponentFlags, PipelineColorBlendStateCreateInfo

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineColorBlendStateCreateInfo - Structure specifying parameters of a newly created pipeline color blend state

Valid Usage

  • If the independentBlend feature is not enabled, all elements of pAttachments must be identical

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, GraphicsPipelineCreateInfo, LogicOp, PipelineColorBlendAttachmentState, PipelineColorBlendStateCreateFlags, StructureType

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineDynamicStateCreateInfo - Structure specifying parameters of a newly created pipeline dynamic state

Valid Usage

  • Each element of pDynamicStates must be unique

Valid Usage (Implicit)

  • pNext must be NULL

  • flags must be 0

  • If dynamicStateCount is not 0, pDynamicStates must be a valid pointer to an array of dynamicStateCount valid DynamicState values

See Also

VK_VERSION_1_0, DynamicState, GraphicsPipelineCreateInfo, PipelineDynamicStateCreateFlags, RayTracingPipelineCreateInfoKHR, StructureType

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero
datadata StencilOpState
#

VkStencilOpState - Structure specifying stencil operation state

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, CompareOp, PipelineDepthStencilStateCreateInfo, StencilOp

Constructors

  • StencilOpState
    • failOp :: StencilOp

      failOp is a StencilOp value specifying the action performed on samples that fail the stencil test.

      failOp must be a valid StencilOp value

    • passOp :: StencilOp

      passOp is a StencilOp value specifying the action performed on samples that pass both the depth and stencil tests.

      passOp must be a valid StencilOp value

    • depthFailOp :: StencilOp

      depthFailOp is a StencilOp value specifying the action performed on samples that pass the stencil test and fail the depth test.

      depthFailOp must be a valid StencilOp value

    • compareOp :: CompareOp

      compareOp is a CompareOp value specifying the comparison operator used in the stencil test.

      compareOp must be a valid CompareOp value

    • compareMask :: Word32

      compareMask selects the bits of the unsigned integer stencil values participating in the stencil test.

    • writeMask :: Word32

      writeMask selects the bits of the unsigned integer stencil values updated by the stencil test in the stencil framebuffer attachment.

    • reference :: Word32

      reference is an integer stencil reference value that is used in the unsigned stencil comparison.

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineDepthStencilStateCreateInfo - Structure specifying parameters of a newly created pipeline depth stencil state

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, Bool32, CompareOp, GraphicsPipelineCreateInfo, PipelineDepthStencilStateCreateFlags, StencilOpState, StructureType

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero
datadata GraphicsPipelineCreateInfo (es :: [Type])
#

VkGraphicsPipelineCreateInfo - Structure specifying parameters of a newly created graphics pipeline

Description

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

If any shader stage fails to compile, the compile log will be reported back to the application, and ERROR_INVALID_SHADER_NV will be generated.

With VK_EXT_extended_dynamic_state3, it is possible that many of the GraphicsPipelineCreateInfo members above can be NULL because all their state is dynamic and therefore ignored. This is optional so the application can still use a valid pointer if it needs to set the pNext or flags fields to specify state for other extensions.

The state required for a graphics pipeline is divided into vertex input state, pre-rasterization shader state, fragment shader state, and fragment output state.

Vertex Input State

Vertex input state is defined by:

If this pipeline specifies pre-rasterization state either directly or by including it as a pipeline library and its pStages includes a vertex shader, this state must be specified to create a complete graphics pipeline.

If a pipeline includes GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT in GraphicsPipelineLibraryCreateInfoEXT::flags either explicitly or as a default, and either the conditions requiring this state for a complete graphics pipeline are met or this pipeline does not specify pre-rasterization state in any way, that pipeline must specify this state directly.

Pre-Rasterization Shader State

Pre-rasterization shader state is defined by:

This state must be specified to create a complete graphics pipeline.

If either the pNext chain includes a GraphicsPipelineLibraryCreateInfoEXT structure with GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT included in flags, or it is not specified and would default to include that value, this state must be specified in the pipeline.

Fragment Shader State

Fragment shader state is defined by:

If a pipeline specifies pre-rasterization state either directly or by including it as a pipeline library and rasterizerDiscardEnable is FALSE or DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE is used, this state must be specified to create a complete graphics pipeline.

If a pipeline includes GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT in GraphicsPipelineLibraryCreateInfoEXT::flags either explicitly or as a default, and either the conditions requiring this state for a complete graphics pipeline are met or this pipeline does not specify pre-rasterization state in any way, that pipeline must specify this state directly.

Fragment Output State

Fragment output state is defined by:

If a pipeline specifies pre-rasterization state either directly or by including it as a pipeline library and rasterizerDiscardEnable is FALSE or DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE is used, this state must be specified to create a complete graphics pipeline.

If a pipeline includes GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT in GraphicsPipelineLibraryCreateInfoEXT::flags either explicitly or as a default, and either the conditions requiring this state for a complete graphics pipeline are met or this pipeline does not specify pre-rasterization state in any way, that pipeline must specify this state directly.

Dynamic State

Dynamic state values set via pDynamicState must be ignored if the state they correspond to is not otherwise statically set by one of the state subsets used to create the pipeline. Additionally, setting dynamic state values must not modify whether state in a linked library is static or dynamic; this is set and unchangeable when the library is created. For example, if a pipeline only included pre-rasterization shader state, then any dynamic state value corresponding to depth or stencil testing has no effect. Any linked library that has dynamic state enabled that same dynamic state must also be enabled in all the other linked libraries to which that dynamic state applies.

Complete Graphics Pipelines

A complete graphics pipeline always includes pre-rasterization shader state, with other subsets included depending on that state as specified in the above sections.

Graphics Pipeline Library Layouts

If different subsets are linked together with pipeline layouts created with PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, the final effective pipeline layout is effectively the union of the linked pipeline layouts. When binding descriptor sets for this pipeline, the pipeline layout used must be compatible with this union. This pipeline layout can be overridden when linking with PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT by providing a PipelineLayout that is compatible with this union other than PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, or when linking without PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT by providing a PipelineLayout that is fully compatible with this union.

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, PipelineColorBlendStateCreateInfo, PipelineCreateFlags, PipelineDepthStencilStateCreateInfo, PipelineDynamicStateCreateInfo, PipelineInputAssemblyStateCreateInfo, PipelineLayout, PipelineMultisampleStateCreateInfo, PipelineRasterizationStateCreateInfo, PipelineShaderStageCreateInfo, PipelineTessellationStateCreateInfo, PipelineVertexInputStateCreateInfo, PipelineViewportStateCreateInfo, RenderPass, StructureType, createGraphicsPipelines

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero

VkPipelineDynamicStateCreateFlags - Reserved for future use

Description

PipelineDynamicStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineDynamicStateCreateInfo

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

VkPipelineMultisampleStateCreateFlags - Reserved for future use

Description

PipelineMultisampleStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineMultisampleStateCreateInfo

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

VkPipelineRasterizationStateCreateFlags - Reserved for future use

Description

PipelineRasterizationStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineRasterizationStateCreateInfo

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

VkPipelineViewportStateCreateFlags - Reserved for future use

Description

PipelineViewportStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineViewportStateCreateInfo

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

VkPipelineTessellationStateCreateFlags - Reserved for future use

Description

PipelineTessellationStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineTessellationStateCreateInfo

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

VkPipelineInputAssemblyStateCreateFlags - Reserved for future use

Description

PipelineInputAssemblyStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineInputAssemblyStateCreateInfo

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

VkPipelineVertexInputStateCreateFlags - Reserved for future use

Description

PipelineVertexInputStateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, Flags, PipelineVertexInputStateCreateInfo

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

VkPrimitiveTopology - Supported primitive topologies

Description

Each primitive topology, and its construction from a list of vertices, is described in detail below with a supporting diagram, according to the following key:

primitive topology key vertex

Vertex

A point in 3-dimensional space. Positions chosen within the diagrams are arbitrary and for illustration only.

primitive topology key vertex number

Vertex Number

Sequence position of a vertex within the provided vertex data.

primitive topology key provoking vertex

Provoking Vertex

Provoking vertex within the main primitive. The tail is angled towards the relevant primitive. Used in

flat shading

.

primitive topology key edge

Primitive Edge

An edge connecting the points of a main primitive.

primitive topology key adjacency edge

Adjacency Edge

Points connected by these lines do not contribute to a main primitive, and are only accessible in a

geometry shader

.

primitive topology key winding order

Winding Order

The relative order in which vertices are defined within a primitive, used in the

facing determination

. This ordering has no specific start or end point.

The diagrams are supported with mathematical definitions where the vertices (v) and primitives (p) are numbered starting from 0; v0 is the first vertex in the provided data and p0 is the first primitive in the set of primitives defined by the vertices and topology.

See Also

VK_VERSION_1_0, PipelineInputAssemblyStateCreateInfo, cmdSetPrimitiveTopology, cmdSetPrimitiveTopology

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype PolygonMode
#

VkPolygonMode - Control polygon rasterization mode

Description

  • POLYGON_MODE_LINE specifies that polygon edges are drawn as line segments.

  • POLYGON_MODE_FILL specifies that polygons are rendered using the polygon rasterization rules in this section.

  • POLYGON_MODE_FILL_RECTANGLE_NV specifies that polygons are rendered using polygon rasterization rules, modified to consider a sample within the primitive if the sample location is inside the axis-aligned bounding box of the triangle after projection. Note that the barycentric weights used in attribute interpolation can extend outside the range [0,1] when these primitives are shaded. Special treatment is given to a sample position on the boundary edge of the bounding box. In such a case, if two rectangles lie on either side of a common edge (with identical endpoints) on which a sample position lies, then exactly one of the triangles must produce a fragment that covers that sample during rasterization.

    Polygons rendered in POLYGON_MODE_FILL_RECTANGLE_NV mode may be clipped by the frustum or by user clip planes. If clipping is applied, the triangle is culled rather than clipped.

    Area calculation and facingness are determined for POLYGON_MODE_FILL_RECTANGLE_NV mode using the triangle’s vertices.

These modes affect only the final rasterization of polygons: in particular, a polygon’s vertices are shaded and the polygon is clipped and possibly culled before these modes are applied.

If PhysicalDeviceMaintenance5Properties::polygonModePointSize is TRUE, the point size of the final rasterization of polygons is taken from PointSize when polygon mode is POLYGON_MODE_POINT.

Otherwise, if PhysicalDeviceMaintenance5Properties::polygonModePointSize is FALSE, the point size of the final rasterization of polygons is 1.0 when polygon mode is POLYGON_MODE_POINT.

See Also

VK_VERSION_1_0, PipelineRasterizationStateCreateInfo, cmdSetPolygonModeEXT

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype FrontFace
#

VkFrontFace - Interpret polygon front-facing orientation

Description

Any triangle which is not front-facing is back-facing, including zero-area triangles.

See Also

VK_VERSION_1_0, PipelineRasterizationStateCreateInfo, cmdSetFrontFace, cmdSetFrontFace

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
  • Ord FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
  • Read FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
  • Show FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
  • Storable FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
  • Zero FrontFaceDefined in vulkan-3.27 · Vulkan.Core10.Enums.FrontFace
newtypenewtype BlendFactor
#

VkBlendFactor - Framebuffer blending factors

Description

The semantics of the enum values are described in the table below:

BlendFactor

RGB Blend Factors (Sr,Sg,Sb) or (Dr,Dg,Db)

Alpha Blend Factor (Sa or Da)

BLEND_FACTOR_ZERO

(0,0,0)

0

BLEND_FACTOR_ONE

(1,1,1)

1

BLEND_FACTOR_SRC_COLOR

(Rs0,Gs0,Bs0)

As0

BLEND_FACTOR_ONE_MINUS_SRC_COLOR

(1-Rs0,1-Gs0,1-Bs0)

1-As0

BLEND_FACTOR_DST_COLOR

(Rd,Gd,Bd)

Ad

BLEND_FACTOR_ONE_MINUS_DST_COLOR

(1-Rd,1-Gd,1-Bd)

1-Ad

BLEND_FACTOR_SRC_ALPHA

(As0,As0,As0)

As0

BLEND_FACTOR_ONE_MINUS_SRC_ALPHA

(1-As0,1-As0,1-As0)

1-As0

BLEND_FACTOR_DST_ALPHA

(Ad,Ad,Ad)

Ad

BLEND_FACTOR_ONE_MINUS_DST_ALPHA

(1-Ad,1-Ad,1-Ad)

1-Ad

BLEND_FACTOR_CONSTANT_COLOR

(Rc,Gc,Bc)

Ac

BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR

(1-Rc,1-Gc,1-Bc)

1-Ac

BLEND_FACTOR_CONSTANT_ALPHA

(Ac,Ac,Ac)

Ac

BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA

(1-Ac,1-Ac,1-Ac)

1-Ac

BLEND_FACTOR_SRC_ALPHA_SATURATE

(f,f,f); f = min(As0,1-Ad)

1

BLEND_FACTOR_SRC1_COLOR

(Rs1,Gs1,Bs1)

As1

BLEND_FACTOR_ONE_MINUS_SRC1_COLOR

(1-Rs1,1-Gs1,1-Bs1)

1-As1

BLEND_FACTOR_SRC1_ALPHA

(As1,As1,As1)

As1

BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA

(1-As1,1-As1,1-As1)

1-As1

Blend Factors

In this table, the following conventions are used:

  • Rs0,Gs0,Bs0 and As0 represent the first source color R, G, B, and A components, respectively, for the fragment output location corresponding to the color attachment being blended.

  • Rs1,Gs1,Bs1 and As1 represent the second source color R, G, B, and A components, respectively, used in dual source blending modes, for the fragment output location corresponding to the color attachment being blended.

  • Rd,Gd,Bd and Ad represent the R, G, B, and A components of the destination color. That is, the color currently in the corresponding color attachment for this fragment/sample.

  • Rc,Gc,Bc and Ac represent the blend constant R, G, B, and A components, respectively.

See Also

VK_VERSION_1_0, ColorBlendEquationEXT, PipelineColorBlendAttachmentState

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype BlendOp
#

VkBlendOp - Framebuffer blending operations

Description

The semantics of the basic blend operations are described in the table below:

BlendOp

RGB Components

Alpha Component

BLEND_OP_ADD

R = Rs0 × Sr + Rd × Dr G = Gs0 × Sg + Gd × Dg B = Bs0 × Sb + Bd × Db

A = As0 × Sa + Ad × Da

BLEND_OP_SUBTRACT

R = Rs0 × Sr - Rd × Dr G = Gs0 × Sg - Gd × Dg B = Bs0 × Sb - Bd × Db

A = As0 × Sa - Ad × Da

BLEND_OP_REVERSE_SUBTRACT

R = Rd × Dr - Rs0 × Sr G = Gd × Dg - Gs0 × Sg B = Bd × Db - Bs0 × Sb

A = Ad × Da - As0 × Sa

BLEND_OP_MIN

R = min(Rs0,Rd) G = min(Gs0,Gd) B = min(Bs0,Bd)

A = min(As0,Ad)

BLEND_OP_MAX

R = max(Rs0,Rd) G = max(Gs0,Gd) B = max(Bs0,Bd)

A = max(As0,Ad)

Basic Blend Operations

In this table, the following conventions are used:

  • Rs0, Gs0, Bs0 and As0 represent the first source color R, G, B, and A components, respectively.

  • Rd, Gd, Bd and Ad represent the R, G, B, and A components of the destination color. That is, the color currently in the corresponding color attachment for this fragment/sample.

  • Sr, Sg, Sb and Sa represent the source blend factor R, G, B, and A components, respectively.

  • Dr, Dg, Db and Da represent the destination blend factor R, G, B, and A components, respectively.

The blending operation produces a new set of values R, G, B and A, which are written to the framebuffer attachment. If blending is not enabled for this attachment, then R, G, B and A are assigned Rs0, Gs0, Bs0 and As0, respectively.

If the color attachment is fixed-point, the components of the source and destination values and blend factors are each clamped to [0,1] or [-1,1] respectively for an unsigned normalized or signed normalized color attachment prior to evaluating the blend operations. If the color attachment is floating-point, no clamping occurs.

See Also

VK_VERSION_1_0, ColorBlendAdvancedEXT, ColorBlendEquationEXT, PipelineColorBlendAttachmentState

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Ord BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Read BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Show BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Storable BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
  • Zero BlendOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.BlendOp
newtypenewtype StencilOp
#

VkStencilOp - Stencil comparison function

Description

For purposes of increment and decrement, the stencil bits are considered as an unsigned integer.

See Also

VK_VERSION_1_0, StencilOpState, cmdSetStencilOp, cmdSetStencilOp

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
  • Ord StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
  • Read StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
  • Show StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
  • Storable StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
  • Zero StencilOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.StencilOp
newtypenewtype LogicOp
#

VkLogicOp - Framebuffer logical operations

Description

The logical operations supported by Vulkan are summarized in the following table in which

  • ¬ is bitwise invert,

  • ∧ is bitwise and,

  • ∨ is bitwise or,

  • ⊕ is bitwise exclusive or,

  • s is the fragment’s Rs0, Gs0, Bs0 or As0 component value for the fragment output corresponding to the color attachment being updated, and

  • d is the color attachment’s R, G, B or A component value:

Logical Operations

The result of the logical operation is then written to the color attachment as controlled by the component write mask, described in Blend Operations.

See Also

VK_VERSION_1_0, PipelineColorBlendStateCreateInfo, cmdSetLogicOpEXT

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
  • Eq LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
  • Ord LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
  • Read LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
  • Show LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
  • Storable LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
  • Zero LogicOpDefined in vulkan-3.27 · Vulkan.Core10.Enums.LogicOp
newtypenewtype VertexInputRate
#

VkVertexInputRate - Specify rate at which vertex attributes are pulled from buffers

Description

See Also

VK_VERSION_1_0, VertexInputBindingDescription, VertexInputBindingDescription2EXT

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype DynamicState
#

VkDynamicState - Indicate which dynamic state is taken from dynamic state commands

Description

See Also

VK_VERSION_1_0, PipelineDynamicStateCreateInfo

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype CullModeFlagBits
#

VkCullModeFlagBits - Bitmask controlling triangle culling

Description

Following culling, fragments are produced for any triangles which have not been discarded.

See Also

VK_VERSION_1_0, CullModeFlags

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

VkColorComponentFlagBits - Bitmask controlling which components are written to the framebuffer

Description

  • COLOR_COMPONENT_R_BIT specifies that the R value is written to the color attachment for the appropriate sample. Otherwise, the value in memory is unmodified.

  • COLOR_COMPONENT_G_BIT specifies that the G value is written to the color attachment for the appropriate sample. Otherwise, the value in memory is unmodified.

  • COLOR_COMPONENT_B_BIT specifies that the B value is written to the color attachment for the appropriate sample. Otherwise, the value in memory is unmodified.

  • COLOR_COMPONENT_A_BIT specifies that the A value is written to the color attachment for the appropriate sample. Otherwise, the value in memory is unmodified.

The color write mask operation is applied regardless of whether blending is enabled.

The color write mask operation is applied only if Color Write Enable is enabled for the respective attachment. Otherwise the color write mask is ignored and writes to all components of the attachment are disabled.

See Also

VK_VERSION_1_0, ColorComponentFlags

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

VkPipelineColorBlendStateCreateFlagBits - Bitmask specifying additional parameters of an image

Description

When PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT is included in a pipeline, it forms a framebuffer-local memory dependency for each fragment generated by draw commands for that pipeline with the following scopes:

See Also

VK_EXT_rasterization_order_attachment_access, VK_VERSION_1_0, PipelineColorBlendStateCreateFlags

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

VkPipelineDepthStencilStateCreateFlagBits - Bitmask specifying additional depth/stencil state information.

Description

When PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT is included in a pipeline, it forms a framebuffer-local memory dependency for each fragment generated by draw commands for that pipeline with the following scopes:

When PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT is included in a pipeline, it forms a framebuffer-local memory dependency for each fragment generated by draw commands for that pipeline with the following scopes:

See Also

VK_EXT_rasterization_order_attachment_access, VK_VERSION_1_0, PipelineDepthStencilStateCreateFlags

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