Class VkGraphicsPipelineCreateInfo

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class VkGraphicsPipelineCreateInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying parameters of a newly created graphics pipeline.
    Description

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

    pStages points to an array of VkPipelineShaderStageCreateInfo structures, which were previously described in Compute Pipelines.

    pDynamicState points to a structure of type VkPipelineDynamicStateCreateInfo.

    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.

    Valid Usage
    • If flags contains the PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is -1, basePipelineHandle must be a valid handle to a graphics VkPipeline
    • If flags contains the PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is NULL_HANDLE, basePipelineIndex must be a valid index into the calling command’s pCreateInfos parameter
    • If flags contains the PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineIndex is not -1, basePipelineHandle must be NULL_HANDLE
    • If flags contains the PIPELINE_CREATE_DERIVATIVE_BIT flag, and basePipelineHandle is not NULL_HANDLE, basePipelineIndex must be -1
    • The stage member of each element of pStages must be unique
    • The geometric shader stages provided in pStages must be either from the mesh shading pipeline (stage is SHADER_STAGE_TASK_BIT_NV or SHADER_STAGE_MESH_BIT_NV) or from the primitive shading pipeline (stage is SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_TESSELLATION_CONTROL_BIT, SHADER_STAGE_TESSELLATION_EVALUATION_BIT, or SHADER_STAGE_GEOMETRY_BIT).
    • The stage member of one element of pStages must be either SHADER_STAGE_VERTEX_BIT or SHADER_STAGE_MESH_BIT_NV.
    • The stage member of each element of pStages must not be SHADER_STAGE_COMPUTE_BIT
    • If pStages includes a tessellation control shader stage, it must include a tessellation evaluation shader stage
    • If pStages includes a tessellation evaluation shader stage, it must include a tessellation control shader stage
    • If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, pTessellationState must be a valid pointer to a valid VkPipelineTessellationStateCreateInfo structure
    • If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline
    • If pStages includes tessellation shader stages, and the shader code of both stages contain an OpExecutionMode instruction that specifies the type of subdivision in the pipeline, they must both specify the same subdivision mode
    • If pStages includes tessellation shader stages, the shader code of at least one stage must contain an OpExecutionMode instruction that specifies the output patch size in the pipeline
    • If pStages includes tessellation shader stages, and the shader code of both contain an OpExecutionMode instruction that specifies the out patch size in the pipeline, they must both specify the same patch size
    • If pStages includes tessellation shader stages, the topology member of pInputAssembly must be PRIMITIVE_TOPOLOGY_PATCH_LIST
    • If the topology member of pInputAssembly is PRIMITIVE_TOPOLOGY_PATCH_LIST, pStages must include tessellation shader stages
    • If pStages includes a geometry shader stage, and does not include any tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology specified in pInputAssembly
    • If pStages includes a geometry shader stage, and also includes tessellation shader stages, its shader code must contain an OpExecutionMode instruction that specifies an input primitive type that is compatible with the primitive topology that is output by the tessellation stages
    • If pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with PrimitiveID, then the geometry shader code must write to a matching output variable, decorated with PrimitiveID, in all execution paths
    • If pStages includes a fragment shader stage, its shader code must not read from any input attachment that is defined as ATTACHMENT_UNUSED in subpass
    • The shader code for the entry points identified by pStages, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter
    • If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL in the VkAttachmentReference defined by subpass, the depthWriteEnable member of pDepthStencilState must be FALSE
    • If rasterization is not disabled and subpass uses a depth/stencil attachment in renderPass that has a layout of IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL or IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL in the VkAttachmentReference defined by subpass, the failOp, passOp and depthFailOp members of each of the front and back members of pDepthStencilState must be STENCIL_OP_KEEP
    • If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the blendEnable member of the corresponding element of the pAttachment member of pColorBlendState must be FALSE if the attached image’s format features does not contain FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT.
    • If rasterization is not disabled and the subpass uses color attachments, the attachmentCount member of pColorBlendState must be equal to the colorAttachmentCount used to create subpass
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_VIEWPORT, the pViewports member of pViewportState must be a valid pointer to an array of pViewportState::viewportCount valid VkViewport structures
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_SCISSOR, the pScissors member of pViewportState must be a valid pointer to an array of pViewportState::scissorCount VkRect2D structures
    • If the wide lines feature is not enabled, and no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_LINE_WIDTH, the lineWidth member of pRasterizationState must be 1.0
    • If the rasterizerDiscardEnable member of pRasterizationState is FALSE, pViewportState must be a valid pointer to a valid VkPipelineViewportStateCreateInfo structure
    • If the rasterizerDiscardEnable member of pRasterizationState is FALSE, pMultisampleState must be a valid pointer to a valid VkPipelineMultisampleStateCreateInfo structure
    • If the rasterizerDiscardEnable member of pRasterizationState is FALSE, and subpass uses a depth/stencil attachment, pDepthStencilState must be a valid pointer to a valid VkPipelineDepthStencilStateCreateInfo structure
    • If the rasterizerDiscardEnable member of pRasterizationState is FALSE, and subpass uses color attachments, pColorBlendState must be a valid pointer to a valid VkPipelineColorBlendStateCreateInfo structure
    • If the depth bias clamping feature is not enabled, no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_DEPTH_BIAS, and the depthBiasEnable member of pRasterizationState is TRUE, the depthBiasClamp member of pRasterizationState must be 0.0
    • If the VK_EXT_depth_range_unrestricted extension is not enabled and no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_DEPTH_BOUNDS, and the depthBoundsTestEnable member of pDepthStencilState is TRUE, the minDepthBounds and maxDepthBounds members of pDepthStencilState must be between 0.0 and 1.0, inclusive
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is TRUE, sampleLocationsInfo.sampleLocationGridSize.width must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.width as returned by GetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is TRUE, sampleLocationsInfo.sampleLocationGridSize.height must evenly divide VkMultisamplePropertiesEXT::sampleLocationGridSize.height as returned by GetPhysicalDeviceMultisamplePropertiesEXT with a samples parameter equaling rasterizationSamples
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is TRUE, sampleLocationsInfo.sampleLocationsPerPixel must equal rasterizationSamples
    • If the sampleLocationsEnable member of a VkPipelineSampleLocationsStateCreateInfoEXT structure chained to the pNext chain of pMultisampleState is TRUE, the fragment shader code must not statically use the extended instruction InterpolateAtSample
    • layout must be consistent with all shaders specified in pStages
    • If neither the VK_AMD_mixed_attachment_samples nor the VK_NV_framebuffer_mixed_samples extensions are enabled, and if subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must be the same as the sample count for those subpass attachments
    • If the VK_AMD_mixed_attachment_samples extension is enabled, and if subpass uses color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must equal the maximum of the sample counts of those subpass attachments
    • If the VK_NV_framebuffer_mixed_samples extension is enabled, and if subpass has a depth/stencil attachment and depth test, stencil test, or depth bounds test are enabled, then the rasterizationSamples member of pMultisampleState must be the same as the sample count of the depth/stencil attachment
    • If the VK_NV_framebuffer_mixed_samples extension is enabled, and if subpass has any color attachments, then the rasterizationSamples member of pMultisampleState must be greater than or equal to the sample count for those subpass attachments
    • If the VK_NV_coverage_reduction_mode extension is enabled, the coverage reduction mode specified by VkPipelineCoverageReductionStateCreateInfoNV::coverageReductionMode, the rasterizationSamples member of pMultisampleState and the sample counts for the color and depth/stencil attachments (if the subpass has them) must be a valid combination returned by vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV
    • If subpass does not use any color and/or depth/stencil attachments, then the rasterizationSamples member of pMultisampleState must follow the rules for a zero-attachment subpass
    • subpass must be a valid subpass within renderPass
    • If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewTessellationShader is not enabled, then pStages must not include tessellation shaders.
    • If the renderPass has multiview enabled and subpass has more than one bit set in the view mask and multiviewGeometryShader is not enabled, then pStages must not include a geometry shader.
    • If the renderPass has multiview enabled and subpass has more than one bit set in the view mask, shaders in the pipeline must not write to the Layer built-in output
    • If the renderPass has multiview enabled, then all shaders must not include variables decorated with the Layer built-in decoration in their interfaces.
    • flags must not contain the PIPELINE_CREATE_DISPATCH_BASE flag.
    • If pStages includes a fragment shader stage and an input attachment was referenced by the VkRenderPassInputAttachmentAspectCreateInfo at renderPass create time, its shader code must not read from any aspect that was not specified in the aspectMask of the corresponding VkInputAttachmentAspectReference structure.
    • The number of resources in layout accessible to each shader stage that is used by the pipeline must be less than or equal to VkPhysicalDeviceLimits::maxPerStageResources
    • If no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and the viewportWScalingEnable member of a VkPipelineViewportWScalingStateCreateInfoNV structure, chained to the pNext chain of pViewportState, is TRUE, the pViewportWScalings member of the VkPipelineViewportWScalingStateCreateInfoNV must be a pointer to an array of VkPipelineViewportWScalingStateCreateInfoNV::viewportCount valid VkViewportWScalingNV structures
    • If pStages includes a vertex shader stage, pVertexInputState must be a valid pointer to a valid VkPipelineVertexInputStateCreateInfo structure
    • If pStages includes a vertex shader stage, pInputAssemblyState must be a valid pointer to a valid VkPipelineInputAssemblyStateCreateInfo structure
    • The Xfb execution mode can be specified by only one shader stage in pStages
    • If any shader stage in pStages specifies Xfb execution mode it must be the last vertex processing stage
    • If a VkPipelineRasterizationStateStreamCreateInfoEXT::rasterizationStream value other than zero is specified, all variables in the output interface of the entry point being compiled decorated with Position, PointSize, ClipDistance, or CullDistance must all be decorated with identical Stream values that match the rasterizationStream
    • If VkPipelineRasterizationStateStreamCreateInfoEXT::rasterizationStream is zero, or not specified, all variables in the output interface of the entry point being compiled decorated with Position, PointSize, ClipDistance, or CullDistance must all be decorated with a Stream value of zero, or must not specify the Stream decoration
    • If the last vertex processing stage is a geometry shader, and that geometry shader uses the GeometryStreams capability, then VkPhysicalDeviceTransformFeedbackFeaturesEXT::geometryStreams feature must be enabled
    • If there are any mesh shader stages in the pipeline there must not be any shader stage in the pipeline with a Xfb execution mode.
    • If the lineRasterizationMode member of a VkPipelineRasterizationLineStateCreateInfoEXT structure chained to the pNext chain of pRasterizationState is LINE_RASTERIZATION_MODE_BRESENHAM_EXT or LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT and if rasterization is enabled, then the alphaToCoverageEnable, alphaToOneEnable, and sampleShadingEnable members of pMultisampleState must all be FALSE
    • If the stippledLineEnable member of VkPipelineRasterizationLineStateCreateInfoEXT is TRUE and no element of the pDynamicStates member of pDynamicState is DYNAMIC_STATE_LINE_STIPPLE_EXT, then the lineStippleFactor member of VkPipelineRasterizationLineStateCreateInfoEXT must be in the range [1,256]
    Valid Usage (Implicit)
    See Also

    VkPipelineColorBlendStateCreateInfo, VkPipelineDepthStencilStateCreateInfo, VkPipelineDynamicStateCreateInfo, VkPipelineInputAssemblyStateCreateInfo, VkPipelineMultisampleStateCreateInfo, VkPipelineRasterizationStateCreateInfo, VkPipelineShaderStageCreateInfo, VkPipelineTessellationStateCreateInfo, VkPipelineVertexInputStateCreateInfo, VkPipelineViewportStateCreateInfo, CreateGraphicsPipelines

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • flags – a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated.
    • stageCount – the number of entries in the pStages array.
    • pStages – an array of size stageCount structures of type VkPipelineShaderStageCreateInfo describing the set of the shader stages to be included in the graphics pipeline.
    • pVertexInputState – a pointer to an instance of the VkPipelineVertexInputStateCreateInfo structure. It is ignored if the pipeline includes a mesh shader stage.
    • pInputAssemblyState – a pointer to an instance of the VkPipelineInputAssemblyStateCreateInfo structure which determines input assembly behavior, as described in Drawing Commands. It is ignored if the pipeline includes a mesh shader stage.
    • pTessellationState – a pointer to an instance of the VkPipelineTessellationStateCreateInfo structure, and is ignored if the pipeline does not include a tessellation control shader stage and tessellation evaluation shader stage.
    • pViewportState – a pointer to an instance of the VkPipelineViewportStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled.
    • pRasterizationState – a pointer to an instance of the VkPipelineRasterizationStateCreateInfo structure.
    • pMultisampleState – a pointer to an instance of the VkPipelineMultisampleStateCreateInfo, and is ignored if the pipeline has rasterization disabled.
    • pDepthStencilState – a pointer to an instance of the VkPipelineDepthStencilStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use a depth/stencil attachment.
    • pColorBlendState – a pointer to an instance of the VkPipelineColorBlendStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use any color attachments.
    • pDynamicState – a pointer to VkPipelineDynamicStateCreateInfo 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 be NULL, which means no state in the pipeline is considered dynamic.
    • layout – the description of binding locations used by both the pipeline and descriptor sets used with the pipeline.
    • renderPass – a handle to a render pass object describing the environment in which the pipeline will be used; the pipeline must only be used with an instance of any render pass compatible with the one provided. See Render Pass Compatibility for more information.
    • subpass – the index of the subpass in the render pass where this pipeline will be used.
    • basePipelineHandle – a pipeline to derive from.
    • basePipelineIndex – an index into the pCreateInfos parameter to use as a pipeline to derive from.

    Layout

    
     struct VkGraphicsPipelineCreateInfo {
         VkStructureType sType;
         void const * pNext;
         VkPipelineCreateFlags flags;
         uint32_t stageCount;
         VkPipelineShaderStageCreateInfo const * pStages;
         VkPipelineVertexInputStateCreateInfo const * pVertexInputState;
         VkPipelineInputAssemblyStateCreateInfo const * pInputAssemblyState;
         VkPipelineTessellationStateCreateInfo const * pTessellationState;
         VkPipelineViewportStateCreateInfo const * pViewportState;
         VkPipelineRasterizationStateCreateInfo const * pRasterizationState;
         VkPipelineMultisampleStateCreateInfo const * pMultisampleState;
         VkPipelineDepthStencilStateCreateInfo const * pDepthStencilState;
         VkPipelineColorBlendStateCreateInfo const * pColorBlendState;
         VkPipelineDynamicStateCreateInfo const * pDynamicState;
         VkPipelineLayout layout;
         VkRenderPass renderPass;
         uint32_t subpass;
         VkPipeline basePipelineHandle;
         int32_t basePipelineIndex;
     }