| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_KHR_swapchain_maintenance1
Description
Name
VK_KHR_swapchain_maintenance1 - device extension
VK_KHR_swapchain_maintenance1
- Name String
VK_KHR_swapchain_maintenance1
- Extension Type
- Device extension
- Registered Extension Number
- 488
- Revision
- 1
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_swapchain and VK_KHR_surface_maintenance1 and
VK_KHR_get_physical_device_properties2 or
- Contact
- Extension Proposal
- VK_KHR_swapchain_maintenance1
Other Extension Metadata
- Last Modified Date
- 2025-03-31
- Contributors
- James Jones, NVIDIA
- Jeff Juliano, NVIDIA
- Shahbaz Youssefi, Google
- Chris Forbes, Google
- Ian Elliott, Google
- Yiwei Zhang, Google
- Charlie Lao, Google
- Lina Versace, Google
- Ralph Potter, Samsung
- Igor Nazarov, Samsung
- Hyunchang Kim, Samsung
- Suenghwan Lee, Samsung
- Munseong Kang, Samsung
- Joonyong Park, Samsung
- Hans-Kristian Arntzen, Valve
- Lisa Wu, Arm
- Daniel Stone, Collabora
- Pan Gao, Huawei
Description
This extension is based off the VK_EXT_swapchain_maintenance1
extension.
VK_KHR_swapchain_maintenance1 adds a collection of window system
integration features that were intentionally left out or overlooked in
the original VK_KHR_swapchain extension.
The new features are as follows:
- Specify a fence that will be signaled when the resources associated with a present operation can be safely destroyed.
- Allow changing the present mode a swapchain is using at per-present granularity.
- Allow applications to define the behavior when presenting a
swapchain image to a surface with different dimensions than the
image. Using this feature may allow implementations to avoid
returning
ERROR_OUT_OF_DATE_KHRin this situation. - Allow applications to defer swapchain memory allocation for improved startup time and memory footprint.
- Allow applications to release previously acquired images without presenting them.
New Commands
New Structures
Extending
PhysicalDeviceFeatures2,DeviceCreateInfo:Extending
PresentInfoKHR:Extending
SwapchainCreateInfoKHR:
New Enum Constants
KHR_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSIONExtending
StructureType:STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_KHRSTRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_KHRSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_KHRSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_KHRSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_KHRSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_KHR
Extending
SwapchainCreateFlagBitsKHR:
Version History
Revision 1, 2025-03-31 (Shahbaz Youssefi)
- Based on VK_EXT_swapchain_maintenance1
See Also
No cross-references are available
Document Notes
For more information, see the Vulkan Specification.
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- releaseSwapchainImagesKHR :: MonadIO io => Device -> ("releaseInfo" ::: ReleaseSwapchainImagesInfoKHR) -> io ()
- data PhysicalDeviceSwapchainMaintenance1FeaturesKHR = PhysicalDeviceSwapchainMaintenance1FeaturesKHR {}
- data SwapchainPresentFenceInfoKHR = SwapchainPresentFenceInfoKHR {}
- data SwapchainPresentModesCreateInfoKHR = SwapchainPresentModesCreateInfoKHR {}
- data SwapchainPresentModeInfoKHR = SwapchainPresentModeInfoKHR {}
- data SwapchainPresentScalingCreateInfoKHR = SwapchainPresentScalingCreateInfoKHR {}
- data ReleaseSwapchainImagesInfoKHR = ReleaseSwapchainImagesInfoKHR {}
- type KHR_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION = 1
- pattern KHR_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION :: Integral a => a
- type KHR_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME = "VK_KHR_swapchain_maintenance1"
- pattern KHR_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME :: (Eq a, IsString a) => a
- newtype SwapchainKHR = SwapchainKHR Word64
- newtype PresentModeKHR where
- PresentModeKHR Int32
- pattern PRESENT_MODE_FIFO_KHR :: PresentModeKHR
- pattern PRESENT_MODE_FIFO_LATEST_READY_KHR :: PresentModeKHR
- pattern PRESENT_MODE_FIFO_RELAXED_KHR :: PresentModeKHR
- pattern PRESENT_MODE_IMMEDIATE_KHR :: PresentModeKHR
- pattern PRESENT_MODE_MAILBOX_KHR :: PresentModeKHR
- pattern PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: PresentModeKHR
- pattern PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: PresentModeKHR
- newtype SwapchainCreateFlagBitsKHR where
- SwapchainCreateFlagBitsKHR Flags
- pattern SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_PROTECTED_BIT_KHR :: SwapchainCreateFlagBitsKHR
- pattern SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR :: SwapchainCreateFlagBitsKHR
- type SwapchainCreateFlagsKHR = SwapchainCreateFlagBitsKHR
- newtype PresentScalingFlagBitsKHR where
- type PresentScalingFlagsKHR = PresentScalingFlagBitsKHR
- newtype PresentGravityFlagBitsKHR where
- type PresentGravityFlagsKHR = PresentGravityFlagBitsKHR
Documentation
releaseSwapchainImagesKHR Source #
Arguments
| :: MonadIO io | |
| => Device |
|
| -> ("releaseInfo" ::: ReleaseSwapchainImagesInfoKHR) |
|
| -> io () |
vkReleaseSwapchainImagesKHR - Release previously acquired but unused images
Description
Only images that are not in use by the device can be released.
Releasing images is a read-only operation that will not affect the content of the released images. Upon reacquiring the image, the image contents and its layout will be the same as they were prior to releasing it. However, if a mechanism other than Vulkan is used to modify the platform window associated with the swapchain, the content of all presentable images in the swapchain becomes undefined.
This functionality is useful during swapchain recreation, where acquired images from the old swapchain can be released instead of presented.
Valid Usage
- Feature swapchainMaintenance1 must be enabled
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pReleaseInfomust be a valid pointer to a validReleaseSwapchainImagesInfoKHRstructure
Return Codes
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
Device, ReleaseSwapchainImagesInfoKHR
data PhysicalDeviceSwapchainMaintenance1FeaturesKHR Source #
VkPhysicalDeviceSwapchainMaintenance1FeaturesKHR - Structure describing whether implementation supports swapchain maintenance1 functionality
Members
This structure describes the following feature:
Description
If the PhysicalDeviceSwapchainMaintenance1FeaturesKHR structure is
included in the pNext chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2,
it is filled in to indicate whether each corresponding feature is
supported. If the application wishes to use a
Device with any features described by
PhysicalDeviceSwapchainMaintenance1FeaturesKHR, it must add an
instance of the structure, with the desired feature members set to
TRUE, to the pNext chain of
DeviceCreateInfo when creating the
Device.
Valid Usage (Implicit)
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
Bool32,
StructureType
Constructors
| PhysicalDeviceSwapchainMaintenance1FeaturesKHR | |
Fields
| |
Instances
data SwapchainPresentFenceInfoKHR Source #
VkSwapchainPresentFenceInfoKHR - Fences associated with a vkQueuePresentKHR operation
Description
The set of queue operations defined by queuing an image for presentation, as well as operations performed by the presentation engine, access the payloads of objects associated with the presentation operation. The associated objects include:
- The swapchain image, its implicitly bound memory, and any other resources bound to that memory.
- The wait semaphores specified when queuing the image for presentation.
The application can provide a fence that the implementation will
signal after all such queue operations have completed, and after the
presentation engine has taken a reference to the payloads of all objects
provided in PresentInfoKHR that the
presentation engine accesses as part of the present operation. The fence
may not wait for the present operation to complete. For all binary
wait semaphores imported by the presentation engine using the equivalent
of reference transference, as described in
Importing Semaphore Payloads,
this fence must not signal until all such semaphore payloads have been
reset by the presentation engine.
The application can destroy the wait semaphores associated with a given presentation operation when at least one of the associated fences is signaled, and can destroy the swapchain when the fences associated with all past presentation requests referring to that swapchain have signaled.
Fences associated with presentations to the same swapchain on the same
Queue must be signaled in the same order as
the present operations.
To specify a fence for each swapchain in a present operation, include
the SwapchainPresentFenceInfoKHR structure in the pNext chain of the
PresentInfoKHR structure.
Valid Usage
-
swapchainCountmust be equal toPresentInfoKHR::swapchainCount
- Each element of
pFencesthat is notNULL_HANDLEmust be unsignaled - Each element of
pFencesthat is notNULL_HANDLEmust not be associated with any other queue command that has not yet completed execution on that queue
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_KHR
-
pFencesmust be a valid pointer to an array ofswapchainCountvalid orNULL_HANDLEFencehandles -
swapchainCountmust be greater than0
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
Fence,
StructureType
Constructors
| SwapchainPresentFenceInfoKHR | |
Fields
| |
Instances
| Show SwapchainPresentFenceInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods showsPrec :: Int -> SwapchainPresentFenceInfoKHR -> ShowS # show :: SwapchainPresentFenceInfoKHR -> String # showList :: [SwapchainPresentFenceInfoKHR] -> ShowS # | |
| FromCStruct SwapchainPresentFenceInfoKHR Source # | |
| ToCStruct SwapchainPresentFenceInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods withCStruct :: SwapchainPresentFenceInfoKHR -> (Ptr SwapchainPresentFenceInfoKHR -> IO b) -> IO b Source # pokeCStruct :: Ptr SwapchainPresentFenceInfoKHR -> SwapchainPresentFenceInfoKHR -> IO b -> IO b Source # withZeroCStruct :: (Ptr SwapchainPresentFenceInfoKHR -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr SwapchainPresentFenceInfoKHR -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero SwapchainPresentFenceInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods | |
data SwapchainPresentModesCreateInfoKHR Source #
VkSwapchainPresentModesCreateInfoKHR - All presentation modes usable by the swapchain
Valid Usage
- Each entry in
pPresentModes must be one of the
PresentModeKHRvalues returned bygetPhysicalDeviceSurfacePresentModesKHRfor the surface
-
If the
presentModeFifoLatestReady
feature is not enabled, pPresentModes must not contain
PRESENT_MODE_FIFO_LATEST_READY_KHR - The
entries in pPresentModes must be a subset of the present modes
returned in
SurfacePresentModeCompatibilityKHR::pPresentModes, givenSwapchainCreateInfoKHR::presentModeinSurfacePresentModeKHR -
SwapchainCreateInfoKHR::presentModemust be included inpPresentModes
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_KHR
-
pPresentModesmust be a valid pointer to an array ofpresentModeCountvalidPresentModeKHRvalues -
presentModeCountmust be greater than0
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
PresentModeKHR,
StructureType
Constructors
| SwapchainPresentModesCreateInfoKHR | |
Fields
| |
Instances
| Show SwapchainPresentModesCreateInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods showsPrec :: Int -> SwapchainPresentModesCreateInfoKHR -> ShowS # | |
| FromCStruct SwapchainPresentModesCreateInfoKHR Source # | |
| ToCStruct SwapchainPresentModesCreateInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods withCStruct :: SwapchainPresentModesCreateInfoKHR -> (Ptr SwapchainPresentModesCreateInfoKHR -> IO b) -> IO b Source # pokeCStruct :: Ptr SwapchainPresentModesCreateInfoKHR -> SwapchainPresentModesCreateInfoKHR -> IO b -> IO b Source # withZeroCStruct :: (Ptr SwapchainPresentModesCreateInfoKHR -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr SwapchainPresentModesCreateInfoKHR -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero SwapchainPresentModesCreateInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods | |
data SwapchainPresentModeInfoKHR Source #
VkSwapchainPresentModeInfoKHR - Presentation modes for a vkQueuePresentKHR operation
Description
If the pNext chain of
PresentInfoKHR includes a
SwapchainPresentModeInfoKHR structure, then that structure defines the
presentation modes used for the current and subsequent presentation
operations.
When the application changes present modes with
SwapchainPresentModeInfoKHR, images that have already been queued for
presentation will continue to be presented according to the previous
present mode. The current image being queued for presentation and
subsequent images will be presented according to the new present mode.
The behavior during the transition between the two modes is defined as
follows.
- Transition from
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHRtoPRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: the presentation engine updates the shared presentable image according to the behavior ofPRESENT_MODE_SHARED_DEMAND_REFRESH_KHR. - Transition from
PRESENT_MODE_SHARED_DEMAND_REFRESH_KHRtoPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: the presentation engine may update the shared presentable image or defer that to its regular refresh cycle, according to the behavior ofPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR. - Transition between
PRESENT_MODE_FIFO_KHRandPRESENT_MODE_FIFO_RELAXED_KHR: Images continue to be appended to the same FIFO queue, and the behavior with respect to waiting for vertical blanking period will follow the new mode for current and subsequent images. - Transition from
PRESENT_MODE_IMMEDIATE_KHRtoPRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHRorPRESENT_MODE_FIFO_LATEST_READY_KHR: As all prior present requests in thePRESENT_MODE_IMMEDIATE_KHRmode are applied immediately, there are no outstanding present operations in this mode, and current and subsequent images are appended to the FIFO queue and presented according to the new mode. - Transition from
PRESENT_MODE_MAILBOX_KHRtoPRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHRorPRESENT_MODE_FIFO_LATEST_READY_KHR: Presentation in FIFO modes require waiting for the next vertical blanking period, withPRESENT_MODE_MAILBOX_KHRallowing the pending present operation to be replaced by a new one. In this case, the current present operation will replace the pending present operation and is applied according to the new mode. - Transition from
PRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHRorPRESENT_MODE_FIFO_LATEST_READY_KHRtoPRESENT_MODE_IMMEDIATE_KHRorPRESENT_MODE_MAILBOX_KHR: If the FIFO queue is empty, presentation is done according to the behavior of the new mode. If there are present operations in the FIFO queue, once the last present operation is performed based on the respective vertical blanking period, the current and subsequent updates are applied according to the new mode. - Transition between
PRESENT_MODE_FIFO_KHRorPRESENT_MODE_FIFO_RELAXED_KHR, andPRESENT_MODE_FIFO_LATEST_READY_KHR: Images continue to be appended to the same FIFO queue, and the behavior with respect to waiting for vertical blanking period and dequeuing requests will follow the new mode for current and subsequent images. - The behavior during transition between any other present modes, if possible, is implementation defined.
Valid Usage
-
swapchainCountmust be equal toPresentInfoKHR::swapchainCount
- Each entry
in
pPresentModesmust be a presentation mode specified inSwapchainPresentModesCreateInfoKHR::pPresentModeswhen creating the entry’s corresponding swapchain
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_KHR
-
pPresentModesmust be a valid pointer to an array ofswapchainCountvalidPresentModeKHRvalues -
swapchainCountmust be greater than0
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
PresentModeKHR,
StructureType
Constructors
| SwapchainPresentModeInfoKHR | |
Fields
| |
Instances
| Show SwapchainPresentModeInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods showsPrec :: Int -> SwapchainPresentModeInfoKHR -> ShowS # show :: SwapchainPresentModeInfoKHR -> String # showList :: [SwapchainPresentModeInfoKHR] -> ShowS # | |
| FromCStruct SwapchainPresentModeInfoKHR Source # | |
| ToCStruct SwapchainPresentModeInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods withCStruct :: SwapchainPresentModeInfoKHR -> (Ptr SwapchainPresentModeInfoKHR -> IO b) -> IO b Source # pokeCStruct :: Ptr SwapchainPresentModeInfoKHR -> SwapchainPresentModeInfoKHR -> IO b -> IO b Source # withZeroCStruct :: (Ptr SwapchainPresentModeInfoKHR -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr SwapchainPresentModeInfoKHR -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero SwapchainPresentModeInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods | |
data SwapchainPresentScalingCreateInfoKHR Source #
VkSwapchainPresentScalingCreateInfoKHR - Scaling behavior when presenting to the surface
Description
If scalingBehavior is 0, the result of presenting a swapchain image
with dimensions that do not match the surface dimensions is
implementation and platform-dependent. If presentGravityX or
presentGravityY are 0, the presentation gravity must match that
defined by the native platform surface on platforms which define surface
gravity.
Valid Usage
-
If
presentGravityXis not0,presentGravityYmust not be0 -
scalingBehaviormust not have more than one bit set -
presentGravityXmust not have more than one bit set -
presentGravityYmust not have more than one bit set -
scalingBehaviormust be0or a valid scaling method for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentScaling, givenSwapchainCreateInfoKHR::presentModeinSurfacePresentModeKHR -
If the swapchain is created with
SwapchainPresentModesCreateInfoKHR,scalingBehaviormust be0or a valid scaling method for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentScaling, given each present mode inSwapchainPresentModesCreateInfoKHR::pPresentModesinSurfacePresentModeKHR -
presentGravityXmust be0or a valid x-axis present gravity for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentGravityX, givenSwapchainCreateInfoKHR::presentModeinSurfacePresentModeKHR -
If the swapchain is created with
SwapchainPresentModesCreateInfoKHR,presentGravityXmust be0or a valid x-axis present gravity for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentGravityX, given each present mode inSwapchainPresentModesCreateInfoKHR::pPresentModesinSurfacePresentModeKHR -
presentGravityYmust be0or a valid y-axis present gravity for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentGravityY, givenSwapchainCreateInfoKHR::presentModeinSurfacePresentModeKHR -
If the swapchain is created with
SwapchainPresentModesCreateInfoKHR,presentGravityYmust be0or a valid y-axis present gravity for the surface as returned inSurfacePresentScalingCapabilitiesKHR::supportedPresentGravityY, given each present mode inSwapchainPresentModesCreateInfoKHR::pPresentModesinSurfacePresentModeKHR -
If the
swapchainMaintenance1
feature is not enabled, then
scalingBehavior,presentGravityX, andpresentGravityYmust be0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_KHR
-
scalingBehaviormust be a valid combination ofPresentScalingFlagBitsKHRvalues -
presentGravityXmust be a valid combination ofPresentGravityFlagBitsKHRvalues -
presentGravityYmust be a valid combination ofPresentGravityFlagBitsKHRvalues
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
PresentGravityFlagsKHR,
PresentScalingFlagsKHR,
StructureType
Constructors
| SwapchainPresentScalingCreateInfoKHR | |
Fields
| |
Instances
data ReleaseSwapchainImagesInfoKHR Source #
VkReleaseSwapchainImagesInfoKHR - Structure describing a list of swapchain image indices to be released
Valid Usage
- Each
element of
pImageIndicesmust be the index of a presentable image acquired from the swapchain specified byswapchain
- All uses
of presentable images identified by elements of
pImageIndicesmust have completed execution
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_KHR
-
pNextmust beNULL -
swapchainmust be a validSwapchainKHRhandle -
pImageIndicesmust be a valid pointer to an array ofimageIndexCountuint32_tvalues -
imageIndexCountmust be greater than0
Host Synchronization
- Host access to
swapchainmust be externally synchronized
See Also
VK_EXT_swapchain_maintenance1,
VK_KHR_swapchain_maintenance1,
StructureType,
SwapchainKHR, releaseSwapchainImagesKHR,
releaseSwapchainImagesKHR
Constructors
| ReleaseSwapchainImagesInfoKHR | |
Fields
| |
Instances
| Show ReleaseSwapchainImagesInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods showsPrec :: Int -> ReleaseSwapchainImagesInfoKHR -> ShowS # show :: ReleaseSwapchainImagesInfoKHR -> String # showList :: [ReleaseSwapchainImagesInfoKHR] -> ShowS # | |
| FromCStruct ReleaseSwapchainImagesInfoKHR Source # | |
| ToCStruct ReleaseSwapchainImagesInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods withCStruct :: ReleaseSwapchainImagesInfoKHR -> (Ptr ReleaseSwapchainImagesInfoKHR -> IO b) -> IO b Source # pokeCStruct :: Ptr ReleaseSwapchainImagesInfoKHR -> ReleaseSwapchainImagesInfoKHR -> IO b -> IO b Source # withZeroCStruct :: (Ptr ReleaseSwapchainImagesInfoKHR -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr ReleaseSwapchainImagesInfoKHR -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero ReleaseSwapchainImagesInfoKHR Source # | |
Defined in Vulkan.Extensions.VK_KHR_swapchain_maintenance1 Methods | |
pattern KHR_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION :: Integral a => a Source #
type KHR_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME = "VK_KHR_swapchain_maintenance1" Source #
pattern KHR_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME :: (Eq a, IsString a) => a Source #
newtype SwapchainKHR Source #
VkSwapchainKHR - Opaque handle to a swapchain object
Description
A swapchain is an abstraction for an array of presentable images that
are associated with a surface. The presentable images are represented by
Image objects created by the platform. One image
(which can be an array image for multiview/stereoscopic-3D surfaces)
is displayed at a time, but multiple images can be queued for
presentation. An application renders to the image, and then queues the
image for presentation to the surface.
A native window cannot be associated with more than one non-retired swapchain at a time. Further, swapchains cannot be created for native windows that have a non-Vulkan graphics API surface associated with them.
The presentation engine is an abstraction for the platform’s compositor or display engine.
The presentation engine may be synchronous or asynchronous with respect to the application and/or logical device.
Some implementations may use the device’s graphics queue or dedicated presentation hardware to perform presentation.
The presentable images of a swapchain are owned by the presentation
engine. An application can acquire use of a presentable image from the
presentation engine. Use of a presentable image must occur only after
the image is returned by
acquireNextImageKHR, and before it
is released by queuePresentKHR.
This includes transitioning the image layout and rendering commands.
An application can acquire use of a presentable image with
acquireNextImageKHR. After
acquiring a presentable image and before modifying it, the application
must use a synchronization primitive to ensure that the presentation
engine has finished reading from the image. The application can then
transition the image’s layout, queue rendering commands to it, etc.
Finally, the application presents the image with
queuePresentKHR, which releases the
acquisition of the image. The application can also release the
acquisition of the image through
releaseSwapchainImagesKHR,
if the image is not in use by the device, and skip the present
operation.
The presentation engine controls the order in which presentable images are acquired for use by the application.
This allows the platform to handle situations which require out-of-order return of images after presentation. At the same time, it allows the application to generate command buffers referencing all of the images in the swapchain at initialization time, rather than in its main loop.
See Also
VK_DEFINE_NON_DISPATCHABLE_HANDLE,
VK_KHR_swapchain,
AcquireNextImageInfoKHR,
BindImageMemorySwapchainInfoKHR,
ImageSwapchainCreateInfoKHR,
PastPresentationTimingInfoEXT,
PresentInfoKHR,
ReleaseSwapchainImagesInfoKHR,
SwapchainCalibratedTimestampInfoEXT,
SwapchainCreateInfoKHR,
acquireFullScreenExclusiveModeEXT,
acquireNextImageKHR,
createSharedSwapchainsKHR,
createSwapchainKHR,
destroySwapchainKHR,
getLatencyTimingsNV,
getPastPresentationTimingGOOGLE,
getRefreshCycleDurationGOOGLE,
getSwapchainCounterEXT,
getSwapchainImagesKHR,
getSwapchainStatusKHR,
getSwapchainTimeDomainPropertiesEXT,
getSwapchainTimingPropertiesEXT,
latencySleepNV,
queuePresentKHR,
releaseFullScreenExclusiveModeEXT,
setHdrMetadataEXT,
setLatencyMarkerNV,
setLatencySleepModeNV,
setLocalDimmingAMD,
setSwapchainPresentTimingQueueSizeEXT,
waitForPresent2KHR,
waitForPresentKHR
Constructors
| SwapchainKHR Word64 |
Instances
newtype PresentModeKHR Source #
VkPresentModeKHR - Presentation mode supported for a surface
Description
PRESENT_MODE_IMMEDIATE_KHRspecifies that the presentation engine does not wait for a vertical blanking period to update the current image, meaning this mode may result in visible tearing. No internal queuing of presentation requests is needed, as the requests are applied immediately.
PRESENT_MODE_MAILBOX_KHRspecifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal single-entry queue is used to hold pending presentation requests. If the queue is full when a new presentation request is received, the new request replaces the existing entry, and any images associated with the prior entry become available for reuse by the application. One request is removed from the queue and processed during each vertical blanking period in which the queue is non-empty.PRESENT_MODE_FIFO_KHRspecifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during each vertical blanking period in which the queue is non-empty. This is the only value ofpresentModethat is required to be supported.PRESENT_MODE_FIFO_RELAXED_KHRspecifies that the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case. This mode is useful for reducing visual stutter with an application that will mostly present a new image before the next vertical blanking period, but may occasionally be late, and present a new image just after the next vertical blanking period. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during or after each vertical blanking period in which the queue is non-empty.PRESENT_MODE_FIFO_LATEST_READY_KHRspecifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue. At each vertical blanking period, the presentation engine dequeues all successive requests that are ready to be presented from the beginning of the queue. If using theVK_GOOGLE_display_timingextension or the presentAtAbsoluteTime feature to provide a target present time, the presentation engine checks the specified time for each image. If the target present time is less-than or equal-to the current time, the presentation engine dequeues the image and checks the next one. The image of the last dequeued request is presented. The other dequeued requests are dropped.PRESENT_MODE_SHARED_DEMAND_REFRESH_KHRspecifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine is only required to update the current image after a new presentation request is received. Therefore the application must make a presentation request whenever an update is required. However, the presentation engine may update the current image at any point, meaning this mode may result in visible tearing.PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHRspecifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine periodically updates the current image on its regular refresh cycle. The application is only required to make one initial presentation request, after which the presentation engine must update the current image without any need for further presentation requests. The application can indicate the image contents have been updated by making a presentation request, but this does not guarantee the timing of when it will be updated. This mode may result in visible tearing if rendering to the image is not timed correctly.
The supported
ImageUsageFlagBits of the
presentable images of a swapchain created for a surface may differ
depending on the presentation mode, and can be determined as per the
table below:
| Presentation mode | Image usage flags |
|---|---|
PRESENT_MODE_IMMEDIATE_KHR | SurfaceCapabilitiesKHR::supportedUsageFlags |
PRESENT_MODE_MAILBOX_KHR | SurfaceCapabilitiesKHR::supportedUsageFlags |
PRESENT_MODE_FIFO_KHR | SurfaceCapabilitiesKHR::supportedUsageFlags |
PRESENT_MODE_FIFO_RELAXED_KHR | SurfaceCapabilitiesKHR::supportedUsageFlags |
PRESENT_MODE_FIFO_LATEST_READY_KHR | SurfaceCapabilitiesKHR::supportedUsageFlags |
PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR | SharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlags |
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR | SharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlags |
Presentable Image Usage Queries
For reference, the mode indicated by PRESENT_MODE_FIFO_KHR is
equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap
interval of 1, while the mode indicated by
PRESENT_MODE_FIFO_RELAXED_KHR is equivalent to the behavior of
{wgl|glX}SwapBuffers with a swap interval of -1 (from the
{WGL|GLX}_EXT_swap_control_tear extensions).
See Also
VK_KHR_surface,
LatencySurfaceCapabilitiesNV,
SurfacePresentModeCompatibilityKHR,
SurfacePresentModeKHR,
SwapchainCreateInfoKHR,
SwapchainPresentModeInfoKHR,
SwapchainPresentModesCreateInfoKHR,
getPhysicalDeviceSurfacePresentModes2EXT,
getPhysicalDeviceSurfacePresentModesKHR
Constructors
| PresentModeKHR Int32 |
Bundled Patterns
| pattern PRESENT_MODE_FIFO_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_FIFO_LATEST_READY_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_FIFO_RELAXED_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_IMMEDIATE_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_MAILBOX_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: PresentModeKHR | |
| pattern PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: PresentModeKHR |
Instances
newtype SwapchainCreateFlagBitsKHR Source #
VkSwapchainCreateFlagBitsKHR - Bitmask controlling swapchain creation
Description
SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHRspecifies that images created from the swapchain (i.e. with theswapchainmember ofImageSwapchainCreateInfoKHRset to this swapchain’s handle) must useIMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT.
SWAPCHAIN_CREATE_PROTECTED_BIT_KHRspecifies that images created from the swapchain are protected images.SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHRspecifies that the images of the swapchain can be used to create aImageViewwith a different format than what the swapchain was created with. The list of allowed image view formats is specified by adding aImageFormatListCreateInfostructure to thepNextchain ofSwapchainCreateInfoKHR. In addition, this flag also specifies that the swapchain can be created with usage flags that are not supported for the format the swapchain is created with but are supported for at least one of the allowed image view formats.SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_KHRspecifies that the implementation may defer allocation of memory associated with each swapchain image until its index is to be returned fromacquireNextImageKHRoracquireNextImage2KHRfor the first time.SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHRspecifies that applications can include thePresentId2KHRstructure in thepNextchain of thePresentInfoKHRstructure to associate an identifier with each presentation request.SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHRspecifies that applications can usewaitForPresent2KHRto wait for the presentation engine to have begun presentation of the presentation request associated withPresentWait2InfoKHR::presentIdonswapchain.SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXTspecifies that features supported by the swapchain device inPhysicalDevicePresentTimingFeaturesEXTcan be used to collect timing information or schedule presentation requests at specific times.
See Also
Constructors
| SwapchainCreateFlagBitsKHR Flags |
Bundled Patterns
Instances
newtype PresentScalingFlagBitsKHR Source #
VkPresentScalingFlagBitsKHR - Bitmask specifying presentation scaling methods
Description
PRESENT_SCALING_ONE_TO_ONE_BIT_KHRspecifies that no scaling occurs, and pixels in the swapchain image are mapped to one and only one pixel in the surface. The mapping between pixels is defined by the chosen presentation gravity.
PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_KHRspecifies that the swapchain image will be minified or magnified such that at least one of the resulting width or height is equal to the corresponding surface dimension, and the other resulting dimension is less than or equal to the corresponding surface dimension, with the aspect ratio of the resulting image being identical to that of the original swapchain image.PRESENT_SCALING_STRETCH_BIT_KHRspecifies that the swapchain image will be minified or magnified such that the resulting image dimensions are equal to those of the surface.
See Also
VK_EXT_surface_maintenance1,
VK_KHR_surface_maintenance1,
PresentScalingFlagsKHR
Constructors
| PresentScalingFlagBitsKHR Flags |
Bundled Patterns
Instances
newtype PresentGravityFlagBitsKHR Source #
VkPresentGravityFlagBitsKHR - Bitmask specifying presentation pixel gravity on either the x or y axis
Description
PRESENT_GRAVITY_MIN_BIT_KHRmeans that the pixels will gravitate towards the top or left side of the surface.
PRESENT_GRAVITY_MAX_BIT_KHRmeans that the pixels will gravitate towards the bottom or right side of the surface.PRESENT_GRAVITY_CENTERED_BIT_KHRmeans that the pixels will be centered in the surface.
If the value in
SurfaceCapabilitiesKHR::currentTransform
is not
SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
it is implementation-defined whether the gravity configuration applies
to the presented image before or after transformation.
See Also
VK_EXT_surface_maintenance1,
VK_KHR_surface_maintenance1,
PresentGravityFlagsKHR
Constructors
| PresentGravityFlagBitsKHR Flags |
Bundled Patterns
| pattern PRESENT_GRAVITY_CENTERED_BIT_KHR :: PresentGravityFlagBitsKHR | |
| pattern PRESENT_GRAVITY_MAX_BIT_KHR :: PresentGravityFlagBitsKHR | |
| pattern PRESENT_GRAVITY_MIN_BIT_KHR :: PresentGravityFlagBitsKHR |