Class VkAttachmentDescription2

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkAttachmentDescription2>
org.lwjgl.vulkan.VkAttachmentDescription2
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
Direct Known Subclasses:
VkAttachmentDescription2KHR

public class VkAttachmentDescription2 extends org.lwjgl.system.Struct<VkAttachmentDescription2> implements org.lwjgl.system.NativeResource
Structure specifying an attachment description.
Description

Parameters defined by this structure with the same name as those in VkAttachmentDescription have the identical effect to those parameters.

If the separateDepthStencilLayouts feature is enabled, and format is a depth/stencil format, initialLayout and finalLayout can be set to a layout that only specifies the layout of the depth aspect.

If the pNext chain includes a VkAttachmentDescriptionStencilLayout structure, then the stencilInitialLayout and stencilFinalLayout members specify the initial and final layouts of the stencil aspect of a depth/stencil format, and initialLayout and finalLayout only apply to the depth aspect. For depth-only formats, the VkAttachmentDescriptionStencilLayout structure is ignored. For stencil-only formats, the initial and final layouts of the stencil aspect are taken from the VkAttachmentDescriptionStencilLayout structure if present, or initialLayout and finalLayout if not present.

If format is a depth/stencil format, and either initialLayout or finalLayout does not specify a layout for the stencil aspect, then the application must specify the initial and final layouts of the stencil aspect by including a VkAttachmentDescriptionStencilLayout structure in the pNext chain.

loadOp and storeOp are ignored for fragment shading rate attachments. No access to the shading rate attachment is performed in loadOp and storeOp. Instead, access to ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR is performed as fragments are rasterized.

Valid Usage
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2
  • Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkAttachmentDescriptionStencilLayout or VkExternalFormatANDROID
  • The sType value of each struct in the pNext chain must be unique
  • flags must be a valid combination of VkAttachmentDescriptionFlagBits values
  • format must be a valid VkFormat value
  • samples must be a valid VkSampleCountFlagBits value
  • loadOp must be a valid VkAttachmentLoadOp value
  • storeOp must be a valid VkAttachmentStoreOp value
  • stencilLoadOp must be a valid VkAttachmentLoadOp value
  • stencilStoreOp must be a valid VkAttachmentStoreOp value
  • initialLayout must be a valid VkImageLayout value
  • finalLayout must be a valid VkImageLayout value
See Also

VkRenderPassCreateInfo2

