Movatterモバイル変換


[0]ホーム

URL:


Vulkan API Reference Pageslatest

VkSubpassDescription(3)

Name

VkSubpassDescription - Structure specifying a subpass description

C Specification

TheVkSubpassDescription structure is defined as:

This functionality is superseded byVulkan Version 1.2. SeeLegacy Functionality for more information.
// Provided by VK_VERSION_1_0typedef 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;} VkSubpassDescription;

Members

  • flags is a bitmask ofVkSubpassDescriptionFlagBitsspecifying usage of the subpass.

  • pipelineBindPoint is aVkPipelineBindPoint value specifyingthe pipeline type supported for this subpass.

  • inputAttachmentCount is the number of input attachments.

  • pInputAttachments is a pointer to an array ofVkAttachmentReference structures defining the input attachmentsfor this subpass and their layouts.

  • colorAttachmentCount is the number of color attachments.

  • pColorAttachments is a pointer to an array ofcolorAttachmentCountVkAttachmentReference structuresdefining the color attachments for this subpass and their layouts.

  • pResolveAttachments isNULL or a pointer to an array ofcolorAttachmentCountVkAttachmentReference structuresdefining the resolve attachments for this subpass and their layouts.

  • pDepthStencilAttachment is a pointer to aVkAttachmentReference structure specifying the depth/stencilattachment for this subpass and its layout.

  • preserveAttachmentCount is the number of preserved attachments.

  • pPreserveAttachments is a pointer to an array ofpreserveAttachmentCount render pass attachment indices identifyingattachments that are not used by this subpass, but whose contentsmustbe preserved throughout the subpass.

Description

Each element of thepInputAttachments array corresponds to an inputattachment index in a fragment shader, i.e. if a shader declares an imagevariable decorated with aInputAttachmentIndex value ofX, then ituses the attachment provided inpInputAttachments[X].Input attachmentsmust also be bound to the pipeline in a descriptor set.If theattachment member of any element ofpInputAttachments isVK_ATTACHMENT_UNUSED, the applicationmust not read from thecorresponding input attachment index.Fragment shaderscan use subpass input variables to access the contents ofan input attachment at the fragment’s(xf,yf) framebuffercoordinates and layer.Input attachmentsmust not be used by any subpasses within a render passthat enablesrender pass transform.

Each element of thepColorAttachments array corresponds to an outputlocation in the shader, i.e. if the shader declares an output variabledecorated with aLocation value ofX, then it uses the attachmentprovided inpColorAttachments[X].If theattachment member of any element ofpColorAttachments isVK_ATTACHMENT_UNUSED,or ifColor Write Enable has beendisabled for the corresponding attachment index,then writes to the corresponding location by a fragment shader arediscarded.

Ifflags does not includeVK_SUBPASS_DESCRIPTION_CUSTOM_RESOLVE_BIT_EXT, and ifpResolveAttachments is notNULL, each of its elements corresponds toa color attachment (the element inpColorAttachments at the sameindex), and amultisample resolve operation is defined for each attachment unless the resolve attachmentindex isVK_ATTACHMENT_UNUSED.

Similarly, ifflags does not includeVK_SUBPASS_DESCRIPTION_CUSTOM_RESOLVE_BIT_EXT, andVkSubpassDescriptionDepthStencilResolve::pDepthStencilResolveAttachmentis notNULL and does not have the valueVK_ATTACHMENT_UNUSED, itcorresponds to the depth/stencil attachment inpDepthStencilAttachment, andmultisample resolve operation for depthand stencil are defined byVkSubpassDescriptionDepthStencilResolve::depthResolveMode andVkSubpassDescriptionDepthStencilResolve::stencilResolveMode,respectively.IfVkSubpassDescriptionDepthStencilResolve::depthResolveMode isVK_RESOLVE_MODE_NONE or thepDepthStencilResolveAttachment doesnot have a depth aspect, no resolve operation is performed for the depthattachment.IfVkSubpassDescriptionDepthStencilResolve::stencilResolveModeisVK_RESOLVE_MODE_NONE or thepDepthStencilResolveAttachmentdoes not have a stencil aspect, no resolve operation is performed for thestencil attachment.

