Class VkSwapchainCreateInfoKHR

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

public class VkSwapchainCreateInfoKHR extends org.lwjgl.system.Struct<VkSwapchainCreateInfoKHR> implements org.lwjgl.system.NativeResource
Structure specifying parameters of a newly created swapchain object.
Valid Usage
Valid Usage (Implicit)
See Also

VkExtent2D, CreateSharedSwapchainsKHR, CreateSwapchainKHR

Layout


 struct VkSwapchainCreateInfoKHR {
     VkStructureType sType();
     void const * pNext();
     VkSwapchainCreateFlagsKHR flags();
     VkSurfaceKHR surface();
     uint32_t minImageCount();
     VkFormat imageFormat();
     VkColorSpaceKHR imageColorSpace();
     VkExtent2D imageExtent();
     uint32_t imageArrayLayers();
     VkImageUsageFlags imageUsage();
     VkSharingMode imageSharingMode();
     uint32_t queueFamilyIndexCount();
     uint32_t const * pQueueFamilyIndices();
     VkSurfaceTransformFlagBitsKHR preTransform();
     VkCompositeAlphaFlagBitsKHR compositeAlpha();
     VkPresentModeKHR presentMode();
     VkBool32 clipped();
     VkSwapchainKHR oldSwapchain();
 }
  • 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.
    • SURFACE

      public static final int SURFACE
      The struct member offsets.
    • MINIMAGECOUNT

      public static final int MINIMAGECOUNT
      The struct member offsets.
    • IMAGEFORMAT

      public static final int IMAGEFORMAT
      The struct member offsets.
    • IMAGECOLORSPACE

      public static final int IMAGECOLORSPACE
      The struct member offsets.
    • IMAGEEXTENT

      public static final int IMAGEEXTENT
      The struct member offsets.
    • IMAGEARRAYLAYERS

      public static final int IMAGEARRAYLAYERS
      The struct member offsets.
    • IMAGEUSAGE

      public static final int IMAGEUSAGE
      The struct member offsets.
    • IMAGESHARINGMODE

      public static final int IMAGESHARINGMODE
      The struct member offsets.
    • QUEUEFAMILYINDEXCOUNT

      public static final int QUEUEFAMILYINDEXCOUNT
      The struct member offsets.
    • PQUEUEFAMILYINDICES

      public static final int PQUEUEFAMILYINDICES
      The struct member offsets.
    • PRETRANSFORM

      public static final int PRETRANSFORM
      The struct member offsets.
    • COMPOSITEALPHA

      public static final int COMPOSITEALPHA
      The struct member offsets.
    • PRESENTMODE

      public static final int PRESENTMODE
      The struct member offsets.
    • CLIPPED

      public static final int CLIPPED
      The struct member offsets.
    • OLDSWAPCHAIN

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

    • VkSwapchainCreateInfoKHR

      public VkSwapchainCreateInfoKHR(ByteBuffer container)
      Creates a VkSwapchainCreateInfoKHR 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<VkSwapchainCreateInfoKHR>
    • 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 VkSwapchainCreateFlagBitsKHR indicating parameters of the swapchain creation.
    • surface

      public long surface()
      the surface onto which the swapchain will present images. If the creation succeeds, the swapchain becomes associated with surface.
    • minImageCount

      public int minImageCount()
      the minimum number of presentable images that the application needs. The implementation will either create the swapchain with at least that many images, or it will fail to create the swapchain.
    • imageFormat

      public int imageFormat()
      a VkFormat value specifying the format the swapchain image(s) will be created with.
    • imageColorSpace

      public int imageColorSpace()
      a VkColorSpaceKHR value specifying the way the swapchain interprets image data.
    • imageExtent

      public VkExtent2D imageExtent()
      the size (in pixels) of the swapchain image(s). The behavior is platform-dependent if the image extent does not match the surface’s currentExtent as returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR.
      Note

      On some platforms, it is normal that maxImageExtent may become (0, 0), for example when the window is minimized. In such a case, it is not possible to create a swapchain due to the Valid Usage requirements , unless scaling is selected through VkSwapchainPresentScalingCreateInfoEXT, if supported .

    • imageArrayLayers

      public int imageArrayLayers()
      the number of views in a multiview/stereo surface. For non-stereoscopic-3D applications, this value is 1.
    • imageUsage

      public int imageUsage()
      a bitmask of VkImageUsageFlagBits describing the intended usage of the (acquired) swapchain images.
    • imageSharingMode

      public int imageSharingMode()
      the sharing mode used for the image(s) of the swapchain.
    • queueFamilyIndexCount

      public int queueFamilyIndexCount()
      the number of queue families having access to the image(s) of the swapchain when imageSharingMode is SHARING_MODE_CONCURRENT.
    • pQueueFamilyIndices

      public @Nullable IntBuffer pQueueFamilyIndices()
      a pointer to an array of queue family indices having access to the images(s) of the swapchain when imageSharingMode is SHARING_MODE_CONCURRENT.
    • preTransform

      public int preTransform()
      a VkSurfaceTransformFlagBitsKHR value describing the transform, relative to the presentation engine’s natural orientation, applied to the image content prior to presentation. If it does not match the currentTransform value returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR, the presentation engine will transform the image content as part of the presentation operation.
    • compositeAlpha

      public int compositeAlpha()
      a VkCompositeAlphaFlagBitsKHR value indicating the alpha compositing mode to use when this surface is composited together with other surfaces on certain window systems.
    • presentMode

      public int presentMode()
      the presentation mode the swapchain will use. A swapchain’s present mode determines how incoming present requests will be processed and queued internally.
    • clipped

      public boolean clipped()
      specifies whether the Vulkan implementation is allowed to discard rendering operations that affect regions of the surface that are not visible.
      • If clipped is TRUE, the presentable images associated with the swapchain may not own all of their pixels. Pixels in the presentable images that correspond to regions of the target surface obscured by another window on the desktop, or subject to some other clipping mechanism will have undefined content when read back. Fragment shaders may not execute for these pixels, and thus any side effects they would have had will not occur. Setting TRUE does not guarantee any clipping will occur, but allows more efficient presentation methods to be used on some platforms.
      • If clipped is FALSE, presentable images associated with the swapchain will own all of the pixels they contain.
        Note

        Applications should set this value to TRUE if they do not expect to read back the content of presentable images before presenting them or after reacquiring them, and if their fragment shaders do not have any side effects that require them to run for all pixels in the presentable image.

    • oldSwapchain

      public long oldSwapchain()
      NULL_HANDLE, or the existing non-retired swapchain currently associated with surface. Providing a valid oldSwapchain may aid in the resource reuse, and also allows the application to still present any images that are already acquired from it.

      Upon calling vkCreateSwapchainKHR with an oldSwapchain that is not NULL_HANDLE, oldSwapchain is retired — even if creation of the new swapchain fails. The new swapchain is created in the non-retired state whether or not oldSwapchain is NULL_HANDLE.

      Upon calling vkCreateSwapchainKHR with an oldSwapchain that is not NULL_HANDLE, any images from oldSwapchain that are not acquired by the application may be freed by the implementation, which may occur even if creation of the new swapchain fails. The application can destroy oldSwapchain to free all memory associated with oldSwapchain.

      Note

      Multiple retired swapchains can be associated with the same VkSurfaceKHR through multiple uses of oldSwapchain that outnumber calls to DestroySwapchainKHR.

      After oldSwapchain is retired, the application can pass to QueuePresentKHR any images it had already acquired from oldSwapchain. E.g., an application may present an image from the old swapchain before an image from the new swapchain is ready to be presented. As usual, QueuePresentKHR may fail if oldSwapchain has entered a state that causes ERROR_OUT_OF_DATE_KHR to be returned.

      The application can continue to use a shared presentable image obtained from oldSwapchain until a presentable image is acquired from the new swapchain, as long as it has not entered a state that causes it to return ERROR_OUT_OF_DATE_KHR.

    • sType

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

      public VkSwapchainCreateInfoKHR sType$Default()
    • pNext

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

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

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

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

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

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

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

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

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

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

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

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

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

      public VkSwapchainCreateInfoKHR flags(int value)
      Sets the specified value to the flags() field.
    • surface

      public VkSwapchainCreateInfoKHR surface(long value)
      Sets the specified value to the surface() field.
    • minImageCount

      public VkSwapchainCreateInfoKHR minImageCount(int value)
      Sets the specified value to the minImageCount() field.
    • imageFormat

      public VkSwapchainCreateInfoKHR imageFormat(int value)
      Sets the specified value to the imageFormat() field.
    • imageColorSpace

      public VkSwapchainCreateInfoKHR imageColorSpace(int value)
      Sets the specified value to the imageColorSpace() field.
    • imageExtent

      public VkSwapchainCreateInfoKHR imageExtent(VkExtent2D value)
      Copies the specified VkExtent2D to the imageExtent() field.
    • imageExtent

      public VkSwapchainCreateInfoKHR imageExtent(Consumer<VkExtent2D> consumer)
      Passes the imageExtent() field to the specified Consumer.
    • imageArrayLayers

      public VkSwapchainCreateInfoKHR imageArrayLayers(int value)
      Sets the specified value to the imageArrayLayers() field.
    • imageUsage

      public VkSwapchainCreateInfoKHR imageUsage(int value)
      Sets the specified value to the imageUsage() field.
    • imageSharingMode

      public VkSwapchainCreateInfoKHR imageSharingMode(int value)
      Sets the specified value to the imageSharingMode() field.
    • queueFamilyIndexCount

      public VkSwapchainCreateInfoKHR queueFamilyIndexCount(int value)
      Sets the specified value to the queueFamilyIndexCount() field.
    • pQueueFamilyIndices

      public VkSwapchainCreateInfoKHR pQueueFamilyIndices(@Nullable IntBuffer value)
      Sets the address of the specified IntBuffer to the pQueueFamilyIndices() field.
    • preTransform

      public VkSwapchainCreateInfoKHR preTransform(int value)
      Sets the specified value to the preTransform() field.
    • compositeAlpha

      public VkSwapchainCreateInfoKHR compositeAlpha(int value)
      Sets the specified value to the compositeAlpha() field.
    • presentMode

      public VkSwapchainCreateInfoKHR presentMode(int value)
      Sets the specified value to the presentMode() field.
    • clipped

      public VkSwapchainCreateInfoKHR clipped(boolean value)
      Sets the specified value to the clipped() field.
    • oldSwapchain

      public VkSwapchainCreateInfoKHR oldSwapchain(long value)
      Sets the specified value to the oldSwapchain() field.
    • set

      public VkSwapchainCreateInfoKHR set(int sType, long pNext, int flags, long surface, int minImageCount, int imageFormat, int imageColorSpace, VkExtent2D imageExtent, int imageArrayLayers, int imageUsage, int imageSharingMode, int queueFamilyIndexCount, @Nullable IntBuffer pQueueFamilyIndices, int preTransform, int compositeAlpha, int presentMode, boolean clipped, long oldSwapchain)
      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 VkSwapchainCreateInfoKHR malloc()
      Returns a new VkSwapchainCreateInfoKHR instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

      @Deprecated public static VkSwapchainCreateInfoKHR mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSwapchainCreateInfoKHR callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSwapchainCreateInfoKHR mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSwapchainCreateInfoKHR callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSwapchainCreateInfoKHR.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSwapchainCreateInfoKHR.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSwapchainCreateInfoKHR.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSwapchainCreateInfoKHR.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

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

      public static long nsurface(long struct)
      Unsafe version of surface().
    • nminImageCount

      public static int nminImageCount(long struct)
      Unsafe version of minImageCount().
    • nimageFormat

      public static int nimageFormat(long struct)
      Unsafe version of imageFormat().
    • nimageColorSpace

      public static int nimageColorSpace(long struct)
      Unsafe version of imageColorSpace().
    • nimageExtent

      public static VkExtent2D nimageExtent(long struct)
      Unsafe version of imageExtent().
    • nimageArrayLayers

      public static int nimageArrayLayers(long struct)
      Unsafe version of imageArrayLayers().
    • nimageUsage

      public static int nimageUsage(long struct)
      Unsafe version of imageUsage().
    • nimageSharingMode

      public static int nimageSharingMode(long struct)
      Unsafe version of imageSharingMode().
    • nqueueFamilyIndexCount

      public static int nqueueFamilyIndexCount(long struct)
      Unsafe version of queueFamilyIndexCount().
    • npQueueFamilyIndices

      public static @Nullable IntBuffer npQueueFamilyIndices(long struct)
      Unsafe version of pQueueFamilyIndices.
    • npreTransform

      public static int npreTransform(long struct)
      Unsafe version of preTransform().
    • ncompositeAlpha

      public static int ncompositeAlpha(long struct)
      Unsafe version of compositeAlpha().
    • npresentMode

      public static int npresentMode(long struct)
      Unsafe version of presentMode().
    • nclipped

      public static int nclipped(long struct)
      Unsafe version of clipped().
    • noldSwapchain

      public static long noldSwapchain(long struct)
      Unsafe version of oldSwapchain().
    • 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.
    • nsurface

      public static void nsurface(long struct, long value)
      Unsafe version of surface.
    • nminImageCount

      public static void nminImageCount(long struct, int value)
      Unsafe version of minImageCount.
    • nimageFormat

      public static void nimageFormat(long struct, int value)
      Unsafe version of imageFormat.
    • nimageColorSpace

      public static void nimageColorSpace(long struct, int value)
      Unsafe version of imageColorSpace.
    • nimageExtent

      public static void nimageExtent(long struct, VkExtent2D value)
      Unsafe version of imageExtent.
    • nimageArrayLayers

      public static void nimageArrayLayers(long struct, int value)
      Unsafe version of imageArrayLayers.
    • nimageUsage

      public static void nimageUsage(long struct, int value)
      Unsafe version of imageUsage.
    • nimageSharingMode

      public static void nimageSharingMode(long struct, int value)
      Unsafe version of imageSharingMode.
    • nqueueFamilyIndexCount

      public static void nqueueFamilyIndexCount(long struct, int value)
      Sets the specified value to the queueFamilyIndexCount field of the specified struct.
    • npQueueFamilyIndices

      public static void npQueueFamilyIndices(long struct, @Nullable IntBuffer value)
      Unsafe version of pQueueFamilyIndices.
    • npreTransform

      public static void npreTransform(long struct, int value)
      Unsafe version of preTransform.
    • ncompositeAlpha

      public static void ncompositeAlpha(long struct, int value)
      Unsafe version of compositeAlpha.
    • npresentMode

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

      public static void nclipped(long struct, int value)
      Unsafe version of clipped.
    • noldSwapchain

      public static void noldSwapchain(long struct, long value)
      Unsafe version of oldSwapchain.