Layout


 struct VkAttachmentDescription2 {
     VkStructureType sType();
     void const * pNext();
     VkAttachmentDescriptionFlags flags();
     VkFormat format();
     VkSampleCountFlagBits samples();
     VkAttachmentLoadOp loadOp();
     VkAttachmentStoreOp storeOp();
     VkAttachmentLoadOp stencilLoadOp();
     VkAttachmentStoreOp stencilStoreOp();
     VkImageLayout initialLayout();
     VkImageLayout finalLayout();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int STYPE
      The struct member offsets.
    • PNEXT

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

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

      public static final int FORMAT
      The struct member offsets.
    • SAMPLES

      public static final int SAMPLES
      The struct member offsets.
    • LOADOP

      public static final int LOADOP
      The struct member offsets.
    • STOREOP

      public static final int STOREOP
      The struct member offsets.
    • STENCILLOADOP

      public static final int STENCILLOADOP
      The struct member offsets.
    • STENCILSTOREOP

      public static final int STENCILSTOREOP
      The struct member offsets.
    • INITIALLAYOUT

      public static final int INITIALLAYOUT
      The struct member offsets.
    • FINALLAYOUT

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

    • VkAttachmentDescription2

      public VkAttachmentDescription2(ByteBuffer container)
      Creates a VkAttachmentDescription2 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

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkAttachmentDescription2>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • flags

      public int flags()
      a bitmask of VkAttachmentDescriptionFlagBits specifying additional properties of the attachment.
    • format

      public int format()
      a VkFormat value specifying the format of the image that will be used for the attachment.
    • samples

      public int samples()
      a VkSampleCountFlagBits value specifying the number of samples of the image.
    • loadOp

      public int loadOp()
      a VkAttachmentLoadOp value specifying how the contents of color and depth components of the attachment are treated at the beginning of the subpass where it is first used.
    • storeOp

      public int storeOp()
      a VkAttachmentStoreOp value specifying how the contents of color and depth components of the attachment are treated at the end of the subpass where it is last used.
    • stencilLoadOp

      public int stencilLoadOp()
      a VkAttachmentLoadOp value specifying how the contents of stencil components of the attachment are treated at the beginning of the subpass where it is first used.
    • stencilStoreOp

      public int stencilStoreOp()
      a VkAttachmentStoreOp value specifying how the contents of stencil components of the attachment are treated at the end of the last subpass where it is used.
    • initialLayout

      public int initialLayout()
      the layout the attachment image subresource will be in when a render pass instance begins.
    • finalLayout

      public int finalLayout()
      the layout the attachment image subresource will be transitioned to when a render pass instance ends.
    • sType

      public VkAttachmentDescription2 sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkAttachmentDescription2 sType$Default()
    • pNext

      public VkAttachmentDescription2 pNext(long value)
      Sets the specified value to the pNext() field.
    • pNext

      Prepends the specified VkAttachmentDescriptionStencilLayout value to the pNext chain.
    • pNext

      Prepends the specified VkAttachmentDescriptionStencilLayoutKHR value to the pNext chain.
    • pNext

      Prepends the specified VkExternalFormatANDROID value to the pNext chain.
    • flags

      public VkAttachmentDescription2 flags(int value)
      Sets the specified value to the flags() field.
    • format

      public VkAttachmentDescription2 format(int value)
      Sets the specified value to the format() field.
    • samples

      public VkAttachmentDescription2 samples(int value)
      Sets the specified value to the samples() field.
    • loadOp

      public VkAttachmentDescription2 loadOp(int value)
      Sets the specified value to the loadOp() field.
    • storeOp

      public VkAttachmentDescription2 storeOp(int value)
      Sets the specified value to the storeOp() field.
    • stencilLoadOp

      public VkAttachmentDescription2 stencilLoadOp(int value)
      Sets the specified value to the stencilLoadOp() field.
    • stencilStoreOp

      public VkAttachmentDescription2 stencilStoreOp(int value)
      Sets the specified value to the stencilStoreOp() field.
    • initialLayout

      public VkAttachmentDescription2 initialLayout(int value)
      Sets the specified value to the initialLayout() field.
    • finalLayout

      public VkAttachmentDescription2 finalLayout(int value)
      Sets the specified value to the finalLayout() field.
    • set

      public VkAttachmentDescription2 set(int sType, long pNext, int flags, int format, int samples, int loadOp, int storeOp, int stencilLoadOp, int stencilStoreOp, int initialLayout, int finalLayout)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VkAttachmentDescription2 malloc()
      Returns a new VkAttachmentDescription2 instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VkAttachmentDescription2 calloc()
      Returns a new VkAttachmentDescription2 instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VkAttachmentDescription2 create()
      Returns a new VkAttachmentDescription2 instance allocated with BufferUtils.
    • create

      public static VkAttachmentDescription2 create(long address)
      Returns a new VkAttachmentDescription2 instance for the specified memory address.
    • createSafe

      public static @Nullable VkAttachmentDescription2 createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkAttachmentDescription2.Buffer malloc(int capacity)
      Returns a new VkAttachmentDescription2.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkAttachmentDescription2.Buffer calloc(int capacity)
      Returns a new VkAttachmentDescription2.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkAttachmentDescription2.Buffer create(int capacity)
      Returns a new VkAttachmentDescription2.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkAttachmentDescription2.Buffer create(long address, int capacity)
      Create a VkAttachmentDescription2.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VkAttachmentDescription2.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkAttachmentDescription2 malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkAttachmentDescription2 instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VkAttachmentDescription2 calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkAttachmentDescription2 instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VkAttachmentDescription2.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkAttachmentDescription2.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkAttachmentDescription2.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkAttachmentDescription2.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nsType

      public static int nsType(long struct)
      Unsafe version of sType().
    • npNext

      public static long npNext(long struct)
      Unsafe version of pNext().
    • nflags

      public static int nflags(long struct)
      Unsafe version of flags().
    • nformat

      public static int nformat(long struct)
      Unsafe version of format().
    • nsamples

      public static int nsamples(long struct)
      Unsafe version of samples().
    • nloadOp

      public static int nloadOp(long struct)
      Unsafe version of loadOp().
    • nstoreOp

      public static int nstoreOp(long struct)
      Unsafe version of storeOp().
    • nstencilLoadOp

      public static int nstencilLoadOp(long struct)
      Unsafe version of stencilLoadOp().
    • nstencilStoreOp

      public static int nstencilStoreOp(long struct)
      Unsafe version of stencilStoreOp().
    • ninitialLayout

      public static int ninitialLayout(long struct)
      Unsafe version of initialLayout().
    • nfinalLayout

      public static int nfinalLayout(long struct)
      Unsafe version of finalLayout().
    • nsType

      public static void nsType(long struct, int value)
      Unsafe version of sType.
    • npNext

      public static void npNext(long struct, long value)
      Unsafe version of pNext.
    • nflags

      public static void nflags(long struct, int value)
      Unsafe version of flags.
    • nformat

      public static void nformat(long struct, int value)
      Unsafe version of format.
    • nsamples

      public static void nsamples(long struct, int value)
      Unsafe version of samples.
    • nloadOp

      public static void nloadOp(long struct, int value)
      Unsafe version of loadOp.
    • nstoreOp

      public static void nstoreOp(long struct, int value)
      Unsafe version of storeOp.
    • nstencilLoadOp

      public static void nstencilLoadOp(long struct, int value)
      Unsafe version of stencilLoadOp.
    • nstencilStoreOp

      public static void nstencilStoreOp(long struct, int value)
      Unsafe version of stencilStoreOp.
    • ninitialLayout

      public static void ninitialLayout(long struct, int value)
      Unsafe version of initialLayout.
    • nfinalLayout

      public static void nfinalLayout(long struct, int value)
      Unsafe version of finalLayout.