C Specification
The VkGraphicsPipelineCreateInfo
structure is defined as:
// Provided by VK_VERSION_1_0
typedef struct VkGraphicsPipelineCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineCreateFlags flags;
uint32_t stageCount;
const VkPipelineShaderStageCreateInfo* pStages;
const VkPipelineVertexInputStateCreateInfo* pVertexInputState;
const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState;
const VkPipelineTessellationStateCreateInfo* pTessellationState;
const VkPipelineViewportStateCreateInfo* pViewportState;
const VkPipelineRasterizationStateCreateInfo* pRasterizationState;
const VkPipelineMultisampleStateCreateInfo* pMultisampleState;
const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState;
const VkPipelineColorBlendStateCreateInfo* pColorBlendState;
const VkPipelineDynamicStateCreateInfo* pDynamicState;
VkPipelineLayout layout;
VkRenderPass renderPass;
uint32_t subpass;
VkPipeline basePipelineHandle;
int32_t basePipelineIndex;
} VkGraphicsPipelineCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
flags
is a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated. -
stageCount
is the number of entries in thepStages
array. -
pStages
is a pointer to an array ofstageCount
VkPipelineShaderStageCreateInfo structures describing the set of the shader stages to be included in the graphics pipeline. -
pVertexInputState
is a pointer to a VkPipelineVertexInputStateCreateInfo structure. It is ignored if the pipeline is created with theVK_DYNAMIC_STATE_VERTEX_INPUT_EXT
dynamic state set. -
pInputAssemblyState
is a pointer to a VkPipelineInputAssemblyStateCreateInfo structure which determines input assembly behavior, as described in Drawing Commands. -
pTessellationState
is a pointer to a VkPipelineTessellationStateCreateInfo structure, and is ignored if the pipeline does not include a tessellation control shader stage and tessellation evaluation shader stage. -
pViewportState
is a pointer to a VkPipelineViewportStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled. -
pRasterizationState
is a pointer to a VkPipelineRasterizationStateCreateInfo structure. -
pMultisampleState
is a pointer to a VkPipelineMultisampleStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled. -
pDepthStencilState
is a pointer to a VkPipelineDepthStencilStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if no depth/stencil attachment is used. -
pColorBlendState
is a pointer to a VkPipelineColorBlendStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if no color attachments are used. -
pDynamicState
is a pointer to a VkPipelineDynamicStateCreateInfo structure, and is used to indicate which properties of the pipeline state object are dynamic and can be changed independently of the pipeline state. This can beNULL
, which means no state in the pipeline is considered dynamic. -
layout
is the description of binding locations used by both the pipeline and descriptor sets used with the pipeline. -
renderPass
is a handle to a render pass object describing the environment in which the pipeline will be used. The pipeline must only be used with a render pass instance compatible with the one provided. See Render Pass Compatibility for more information. -
subpass
is the index of the subpass in the render pass where this pipeline will be used. -
basePipelineHandle
is a pipeline to derive from. This is not used in Vulkan SC https://www.khronos.org/registry/vulkansc/specs/1.0-extensions/html/vkspec.html#SCID-8. -
basePipelineIndex
is an index into thepCreateInfos
parameter to use as a pipeline to derive from. This is not used in Vulkan SC https://www.khronos.org/registry/vulkansc/specs/1.0-extensions/html/vkspec.html#SCID-8.
Description
The parameters basePipelineHandle
and basePipelineIndex
are
described in more detail in Pipeline
Derivatives.
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 is defined by:
Pre-rasterization shader state is defined by:
-
VkPipelineShaderStageCreateInfo entries for:
-
Vertex shaders
-
Tessellation control shaders
-
Tessellation evaluation shaders
-
Geometry shaders
-
-
Within the VkPipelineLayout, all bindings that affect the specified shader stages
-
VkPipelineTessellationStateCreateInfo if tessellation stages are included.
-
VkRenderPass and
subpass
parameter
Fragment shader state is defined by:
-
A VkPipelineShaderStageCreateInfo entry for the fragment shader
-
Within the VkPipelineLayout, all bindings that affect the fragment shader
-
VkRenderPass and
subpass
parameter
Fragment output state is defined by:
-
The
alphaToCoverageEnable
andalphaToOneEnable
members of VkPipelineMultisampleStateCreateInfo. -
VkRenderPass and
subpass
parameter
A complete graphics pipeline always includes
pre-rasterization shader
state, with other subsets included depending on that state.
If the pre-rasterization
shader state includes a vertex shader, then
vertex input state is included
in a complete graphics pipeline.
If the value of
VkPipelineRasterizationStateCreateInfo::rasterizerDiscardEnable
in the pre-rasterization
shader state is VK_FALSE
or the VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT
dynamic state is
enabled
fragment shader state and
fragment output interface
state is included in a complete graphics pipeline.
Pipelines must be created with a complete set of pipeline state.
In Vulkan SC, the pipeline compilation process occurs
offline and the pStages
are not
needed at runtime and may be omitted.
If omitted, stageCount
must be set to 0
and pStages
must be
NULL
.
If provided, the values must match the values specified to the offline
compiler.
See Also
VK_VERSION_1_0, VkPipeline, VkPipelineColorBlendStateCreateInfo, VkPipelineCreateFlags, VkPipelineDepthStencilStateCreateInfo, VkPipelineDynamicStateCreateInfo, VkPipelineInputAssemblyStateCreateInfo, VkPipelineLayout, VkPipelineMultisampleStateCreateInfo, VkPipelineRasterizationStateCreateInfo, VkPipelineShaderStageCreateInfo, VkPipelineTessellationStateCreateInfo, VkPipelineVertexInputStateCreateInfo, VkPipelineViewportStateCreateInfo, VkRenderPass, VkStructureType, vkCreateGraphicsPipelines
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.