If the image subresource range referenced by the depth/stencil attachment iscreated withVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, then themultisample resolve operation uses thesample locations state specified in thesampleLocationsInfo member ofthe element of theVkRenderPassSampleLocationsBeginInfoEXT::pPostSubpassSampleLocationsfor the subpass.

IfpDepthStencilAttachment isNULL, or if its attachment index isVK_ATTACHMENT_UNUSED, it indicates that no depth/stencil attachmentwill be used in the subpass.

Following this call, if thecustomResolvefeature is enabled the fragment areamay be reduced to(1,1) if afragment density map is attached to the render pass.If this occurs, reads of input attachmentsmay return the value for theoriginal larger fragment containing the smaller fragment or use the newfragment area.

The contents of an attachment within the render area becomeundefined atthe start of a subpassS if all of the following conditions are true:

  • The attachment is used as a color, depth/stencil, or resolve attachmentin any subpass in the render pass.

  • There is a subpassS1 that uses or preserves the attachment, and asubpass dependency fromS1 toS.

  • The attachment is not used or preserved in subpassS.

In addition, the contents of an attachment within the render area becomeundefined at the start of a subpassS if all of the following conditionsare true:

For color attachments, this operation will be performed in theVK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT pipeline stage, with anyimage accesses performed viaVK_ACCESS_INPUT_ATTACHMENT_READ_BIT,VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, andVK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT.For depth/stencil attachments, this operationmay be performed in eithertheVK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT orVK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT pipeline stage, with anyimage accesses performed viaVK_ACCESS_INPUT_ATTACHMENT_READ_BIT,VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, andVK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT.

Once the contents of an attachment becomeundefined in subpassS, theyremainundefined for subpasses in subpass dependency chains starting withsubpassS until they are written again.However, they remain valid for subpasses in other subpass dependency chainsstarting with subpassS1 if all subpasses in each chain use or preservethe attachment.

If a subpass has multiple dependency chains where some of the chainspreserve the attachment, and others do not, the contents of the attachmentareundefined for that subpass.

Valid Usage
Valid Usage (Implicit)
  • VUID-VkSubpassDescription-flags-parameter
    flagsmust be a valid combination ofVkSubpassDescriptionFlagBits values

  • VUID-VkSubpassDescription-pipelineBindPoint-parameter
    pipelineBindPointmust be a validVkPipelineBindPoint value

  • VUID-VkSubpassDescription-pInputAttachments-parameter
    IfinputAttachmentCount is not0,pInputAttachmentsmust be a valid pointer to an array ofinputAttachmentCount validVkAttachmentReference structures

  • VUID-VkSubpassDescription-pColorAttachments-parameter
    IfcolorAttachmentCount is not0,pColorAttachmentsmust be a valid pointer to an array ofcolorAttachmentCount validVkAttachmentReference structures

  • VUID-VkSubpassDescription-pResolveAttachments-parameter
    IfcolorAttachmentCount is not0, andpResolveAttachments is notNULL,pResolveAttachmentsmust be a valid pointer to an array ofcolorAttachmentCount validVkAttachmentReference structures

  • VUID-VkSubpassDescription-pDepthStencilAttachment-parameter
    IfpDepthStencilAttachment is notNULL,pDepthStencilAttachmentmust be a valid pointer to a validVkAttachmentReference structure

  • VUID-VkSubpassDescription-pPreserveAttachments-parameter
    IfpreserveAttachmentCount is not0,pPreserveAttachmentsmust be a valid pointer to an array ofpreserveAttachmentCountuint32_t values

See Also

Document Notes

For more information, see theVulkan Specification.

This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.


[8]ページ先頭

©2009-2026 Movatter.jp