Class VkSubpassDescription

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


    public class VkSubpassDescription
    extends Struct
    Khronos Reference Page
    Vulkan Specification

    Describes the subpass that a fragment shader is executed in.

    Valid Usage
    • flags must be 0
    • pipelineBindPoint must be a valid VkPipelineBindPoint value
    • If inputAttachmentCount is not 0, pInputAttachments must be a pointer to an array of inputAttachmentCount valid VkAttachmentReference structures
    • If colorAttachmentCount is not 0, pColorAttachments must be a pointer to an array of colorAttachmentCount valid VkAttachmentReference structures
    • If colorAttachmentCount is not 0, and pResolveAttachments is not NULL, pResolveAttachments must be a pointer to an array of colorAttachmentCount valid VkAttachmentReference structures
    • If pDepthStencilAttachment is not NULL, pDepthStencilAttachment must be a pointer to a valid VkAttachmentReference structure
    • If preserveAttachmentCount is not 0, pPreserveAttachments must be a pointer to an array of preserveAttachmentCount uint32_t values
    • pipelineBindPoint must be PIPELINE_BIND_POINT_GRAPHICS
    • colorCount must be less than or equal to VkPhysicalDeviceLimits::maxColorAttachments
    • If the first use of an attachment in this render pass is as an input attachment, and the attachment is not also used as a color or depth/stencil attachment in the same subpass, then loadOp must not be ATTACHMENT_LOAD_OP_CLEAR
    • If pResolveAttachments is not NULL, for each resolve attachment that does not have the value ATTACHMENT_UNUSED, the corresponding color attachment must not have the value ATTACHMENT_UNUSED
    • If pResolveAttachments is not NULL, the sample count of each element of pColorAttachments must be anything other than SAMPLE_COUNT_1_BIT
    • Any given element of pResolveAttachments must have a sample count of SAMPLE_COUNT_1_BIT
    • Any given element of pResolveAttachments must have the same VkFormat as its corresponding color attachment
    • All attachments in pColorAttachments and pDepthStencilAttachment that are not ATTACHMENT_UNUSED must have the same sample count
    • If any input attachments are ATTACHMENT_UNUSED, then any pipelines bound during the subpass must not accesss those input attachments from the fragment shader
    • The attachment member of any element of pPreserveAttachments must not be ATTACHMENT_UNUSED
    • Any given element of pPreserveAttachments must not also be an element of any other member of the subpass description
    • If any attachment is used as both an input attachment and a color or depth/stencil attachment, then each use must use the same layout

    Member documentation

    • flags – reserved for future use
    • pipelineBindPoint – a VkPipelineBindPoint value specifying whether this is a compute or graphics subpass. Currently, only graphics subpasses are supported. One of:
      PIPELINE_BIND_POINT_COMPUTEPIPELINE_BIND_POINT_GRAPHICS
    • inputAttachmentCount – the number of input attachments
    • pInputAttachments – an array of VkAttachmentReference structures that lists which of the render pass’s attachments can be read in the shader during the subpass, and what layout the attachment images will be in during the subpass
    • colorAttachmentCount – the number of color attachments
    • pColorAttachments – an array of colorAttachmentCount VkAttachmentReference structures that lists which of the render pass’s attachments will be used as color attachments in the subpass, and what layout the attachment images will be in during the subpass
    • pResolveAttachmentsNULL or a pointer to an array of VkAttachmentReference structures. If pResolveAttachments is not NULL, each of its elements corresponds to a color attachment (the element in pColorAttachments at the same index)
    • pDepthStencilAttachment – a pointer to a VkAttachmentReference specifying which attachment will be used for depth/stencil data and the layout it will be in during the subpass
    • preserveAttachmentCount – the number of preserved attachments
    • pPreserveAttachments – an array of preserveAttachmentCount render pass attachment indices describing the attachments that are not used by a subpass, but whose contents must be preserved throughout the subpass

    Layout

    struct VkSubpassDescription {
        VkSubpassDescriptionFlags flags;
        VkPipelineBindPoint pipelineBindPoint;
        uint32_t inputAttachmentCount;
        const VkAttachmentReference * pInputAttachments;
        uint32_t colorAttachmentCount;
        const VkAttachmentReference * pColorAttachments;
        const VkAttachmentReference * pResolveAttachments;
        const VkAttachmentReference * pDepthStencilAttachment;
        uint32_t preserveAttachmentCount;
        const uint32_t * pPreserveAttachments;
    }