Class VkSurfacePresentModeEXT

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

public class VkSurfacePresentModeEXT extends org.lwjgl.system.Struct<VkSurfacePresentModeEXT> implements org.lwjgl.system.NativeResource
Structure describing present mode of a surface.
Description

If the VkSurfacePresentModeEXT structure is included in the pNext chain of VkPhysicalDeviceSurfaceInfo2KHR, the values returned in VkSurfaceCapabilitiesKHR::minImageCount, VkSurfaceCapabilitiesKHR::maxImageCount, VkSurfacePresentScalingCapabilitiesEXT::minScaledImageExtent, and VkSurfacePresentScalingCapabilitiesEXT::maxScaledImageExtent are valid only for the specified presentMode. If presentMode is PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, the per-present mode image counts must both be one. The per-present mode image counts may be less-than or greater-than the image counts returned when VkSurfacePresentModeEXT is not provided.

Note

If VkSwapchainPresentModesCreateInfoEXT is provided to swapchain creation, the requirements for forward progress may be less strict. For example, a FIFO swapchain might only require 2 images to guarantee forward progress, but a MAILBOX one might require 4. Without the per-present image counts, such an implementation would have to return 4 in VkSurfaceCapabilitiesKHR::minImageCount, which pessimizes FIFO. Conversely, an implementation may return a low number for minImageCount, but internally bump the image count when application queries GetSwapchainImagesKHR, which can surprise applications, and is not discoverable until swapchain creation. Using VkSurfacePresentModeEXT and VkSwapchainPresentModesCreateInfoEXT together effectively removes this problem.

VkSwapchainPresentModesCreateInfoEXT is required for the specification to be backwards compatible with applications that do not know about, or make use of this feature.

Valid Usage
Valid Usage (Implicit)

Layout


 struct VkSurfacePresentModeEXT {
     VkStructureType sType();
     void * pNext();
     VkPresentModeKHR presentMode();
 }
  • 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.
    • PRESENTMODE

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

    • VkSurfacePresentModeEXT

      public VkSurfacePresentModeEXT(ByteBuffer container)
      Creates a VkSurfacePresentModeEXT 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<VkSurfacePresentModeEXT>
    • sType

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

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

      public int presentMode()
      the presentation mode the swapchain will use.
    • sType

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

      public VkSurfacePresentModeEXT sType$Default()
    • pNext

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

      public VkSurfacePresentModeEXT presentMode(int value)
      Sets the specified value to the presentMode() field.
    • set

      public VkSurfacePresentModeEXT set(int sType, long pNext, int presentMode)
      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 VkSurfacePresentModeEXT malloc()
      Returns a new VkSurfacePresentModeEXT instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkSurfacePresentModeEXT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkSurfacePresentModeEXT.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().
    • npresentMode

      public static int npresentMode(long struct)
      Unsafe version of presentMode().
    • 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.
    • npresentMode

      public static void npresentMode(long struct, int value)
      Unsafe version of presentMode.