Class VkSwapchainCreateInfoKHR
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Valid Usage
surfacemust be a surface that is supported by the device as determined usingGetPhysicalDeviceSurfaceSupportKHRminImageCountmust be less than or equal to the value returned in themaxImageCountmember of theVkSurfaceCapabilitiesKHRstructure returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface if the returnedmaxImageCountis not zero- If the
swapchainMaintenance1feature is not enabled, then thepNextchain must not include aVkSwapchainPresentModesCreateInfoEXTstructure - If
presentModeis notPRESENT_MODE_SHARED_DEMAND_REFRESH_KHRnorPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, thenminImageCountmust be greater than or equal to the value returned in theminImageCountmember of theVkSurfaceCapabilitiesKHRstructure returned byGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface minImageCountmust be 1 ifpresentModeis eitherPRESENT_MODE_SHARED_DEMAND_REFRESH_KHRorPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHRimageFormatandimageColorSpacemust match theformatandcolorSpacemembers, respectively, of one of theVkSurfaceFormatKHRstructures returned byvkGetPhysicalDeviceSurfaceFormatsKHRfor the surface- If a
VkSwapchainPresentScalingCreateInfoEXTstructure was not included in thepNextchain, or it is included andVkSwapchainPresentScalingCreateInfoEXT::scalingBehavioris zero thenimageExtentmust be betweenminImageExtentandmaxImageExtent, inclusive, whereminImageExtentandmaxImageExtentare members of theVkSurfaceCapabilitiesKHRstructure returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface - If a
VkSwapchainPresentScalingCreateInfoEXTstructure was included in thepNextchain andVkSwapchainPresentScalingCreateInfoEXT::scalingBehavioris not zero thenimageExtentmust be betweenminScaledImageExtentandmaxScaledImageExtent, inclusive, whereminScaledImageExtentandmaxScaledImageExtentare members of theVkSurfacePresentScalingCapabilitiesEXTstructure returned byvkGetPhysicalDeviceSurfaceCapabilities2KHRfor the surface andpresentMode - If the
swapchainMaintenance1feature is not enabled, thenflagsmust not includeSWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT imageExtentmemberswidthandheightmust both be non-zeroimageArrayLayersmust be greater than 0 and less than or equal to themaxImageArrayLayersmember of theVkSurfaceCapabilitiesKHRstructure returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface- If
presentModeisPRESENT_MODE_FIFO_LATEST_READY_EXT,PRESENT_MODE_IMMEDIATE_KHR,PRESENT_MODE_MAILBOX_KHR,PRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHR,imageUsagemust be a subset of the supported usage flags present in thesupportedUsageFlagsmember of theVkSurfaceCapabilitiesKHRstructure returned byGetPhysicalDeviceSurfaceCapabilitiesKHRforsurface - If
presentModeisPRESENT_MODE_SHARED_DEMAND_REFRESH_KHRorPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR,imageUsagemust be a subset of the supported usage flags present in thesharedPresentSupportedUsageFlagsmember of theVkSharedPresentSurfaceCapabilitiesKHRstructure returned byGetPhysicalDeviceSurfaceCapabilities2KHRforsurface - If
imageSharingModeisSHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
imageSharingModeisSHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than 1 - If
imageSharingModeisSHARING_MODE_CONCURRENT, each element ofpQueueFamilyIndicesmust be unique and must be less thanpQueueFamilyPropertyCountreturned by eitherGetPhysicalDeviceQueueFamilyPropertiesorGetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice preTransformmust be one of the bits present in thesupportedTransformsmember of theVkSurfaceCapabilitiesKHRstructure returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surfacecompositeAlphamust be one of the bits present in thesupportedCompositeAlphamember of theVkSurfaceCapabilitiesKHRstructure returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHRfor the surfacepresentModemust be one of theVkPresentModeKHRvalues returned byvkGetPhysicalDeviceSurfacePresentModesKHRfor the surface- If the
presentModeFifoLatestReadyfeature is not enabled,presentModemust not bePRESENT_MODE_FIFO_LATEST_READY_EXT - If the logical device was created with
VkDeviceGroupDeviceCreateInfo::physicalDeviceCountequal to 1,flagsmust not containSWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR - If
oldSwapchainis notNULL_HANDLE,oldSwapchainmust be a non-retired swapchain associated with native window referred to bysurface - The implied image creation parameters of the swapchain must be supported as reported by
GetPhysicalDeviceImageFormatProperties - If
flagscontainsSWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHRthen thepNextchain must include aVkImageFormatListCreateInfostructure with aviewFormatCountgreater than zero andpViewFormatsmust have an element equal toimageFormat - If a
VkImageFormatListCreateInfostructure was included in thepNextchain andVkImageFormatListCreateInfo::viewFormatCountis not zero then all of the formats inVkImageFormatListCreateInfo::pViewFormatsmust be compatible with theformatas described in the compatibility table - If
flagsdoes not containSWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHRand thepNextchain include aVkImageFormatListCreateInfostructure thenVkImageFormatListCreateInfo::viewFormatCountmust be 0 or 1 - If
flagscontainsSWAPCHAIN_CREATE_PROTECTED_BIT_KHR, thenVkSurfaceProtectedCapabilitiesKHR::supportsProtectedmust beTRUEin theVkSurfaceProtectedCapabilitiesKHRstructure returned byGetPhysicalDeviceSurfaceCapabilities2KHRforsurface - If the
pNextchain includes aVkSurfaceFullScreenExclusiveInfoEXTstructure with itsfullScreenExclusivemember set toFULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT, andsurfacewas created usingCreateWin32SurfaceKHR, aVkSurfaceFullScreenExclusiveWin32InfoEXTstructure must be included in thepNextchain - If the
imageCompressionControlSwapchainfeature is not enabled, thepNextchain must not include anVkImageCompressionControlEXTstructure
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofVkDeviceGroupSwapchainCreateInfoKHR,VkImageCompressionControlEXT,VkImageFormatListCreateInfo,VkSurfaceFullScreenExclusiveInfoEXT,VkSurfaceFullScreenExclusiveWin32InfoEXT,VkSwapchainCounterCreateInfoEXT,VkSwapchainDisplayNativeHdrCreateInfoAMD,VkSwapchainLatencyCreateInfoNV,VkSwapchainPresentBarrierCreateInfoNV,VkSwapchainPresentModesCreateInfoEXT, orVkSwapchainPresentScalingCreateInfoEXT - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofVkSwapchainCreateFlagBitsKHRvaluessurfacemust be a validVkSurfaceKHRhandleimageFormatmust be a validVkFormatvalueimageColorSpacemust be a validVkColorSpaceKHRvalueimageUsagemust be a valid combination ofVkImageUsageFlagBitsvaluesimageUsagemust not be 0imageSharingModemust be a validVkSharingModevaluepreTransformmust be a validVkSurfaceTransformFlagBitsKHRvaluecompositeAlphamust be a validVkCompositeAlphaFlagBitsKHRvaluepresentModemust be a validVkPresentModeKHRvalue- If
oldSwapchainis notNULL_HANDLE,oldSwapchainmust be a validVkSwapchainKHRhandle - Both of
oldSwapchain, andsurfacethat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameVkInstance
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();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkSwapchainCreateInfoKHR(ByteBuffer container) Creates aVkSwapchainCreateInfoKHRinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VkSwapchainCreateInfoKHRcalloc()Returns a newVkSwapchainCreateInfoKHRinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSwapchainCreateInfoKHRcalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkSwapchainCreateInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSwapchainCreateInfoKHRDeprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkSwapchainCreateInfoKHRcallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.booleanclipped()specifies whether the Vulkan implementation is allowed to discard rendering operations that affect regions of the surface that are not visible.clipped(boolean value) Sets the specified value to theclipped()field.intaVkCompositeAlphaFlagBitsKHRvalue indicating the alpha compositing mode to use when this surface is composited together with other surfaces on certain window systems.compositeAlpha(int value) Sets the specified value to thecompositeAlpha()field.static VkSwapchainCreateInfoKHRcreate()Returns a newVkSwapchainCreateInfoKHRinstance allocated withBufferUtils.create(int capacity) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withBufferUtils.static VkSwapchainCreateInfoKHRcreate(long address) Returns a newVkSwapchainCreateInfoKHRinstance for the specified memory address.create(long address, int capacity) Create aVkSwapchainCreateInfoKHR.Bufferinstance at the specified memory.static @Nullable VkSwapchainCreateInfoKHRcreateSafe(long address) static @Nullable VkSwapchainCreateInfoKHR.BuffercreateSafe(long address, int capacity) intflags()a bitmask ofVkSwapchainCreateFlagBitsKHRindicating parameters of the swapchain creation.flags(int value) Sets the specified value to theflags()field.intthe number of views in a multiview/stereo surface.imageArrayLayers(int value) Sets the specified value to theimageArrayLayers()field.intaVkColorSpaceKHRvalue specifying the way the swapchain interprets image data.imageColorSpace(int value) Sets the specified value to theimageColorSpace()field.the size (in pixels) of the swapchain image(s).imageExtent(Consumer<VkExtent2D> consumer) Passes theimageExtent()field to the specifiedConsumer.imageExtent(VkExtent2D value) Copies the specifiedVkExtent2Dto theimageExtent()field.intaVkFormatvalue specifying the format the swapchain image(s) will be created with.imageFormat(int value) Sets the specified value to theimageFormat()field.intthe sharing mode used for the image(s) of the swapchain.imageSharingMode(int value) Sets the specified value to theimageSharingMode()field.inta bitmask ofVkImageUsageFlagBitsdescribing the intended usage of the (acquired) swapchain images.imageUsage(int value) Sets the specified value to theimageUsage()field.static VkSwapchainCreateInfoKHRmalloc()Returns a newVkSwapchainCreateInfoKHRinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.static VkSwapchainCreateInfoKHRmalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkSwapchainCreateInfoKHRinstance allocated on the specifiedMemoryStack.static VkSwapchainCreateInfoKHRDeprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkSwapchainCreateInfoKHRmallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.intthe minimum number of presentable images that the application needs.minImageCount(int value) Sets the specified value to theminImageCount()field.static intnclipped(long struct) Unsafe version ofclipped().static voidnclipped(long struct, int value) Unsafe version ofclipped.static intncompositeAlpha(long struct) Unsafe version ofcompositeAlpha().static voidncompositeAlpha(long struct, int value) Unsafe version ofcompositeAlpha.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static intnimageArrayLayers(long struct) Unsafe version ofimageArrayLayers().static voidnimageArrayLayers(long struct, int value) Unsafe version ofimageArrayLayers.static intnimageColorSpace(long struct) Unsafe version ofimageColorSpace().static voidnimageColorSpace(long struct, int value) Unsafe version ofimageColorSpace.static VkExtent2DnimageExtent(long struct) Unsafe version ofimageExtent().static voidnimageExtent(long struct, VkExtent2D value) Unsafe version ofimageExtent.static intnimageFormat(long struct) Unsafe version ofimageFormat().static voidnimageFormat(long struct, int value) Unsafe version ofimageFormat.static intnimageSharingMode(long struct) Unsafe version ofimageSharingMode().static voidnimageSharingMode(long struct, int value) Unsafe version ofimageSharingMode.static intnimageUsage(long struct) Unsafe version ofimageUsage().static voidnimageUsage(long struct, int value) Unsafe version ofimageUsage.static intnminImageCount(long struct) Unsafe version ofminImageCount().static voidnminImageCount(long struct, int value) Unsafe version ofminImageCount.static longnoldSwapchain(long struct) Unsafe version ofoldSwapchain().static voidnoldSwapchain(long struct, long value) Unsafe version ofoldSwapchain.static longnpNext(long struct) Unsafe version ofpNext().static voidnpNext(long struct, long value) Unsafe version ofpNext.static @Nullable IntBuffernpQueueFamilyIndices(long struct) Unsafe version ofpQueueFamilyIndices.static voidnpQueueFamilyIndices(long struct, @Nullable IntBuffer value) Unsafe version ofpQueueFamilyIndices.static intnpresentMode(long struct) Unsafe version ofpresentMode().static voidnpresentMode(long struct, int value) Unsafe version ofpresentMode.static intnpreTransform(long struct) Unsafe version ofpreTransform().static voidnpreTransform(long struct, int value) Unsafe version ofpreTransform.static intnqueueFamilyIndexCount(long struct) Unsafe version ofqueueFamilyIndexCount().static voidnqueueFamilyIndexCount(long struct, int value) Sets the specified value to thequeueFamilyIndexCountfield of the specifiedstruct.static intnsType(long struct) Unsafe version ofsType().static voidnsType(long struct, int value) Unsafe version ofsType.static longnsurface(long struct) Unsafe version ofsurface().static voidnsurface(long struct, long value) Unsafe version ofsurface.longNULL_HANDLE, or the existing non-retired swapchain currently associated withsurface.oldSwapchain(long value) Sets the specified value to theoldSwapchain()field.longpNext()NULLor a pointer to a structure extending this structure.pNext(long value) Sets the specified value to thepNext()field.Prepends the specifiedVkDeviceGroupSwapchainCreateInfoKHRvalue to thepNextchain.Prepends the specifiedVkImageCompressionControlEXTvalue to thepNextchain.pNext(VkImageFormatListCreateInfo value) Prepends the specifiedVkImageFormatListCreateInfovalue to thepNextchain.Prepends the specifiedVkImageFormatListCreateInfoKHRvalue to thepNextchain.Prepends the specifiedVkSurfaceFullScreenExclusiveInfoEXTvalue to thepNextchain.Prepends the specifiedVkSurfaceFullScreenExclusiveWin32InfoEXTvalue to thepNextchain.Prepends the specifiedVkSwapchainCounterCreateInfoEXTvalue to thepNextchain.Prepends the specifiedVkSwapchainDisplayNativeHdrCreateInfoAMDvalue to thepNextchain.Prepends the specifiedVkSwapchainLatencyCreateInfoNVvalue to thepNextchain.Prepends the specifiedVkSwapchainPresentBarrierCreateInfoNVvalue to thepNextchain.Prepends the specifiedVkSwapchainPresentModesCreateInfoEXTvalue to thepNextchain.Prepends the specifiedVkSwapchainPresentScalingCreateInfoEXTvalue to thepNextchain.@Nullable IntBuffera pointer to an array of queue family indices having access to the images(s) of the swapchain whenimageSharingModeisSHARING_MODE_CONCURRENT.pQueueFamilyIndices(@Nullable IntBuffer value) Sets the address of the specifiedIntBufferto thepQueueFamilyIndices()field.intthe presentation mode the swapchain will use.presentMode(int value) Sets the specified value to thepresentMode()field.intaVkSurfaceTransformFlagBitsKHRvalue describing the transform, relative to the presentation engine’s natural orientation, applied to the image content prior to presentation.preTransform(int value) Sets the specified value to thepreTransform()field.intthe number of queue families having access to the image(s) of the swapchain whenimageSharingModeisSHARING_MODE_CONCURRENT.queueFamilyIndexCount(int value) Sets the specified value to thequeueFamilyIndexCount()field.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.Copies the specified struct data to this struct.intsizeof()intsType()aVkStructureTypevalue identifying this structure.sType(int value) Sets the specified value to thesType()field.Sets theSTRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHRvalue to thesType()field.longsurface()the surface onto which the swapchain will present images.surface(long value) Sets the specified value to thesurface()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
STYPE
public static final int STYPEThe struct member offsets. -
PNEXT
public static final int PNEXTThe struct member offsets. -
FLAGS
public static final int FLAGSThe struct member offsets. -
SURFACE
public static final int SURFACEThe struct member offsets. -
MINIMAGECOUNT
public static final int MINIMAGECOUNTThe struct member offsets. -
IMAGEFORMAT
public static final int IMAGEFORMATThe struct member offsets. -
IMAGECOLORSPACE
public static final int IMAGECOLORSPACEThe struct member offsets. -
IMAGEEXTENT
public static final int IMAGEEXTENTThe struct member offsets. -
IMAGEARRAYLAYERS
public static final int IMAGEARRAYLAYERSThe struct member offsets. -
IMAGEUSAGE
public static final int IMAGEUSAGEThe struct member offsets. -
IMAGESHARINGMODE
public static final int IMAGESHARINGMODEThe struct member offsets. -
QUEUEFAMILYINDEXCOUNT
public static final int QUEUEFAMILYINDEXCOUNTThe struct member offsets. -
PQUEUEFAMILYINDICES
public static final int PQUEUEFAMILYINDICESThe struct member offsets. -
PRETRANSFORM
public static final int PRETRANSFORMThe struct member offsets. -
COMPOSITEALPHA
public static final int COMPOSITEALPHAThe struct member offsets. -
PRESENTMODE
public static final int PRESENTMODEThe struct member offsets. -
CLIPPED
public static final int CLIPPEDThe struct member offsets. -
OLDSWAPCHAIN
public static final int OLDSWAPCHAINThe struct member offsets.
-
-
Constructor Details
-
VkSwapchainCreateInfoKHR
Creates aVkSwapchainCreateInfoKHRinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct<VkSwapchainCreateInfoKHR>
-
sType
public int sType()aVkStructureTypevalue identifying this structure. -
pNext
public long pNext()NULLor a pointer to a structure extending this structure. -
flags
public int flags()a bitmask ofVkSwapchainCreateFlagBitsKHRindicating 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 withsurface. -
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()aVkFormatvalue specifying the format the swapchain image(s) will be created with. -
imageColorSpace
public int imageColorSpace()aVkColorSpaceKHRvalue specifying the way the swapchain interprets image data. -
imageExtent
the size (in pixels) of the swapchain image(s). The behavior is platform-dependent if the image extent does not match the surface’scurrentExtentas returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHR.Note
On some platforms, it is normal that
maxImageExtentmay 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 throughVkSwapchainPresentScalingCreateInfoEXT, 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 ofVkImageUsageFlagBitsdescribing 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 whenimageSharingModeisSHARING_MODE_CONCURRENT. -
pQueueFamilyIndices
a pointer to an array of queue family indices having access to the images(s) of the swapchain whenimageSharingModeisSHARING_MODE_CONCURRENT. -
preTransform
public int preTransform()aVkSurfaceTransformFlagBitsKHRvalue describing the transform, relative to the presentation engine’s natural orientation, applied to the image content prior to presentation. If it does not match thecurrentTransformvalue returned byvkGetPhysicalDeviceSurfaceCapabilitiesKHR, the presentation engine will transform the image content as part of the presentation operation. -
compositeAlpha
public int compositeAlpha()aVkCompositeAlphaFlagBitsKHRvalue 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
clippedisTRUE, 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. SettingTRUEdoes not guarantee any clipping will occur, but allows more efficient presentation methods to be used on some platforms. - If
clippedisFALSE, presentable images associated with the swapchain will own all of the pixels they contain.Note
Applications should set this value to
TRUEif 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.
- If
-
oldSwapchain
public long oldSwapchain()NULL_HANDLE, or the existing non-retired swapchain currently associated withsurface. Providing a validoldSwapchainmay aid in the resource reuse, and also allows the application to still present any images that are already acquired from it.Upon calling
vkCreateSwapchainKHRwith anoldSwapchainthat is notNULL_HANDLE,oldSwapchainis retired — even if creation of the new swapchain fails. The new swapchain is created in the non-retired state whether or notoldSwapchainisNULL_HANDLE.Upon calling
vkCreateSwapchainKHRwith anoldSwapchainthat is notNULL_HANDLE, any images fromoldSwapchainthat 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 destroyoldSwapchainto free all memory associated witholdSwapchain.Note
Multiple retired swapchains can be associated with the same
VkSurfaceKHRthrough multiple uses ofoldSwapchainthat outnumber calls toDestroySwapchainKHR.After
oldSwapchainis retired, the application can pass toQueuePresentKHRany images it had already acquired fromoldSwapchain. 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,QueuePresentKHRmay fail ifoldSwapchainhas entered a state that causesERROR_OUT_OF_DATE_KHRto be returned.The application can continue to use a shared presentable image obtained from
oldSwapchainuntil a presentable image is acquired from the new swapchain, as long as it has not entered a state that causes it to returnERROR_OUT_OF_DATE_KHR. -
sType
Sets the specified value to thesType()field. -
sType$Default
Sets theSTRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHRvalue to thesType()field. -
pNext
Sets the specified value to thepNext()field. -
pNext
Prepends the specifiedVkDeviceGroupSwapchainCreateInfoKHRvalue to thepNextchain. -
pNext
Prepends the specifiedVkImageCompressionControlEXTvalue to thepNextchain. -
pNext
Prepends the specifiedVkImageFormatListCreateInfovalue to thepNextchain. -
pNext
Prepends the specifiedVkImageFormatListCreateInfoKHRvalue to thepNextchain. -
pNext
Prepends the specifiedVkSurfaceFullScreenExclusiveInfoEXTvalue to thepNextchain. -
pNext
Prepends the specifiedVkSurfaceFullScreenExclusiveWin32InfoEXTvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainCounterCreateInfoEXTvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainDisplayNativeHdrCreateInfoAMDvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainLatencyCreateInfoNVvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainPresentBarrierCreateInfoNVvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainPresentModesCreateInfoEXTvalue to thepNextchain. -
pNext
Prepends the specifiedVkSwapchainPresentScalingCreateInfoEXTvalue to thepNextchain. -
flags
Sets the specified value to theflags()field. -
surface
Sets the specified value to thesurface()field. -
minImageCount
Sets the specified value to theminImageCount()field. -
imageFormat
Sets the specified value to theimageFormat()field. -
imageColorSpace
Sets the specified value to theimageColorSpace()field. -
imageExtent
Copies the specifiedVkExtent2Dto theimageExtent()field. -
imageExtent
Passes theimageExtent()field to the specifiedConsumer. -
imageArrayLayers
Sets the specified value to theimageArrayLayers()field. -
imageUsage
Sets the specified value to theimageUsage()field. -
imageSharingMode
Sets the specified value to theimageSharingMode()field. -
queueFamilyIndexCount
Sets the specified value to thequeueFamilyIndexCount()field. -
pQueueFamilyIndices
Sets the address of the specifiedIntBufferto thepQueueFamilyIndices()field. -
preTransform
Sets the specified value to thepreTransform()field. -
compositeAlpha
Sets the specified value to thecompositeAlpha()field. -
presentMode
Sets the specified value to thepresentMode()field. -
clipped
Sets the specified value to theclipped()field. -
oldSwapchain
Sets the specified value to theoldSwapchain()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
Returns a newVkSwapchainCreateInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkSwapchainCreateInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkSwapchainCreateInfoKHRinstance allocated withBufferUtils. -
create
Returns a newVkSwapchainCreateInfoKHRinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkSwapchainCreateInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(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. Usemalloc(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. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkSwapchainCreateInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkSwapchainCreateInfoKHRinstance allocated on the specifiedMemoryStackand 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 newVkSwapchainCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkSwapchainCreateInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkSwapchainCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nsType
public static int nsType(long struct) Unsafe version ofsType(). -
npNext
public static long npNext(long struct) Unsafe version ofpNext(). -
nflags
public static int nflags(long struct) Unsafe version offlags(). -
nsurface
public static long nsurface(long struct) Unsafe version ofsurface(). -
nminImageCount
public static int nminImageCount(long struct) Unsafe version ofminImageCount(). -
nimageFormat
public static int nimageFormat(long struct) Unsafe version ofimageFormat(). -
nimageColorSpace
public static int nimageColorSpace(long struct) Unsafe version ofimageColorSpace(). -
nimageExtent
Unsafe version ofimageExtent(). -
nimageArrayLayers
public static int nimageArrayLayers(long struct) Unsafe version ofimageArrayLayers(). -
nimageUsage
public static int nimageUsage(long struct) Unsafe version ofimageUsage(). -
nimageSharingMode
public static int nimageSharingMode(long struct) Unsafe version ofimageSharingMode(). -
nqueueFamilyIndexCount
public static int nqueueFamilyIndexCount(long struct) Unsafe version ofqueueFamilyIndexCount(). -
npQueueFamilyIndices
Unsafe version ofpQueueFamilyIndices. -
npreTransform
public static int npreTransform(long struct) Unsafe version ofpreTransform(). -
ncompositeAlpha
public static int ncompositeAlpha(long struct) Unsafe version ofcompositeAlpha(). -
npresentMode
public static int npresentMode(long struct) Unsafe version ofpresentMode(). -
nclipped
public static int nclipped(long struct) Unsafe version ofclipped(). -
noldSwapchain
public static long noldSwapchain(long struct) Unsafe version ofoldSwapchain(). -
nsType
public static void nsType(long struct, int value) Unsafe version ofsType. -
npNext
public static void npNext(long struct, long value) Unsafe version ofpNext. -
nflags
public static void nflags(long struct, int value) Unsafe version offlags. -
nsurface
public static void nsurface(long struct, long value) Unsafe version ofsurface. -
nminImageCount
public static void nminImageCount(long struct, int value) Unsafe version ofminImageCount. -
nimageFormat
public static void nimageFormat(long struct, int value) Unsafe version ofimageFormat. -
nimageColorSpace
public static void nimageColorSpace(long struct, int value) Unsafe version ofimageColorSpace. -
nimageExtent
Unsafe version ofimageExtent. -
nimageArrayLayers
public static void nimageArrayLayers(long struct, int value) Unsafe version ofimageArrayLayers. -
nimageUsage
public static void nimageUsage(long struct, int value) Unsafe version ofimageUsage. -
nimageSharingMode
public static void nimageSharingMode(long struct, int value) Unsafe version ofimageSharingMode. -
nqueueFamilyIndexCount
public static void nqueueFamilyIndexCount(long struct, int value) Sets the specified value to thequeueFamilyIndexCountfield of the specifiedstruct. -
npQueueFamilyIndices
Unsafe version ofpQueueFamilyIndices. -
npreTransform
public static void npreTransform(long struct, int value) Unsafe version ofpreTransform. -
ncompositeAlpha
public static void ncompositeAlpha(long struct, int value) Unsafe version ofcompositeAlpha. -
npresentMode
public static void npresentMode(long struct, int value) Unsafe version ofpresentMode. -
nclipped
public static void nclipped(long struct, int value) Unsafe version ofclipped. -
noldSwapchain
public static void noldSwapchain(long struct, long value) Unsafe version ofoldSwapchain.
-