Class VkSubpassDescription

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkSubpassDescription>
org.lwjgl.vulkan.VkSubpassDescription
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkSubpassDescription extends org.lwjgl.system.Struct<VkSubpassDescription> implements org.lwjgl.system.NativeResource
Structure specifying a subpass description.
Description

Each element of the pInputAttachments array corresponds to an input attachment index in a fragment shader, i.e. if a shader declares an image variable decorated with a InputAttachmentIndex value of X, then it uses the attachment provided in pInputAttachments[X]. Input attachments must also be bound to the pipeline in a descriptor set. If the attachment member of any element of pInputAttachments is ATTACHMENT_UNUSED, the application must not read from the corresponding input attachment index. Fragment shaders can use subpass input variables to access the contents of an input attachment at the fragment’s (xf,yf) framebuffer coordinates and layer. Input attachments must not be used by any subpasses within a render pass that enables render pass transform.

Each element of the pColorAttachments array corresponds to an output location in the shader, i.e. if the shader declares an output variable decorated with a Location value of X, then it uses the attachment provided in pColorAttachments[X]. If the attachment member of any element of pColorAttachments is ATTACHMENT_UNUSED, or if Color Write Enable has been disabled for the corresponding attachment index, then writes to the corresponding location by a fragment shader are discarded.

If flags does not include SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if pResolveAttachments is not NULL, each of its elements corresponds to a color attachment (the element in pColorAttachments at the same index), and a multisample resolve operation is defined for each attachment unless the resolve attachment index is ATTACHMENT_UNUSED.

Similarly, if flags does not include SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and VkSubpassDescriptionDepthStencilResolve::pDepthStencilResolveAttachment is not NULL and does not have the value ATTACHMENT_UNUSED, it corresponds to the depth/stencil attachment in pDepthStencilAttachment, and multisample resolve operation for depth and stencil are defined by VkSubpassDescriptionDepthStencilResolve::depthResolveMode and VkSubpassDescriptionDepthStencilResolve::stencilResolveMode, respectively. If VkSubpassDescriptionDepthStencilResolve::depthResolveMode is RESOLVE_MODE_NONE or the pDepthStencilResolveAttachment does not have a depth aspect, no resolve operation is performed for the depth attachment. If VkSubpassDescriptionDepthStencilResolve::stencilResolveMode is RESOLVE_MODE_NONE or the pDepthStencilResolveAttachment does not have a stencil aspect, no resolve operation is performed for the stencil attachment.

If the image subresource range referenced by the depth/stencil attachment is created with IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, then the multisample resolve operation uses the sample locations state specified in the sampleLocationsInfo member of the element of the VkRenderPassSampleLocationsBeginInfoEXT::pPostSubpassSampleLocations for the subpass.

If pDepthStencilAttachment is NULL, or if its attachment index is ATTACHMENT_UNUSED, it indicates that no depth/stencil attachment will be used in the subpass.

The contents of an attachment within the render area become undefined at the start of a subpass S if all of the following conditions are true:

  • The attachment is used as a color, depth/stencil, or resolve attachment in any subpass in the render pass.
  • There is a subpass S1 that uses or preserves the attachment, and a subpass dependency from S1 to S.
  • The attachment is not used or preserved in subpass S.

In addition, the contents of an attachment within the render area become undefined at the start of a subpass S if all of the following conditions are true:

Once the contents of an attachment become undefined in subpass S, they remain undefined for subpasses in subpass dependency chains starting with subpass S until they are written again. However, they remain valid for subpasses in other subpass dependency chains starting with subpass S1 if those subpasses use or preserve the attachment.

Valid Usage
Valid Usage (Implicit)
  • flags must be a valid combination of VkSubpassDescriptionFlagBits values
  • pipelineBindPoint must be a valid VkPipelineBindPoint value
  • If inputAttachmentCount is not 0, pInputAttachments must be a valid pointer to an array of inputAttachmentCount valid VkAttachmentReference structures
  • If colorAttachmentCount is not 0, pColorAttachments must be a valid pointer to an array of colorAttachmentCount valid VkAttachmentReference structures
  • If colorAttachmentCount is not 0, and pResolveAttachments is not NULL, pResolveAttachments must be a valid pointer to an array of colorAttachmentCount valid VkAttachmentReference structures
  • If pDepthStencilAttachment is not NULL, pDepthStencilAttachment must be a valid pointer to a valid VkAttachmentReference structure
  • If preserveAttachmentCount is not 0, pPreserveAttachments must be a valid pointer to an array of preserveAttachmentCount uint32_t values
See Also

VkAttachmentReference, VkRenderPassCreateInfo

Layout


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

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
    • PIPELINEBINDPOINT

      public static final int PIPELINEBINDPOINT
      The struct member offsets.
    • INPUTATTACHMENTCOUNT

      public static final int INPUTATTACHMENTCOUNT
      The struct member offsets.
    • PINPUTATTACHMENTS

      public static final int PINPUTATTACHMENTS
      The struct member offsets.
    • COLORATTACHMENTCOUNT

      public static final int COLORATTACHMENTCOUNT
      The struct member offsets.
    • PCOLORATTACHMENTS

      public static final int PCOLORATTACHMENTS
      The struct member offsets.
    • PRESOLVEATTACHMENTS

      public static final int PRESOLVEATTACHMENTS
      The struct member offsets.
    • PDEPTHSTENCILATTACHMENT

      public static final int PDEPTHSTENCILATTACHMENT
      The struct member offsets.
    • PRESERVEATTACHMENTCOUNT

      public static final int PRESERVEATTACHMENTCOUNT
      The struct member offsets.
    • PPRESERVEATTACHMENTS

      public static final int PPRESERVEATTACHMENTS
      The struct member offsets.
  • Constructor Details

    • VkSubpassDescription

      public VkSubpassDescription(ByteBuffer container)
      Creates a VkSubpassDescription instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details