# Class VulkanSubpassDescription

java.lang.Object
com.io7m.jcoronado.api.VulkanSubpassDescription

All Implemented Interfaces:
  `VulkanSubpassDescriptionType`

public final class VulkanSubpassDescription extends Object implements VulkanSubpassDescriptionType
Structure specifying a subpass description.

See Also:
  - "VkSubpassDescription"

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `VulkanSubpassDescription.Builder`
  Builds instances of type `VulkanSubpassDescription`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanSubpassDescription.Builder`
  `builder()`
  Creates a builder for `VulkanSubpassDescription`.
  `List<VulkanAttachmentReference>`
  `colorAttachments()`
  `static VulkanSubpassDescription`
  `copyOf(VulkanSubpassDescriptionType instance)`
  Creates an immutable copy of a `VulkanSubpassDescriptionType` value.
  `Optional<VulkanAttachmentReference>`
  `depthStencilAttachment()`
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanSubpassDescription` that have equal attribute values.
  `Set<VulkanSubpassDescriptionFlag>`
  `flags()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `flags`, `pipelineBindPoint`, `inputAttachments`, `colorAttachments`, `resolveAttachments`, `depthStencilAttachment`, `preserveAttachments`.
  `List<VulkanAttachmentReference>`
  `inputAttachments()`
  `VulkanPipelineBindPoint`
  `pipelineBindPoint()`
  `List<Integer>`
  `preserveAttachments()`
  `List<VulkanAttachmentReference>`
  `resolveAttachments()`
  `String`
  `toString()`
  Prints the immutable value `VulkanSubpassDescription` with attribute values.
  `final VulkanSubpassDescription`
  `withColorAttachments(VulkanAttachmentReference... elements)`
  Copy the current immutable object with elements that replace the content of `colorAttachments`.
  `final VulkanSubpassDescription`
  `withColorAttachments(Iterable<? extends VulkanAttachmentReference> elements)`
  Copy the current immutable object with elements that replace the content of `colorAttachments`.
  `final VulkanSubpassDescription`
  `withDepthStencilAttachment(VulkanAttachmentReference value)`
  Copy the current immutable object by setting a present value for the optional `depthStencilAttachment` attribute.
  `final VulkanSubpassDescription`
  `withDepthStencilAttachment(Optional<? extends VulkanAttachmentReference> optional)`
  Copy the current immutable object by setting an optional value for the `depthStencilAttachment` attribute.
  `final VulkanSubpassDescription`
  `withFlags(VulkanSubpassDescriptionFlag... elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanSubpassDescription`
  `withFlags(Iterable<VulkanSubpassDescriptionFlag> elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanSubpassDescription`
  `withInputAttachments(VulkanAttachmentReference... elements)`
  Copy the current immutable object with elements that replace the content of `inputAttachments`.
  `final VulkanSubpassDescription`
  `withInputAttachments(Iterable<? extends VulkanAttachmentReference> elements)`
  Copy the current immutable object with elements that replace the content of `inputAttachments`.
  `final VulkanSubpassDescription`
  `withPipelineBindPoint(VulkanPipelineBindPoint value)`
  Copy the current immutable object by setting a value for the `pipelineBindPoint` attribute.
  `final VulkanSubpassDescription`
  `withPreserveAttachments(int... elements)`
  Copy the current immutable object with elements that replace the content of `preserveAttachments`.
  `final VulkanSubpassDescription`
  `withPreserveAttachments(Iterable<Integer> elements)`
  Copy the current immutable object with elements that replace the content of `preserveAttachments`.
  `final VulkanSubpassDescription`
  `withResolveAttachments(VulkanAttachmentReference... elements)`
  Copy the current immutable object with elements that replace the content of `resolveAttachments`.
  `final VulkanSubpassDescription`
  `withResolveAttachments(Iterable<? extends VulkanAttachmentReference> elements)`
  Copy the current immutable object with elements that replace the content of `resolveAttachments`.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### flags

    public Set<VulkanSubpassDescriptionFlag> flags()
    Specified by:
      `flags` in interface `VulkanSubpassDescriptionType`
    Returns:
      Description flags

  - ### pipelineBindPoint

    public VulkanPipelineBindPoint pipelineBindPoint()
    Specified by:
      `pipelineBindPoint` in interface `VulkanSubpassDescriptionType`
    Returns:
      The pipeline bind point specifying whether this is a graphics or compute subpass.

  - ### inputAttachments

    public List<VulkanAttachmentReference> inputAttachments()
    Specified by:
      `inputAttachments` in interface `VulkanSubpassDescriptionType`
    Returns:
      A list of the render pass’s attachments that can be read in the fragment shader stage during the subpass, and what layout each attachment will be in during the subpass

  - ### colorAttachments

    public List<VulkanAttachmentReference> colorAttachments()
    Specified by:
      `colorAttachments` in interface `VulkanSubpassDescriptionType`
    Returns:
      A list of the render pass’s attachments that will be used as color attachments in the subpass, and what layout each attachment will be in during the subpass.

  - ### resolveAttachments

    public List<VulkanAttachmentReference> resolveAttachments()
    Specified by:
      `resolveAttachments` in interface `VulkanSubpassDescriptionType`
    Returns:
      A list of the the render pass’s attachments that are resolved to at the end of the subpass, and what layout each attachment will be in during the multisample resolve operation.

  - ### depthStencilAttachment

    public Optional<VulkanAttachmentReference> depthStencilAttachment()
    Specified by:
      `depthStencilAttachment` in interface `VulkanSubpassDescriptionType`
    Returns:
      The attachment that will be used for depth/stencil data and the layout it will be in during the subpass.

  - ### preserveAttachments

    public List<Integer> preserveAttachments()
    Specified by:
      `preserveAttachments` in interface `VulkanSubpassDescriptionType`
    Returns:
      A list of render pass attachment indices describing the attachments that are not used by a subpass, but whose contents must be preserved throughout the subpass.

  - ### withFlags

    public final VulkanSubpassDescription withFlags(VulkanSubpassDescriptionFlag... elements)
    Copy the current immutable object with elements that replace the content of `flags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withFlags

    public final VulkanSubpassDescription withFlags(Iterable<VulkanSubpassDescriptionFlag> elements)
    Copy the current immutable object with elements that replace the content of `flags`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of flags elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withPipelineBindPoint

    public final VulkanSubpassDescription withPipelineBindPoint(VulkanPipelineBindPoint value)
    Copy the current immutable object by setting a value for the `pipelineBindPoint` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for pipelineBindPoint
    Returns:
      A modified copy or the `this` object

  - ### withInputAttachments

    public final VulkanSubpassDescription withInputAttachments(VulkanAttachmentReference... elements)
    Copy the current immutable object with elements that replace the content of `inputAttachments`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withInputAttachments

    public final VulkanSubpassDescription withInputAttachments(Iterable<? extends VulkanAttachmentReference> elements)
    Copy the current immutable object with elements that replace the content of `inputAttachments`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of inputAttachments elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withColorAttachments

    public final VulkanSubpassDescription withColorAttachments(VulkanAttachmentReference... elements)
    Copy the current immutable object with elements that replace the content of `colorAttachments`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withColorAttachments

    public final VulkanSubpassDescription withColorAttachments(Iterable<? extends VulkanAttachmentReference> elements)
    Copy the current immutable object with elements that replace the content of `colorAttachments`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of colorAttachments elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withResolveAttachments

    public final VulkanSubpassDescription withResolveAttachments(VulkanAttachmentReference... elements)
    Copy the current immutable object with elements that replace the content of `resolveAttachments`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withResolveAttachments

    public final VulkanSubpassDescription withResolveAttachments(Iterable<? extends VulkanAttachmentReference> elements)
    Copy the current immutable object with elements that replace the content of `resolveAttachments`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of resolveAttachments elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withDepthStencilAttachment

    public final VulkanSubpassDescription withDepthStencilAttachment(VulkanAttachmentReference value)
    Copy the current immutable object by setting a present value for the optional `depthStencilAttachment` attribute.
    Parameters:
      `value` - The value for depthStencilAttachment
    Returns:
      A modified copy or `this` if not changed

  - ### withDepthStencilAttachment

    public final VulkanSubpassDescription withDepthStencilAttachment(Optional<? extends VulkanAttachmentReference> optional)
    Copy the current immutable object by setting an optional value for the `depthStencilAttachment` attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning `this`.
    Parameters:
      `optional` - An optional value for depthStencilAttachment
    Returns:
      A modified copy or `this` if not changed

  - ### withPreserveAttachments

    public final VulkanSubpassDescription withPreserveAttachments(int... elements)
    Copy the current immutable object with elements that replace the content of `preserveAttachments`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withPreserveAttachments

    public final VulkanSubpassDescription withPreserveAttachments(Iterable<Integer> elements)
    Copy the current immutable object with elements that replace the content of `preserveAttachments`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of preserveAttachments elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanSubpassDescription` that have equal attribute values.
    Overrides:
      `equals` in class `Object`
    Returns:
      `true` if `this` is equal to `another` instance

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `flags`, `pipelineBindPoint`, `inputAttachments`, `colorAttachments`, `resolveAttachments`, `depthStencilAttachment`, `preserveAttachments`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

    public String toString()
    Prints the immutable value `VulkanSubpassDescription` with attribute values.
    Overrides:
      `toString` in class `Object`
    Returns:
      A string representation of the value

  - ### copyOf

    public static VulkanSubpassDescription copyOf(VulkanSubpassDescriptionType instance)
    Creates an immutable copy of a `VulkanSubpassDescriptionType` value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
    Parameters:
      `instance` - The instance to copy
    Returns:
      A copied immutable VulkanSubpassDescription instance

  - ### builder

    public static VulkanSubpassDescription.Builder builder()
    Creates a builder for `VulkanSubpassDescription`.

        VulkanSubpassDescription.builder()
           .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanSubpassDescriptionFlag) // flags elements
           .setPipelineBindPoint(com.io7m.jcoronado.api.VulkanPipelineBindPoint) // required pipelineBindPoint
           .addInputAttachments|addAllInputAttachments(VulkanAttachmentReference) // inputAttachments elements
           .addColorAttachments|addAllColorAttachments(VulkanAttachmentReference) // colorAttachments elements
           .addResolveAttachments|addAllResolveAttachments(VulkanAttachmentReference) // resolveAttachments elements
           .setDepthStencilAttachment(Optional<VulkanAttachmentReference>) // optional depthStencilAttachment
           .addPreserveAttachments|addAllPreserveAttachments(int) // preserveAttachments elements
           .build();

    Returns:
      A new VulkanSubpassDescription builder