| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_KHR_swapchain
Synopsis
- createSwapchainKHR :: forall a io. (Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) => Device -> SwapchainCreateInfoKHR a -> ("allocator" ::: Maybe AllocationCallbacks) -> io SwapchainKHR
- withSwapchainKHR :: forall a io r. (Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) => Device -> SwapchainCreateInfoKHR a -> Maybe AllocationCallbacks -> (io SwapchainKHR -> (SwapchainKHR -> io ()) -> r) -> r
- destroySwapchainKHR :: forall io. MonadIO io => Device -> SwapchainKHR -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- getSwapchainImagesKHR :: forall io. MonadIO io => Device -> SwapchainKHR -> io (Result, "swapchainImages" ::: Vector Image)
- acquireNextImageKHR :: forall io. MonadIO io => Device -> SwapchainKHR -> ("timeout" ::: Word64) -> Semaphore -> Fence -> io (Result, "imageIndex" ::: Word32)
- acquireNextImageKHRSafe :: forall io. MonadIO io => Device -> SwapchainKHR -> ("timeout" ::: Word64) -> Semaphore -> Fence -> io (Result, "imageIndex" ::: Word32)
- queuePresentKHR :: forall a io. (Extendss PresentInfoKHR a, PokeChain a, MonadIO io) => Queue -> PresentInfoKHR a -> io Result
- getDeviceGroupPresentCapabilitiesKHR :: forall io. MonadIO io => Device -> io DeviceGroupPresentCapabilitiesKHR
- getDeviceGroupSurfacePresentModesKHR :: forall io. MonadIO io => Device -> SurfaceKHR -> io ("modes" ::: DeviceGroupPresentModeFlagsKHR)
- acquireNextImage2KHR :: forall io. MonadIO io => Device -> ("acquireInfo" ::: AcquireNextImageInfoKHR) -> io (Result, "imageIndex" ::: Word32)
- acquireNextImage2KHRSafe :: forall io. MonadIO io => Device -> ("acquireInfo" ::: AcquireNextImageInfoKHR) -> io (Result, "imageIndex" ::: Word32)
- getPhysicalDevicePresentRectanglesKHR :: forall io. MonadIO io => PhysicalDevice -> SurfaceKHR -> io (Result, "rects" ::: Vector Rect2D)
- data SwapchainCreateInfoKHR (es :: [Type]) = SwapchainCreateInfoKHR {
- next :: Chain es
- flags :: SwapchainCreateFlagsKHR
- surface :: SurfaceKHR
- minImageCount :: Word32
- imageFormat :: Format
- imageColorSpace :: ColorSpaceKHR
- imageExtent :: Extent2D
- imageArrayLayers :: Word32
- imageUsage :: ImageUsageFlags
- imageSharingMode :: SharingMode
- queueFamilyIndices :: Vector Word32
- preTransform :: SurfaceTransformFlagBitsKHR
- compositeAlpha :: CompositeAlphaFlagBitsKHR
- presentMode :: PresentModeKHR
- clipped :: Bool
- oldSwapchain :: SwapchainKHR
- data PresentInfoKHR (es :: [Type]) = PresentInfoKHR {
- next :: Chain es
- waitSemaphores :: Vector Semaphore
- swapchains :: Vector SwapchainKHR
- imageIndices :: Vector Word32
- results :: Ptr Result
- data DeviceGroupPresentCapabilitiesKHR = DeviceGroupPresentCapabilitiesKHR {}
- data ImageSwapchainCreateInfoKHR = ImageSwapchainCreateInfoKHR {}
- data BindImageMemorySwapchainInfoKHR = BindImageMemorySwapchainInfoKHR {}
- data AcquireNextImageInfoKHR = AcquireNextImageInfoKHR {
- swapchain :: SwapchainKHR
- timeout :: Word64
- semaphore :: Semaphore
- fence :: Fence
- deviceMask :: Word32
- data DeviceGroupPresentInfoKHR = DeviceGroupPresentInfoKHR {}
- data DeviceGroupSwapchainCreateInfoKHR = DeviceGroupSwapchainCreateInfoKHR {}
- newtype DeviceGroupPresentModeFlagBitsKHR where
- DeviceGroupPresentModeFlagBitsKHR Flags
- pattern DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
- pattern DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
- pattern DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
- pattern DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
- type DeviceGroupPresentModeFlagsKHR = DeviceGroupPresentModeFlagBitsKHR
- newtype SwapchainCreateFlagBitsKHR where
- type SwapchainCreateFlagsKHR = SwapchainCreateFlagBitsKHR
- type KHR_SWAPCHAIN_SPEC_VERSION = 70
- pattern KHR_SWAPCHAIN_SPEC_VERSION :: forall a. Integral a => a
- type KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain"
- pattern KHR_SWAPCHAIN_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- newtype SurfaceKHR = SurfaceKHR Word64
- newtype SwapchainKHR = SwapchainKHR Word64
- newtype PresentModeKHR where
- PresentModeKHR Int32
- pattern PRESENT_MODE_IMMEDIATE_KHR :: PresentModeKHR
- pattern PRESENT_MODE_MAILBOX_KHR :: PresentModeKHR
- pattern PRESENT_MODE_FIFO_KHR :: PresentModeKHR
- pattern PRESENT_MODE_FIFO_RELAXED_KHR :: PresentModeKHR
- pattern PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: PresentModeKHR
- pattern PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: PresentModeKHR
- newtype ColorSpaceKHR where
- ColorSpaceKHR Int32
- pattern COLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR
- pattern COLOR_SPACE_DISPLAY_NATIVE_AMD :: ColorSpaceKHR
- pattern COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_PASS_THROUGH_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_ADOBERGB_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_HDR10_HLG_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DOLBYVISION_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_HDR10_ST2084_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT2020_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT709_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT709_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DCI_P3_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: ColorSpaceKHR
- newtype CompositeAlphaFlagBitsKHR where
- CompositeAlphaFlagBitsKHR Flags
- pattern COMPOSITE_ALPHA_OPAQUE_BIT_KHR :: CompositeAlphaFlagBitsKHR
- pattern COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagBitsKHR
- pattern COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagBitsKHR
- pattern COMPOSITE_ALPHA_INHERIT_BIT_KHR :: CompositeAlphaFlagBitsKHR
- type CompositeAlphaFlagsKHR = CompositeAlphaFlagBitsKHR
- newtype SurfaceTransformFlagBitsKHR where
- SurfaceTransformFlagBitsKHR Flags
- pattern SURFACE_TRANSFORM_IDENTITY_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_ROTATE_90_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_ROTATE_180_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_ROTATE_270_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR :: SurfaceTransformFlagBitsKHR
- pattern SURFACE_TRANSFORM_INHERIT_BIT_KHR :: SurfaceTransformFlagBitsKHR
- type SurfaceTransformFlagsKHR = SurfaceTransformFlagBitsKHR
Documentation
Arguments
| :: forall a io. (Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> SwapchainCreateInfoKHR a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io SwapchainKHR |
vkCreateSwapchainKHR - Create a swapchain
Description
If the oldSwapchain parameter of pCreateInfo is a valid swapchain,
which has exclusive full-screen access, that access is released from
oldSwapchain. If the command succeeds in this case, the newly created
swapchain will automatically acquire exclusive full-screen access from
oldSwapchain.
Note
This implicit transfer is intended to avoid exiting and entering full-screen exclusive mode, which may otherwise cause unwanted visual updates to the display.
In some cases, swapchain creation may fail if exclusive full-screen
mode is requested for application control, but for some
implementation-specific reason exclusive full-screen access is
unavailable for the particular combination of parameters provided. If
this occurs, ERROR_INITIALIZATION_FAILED
will be returned.
Note
In particular, it will fail if the imageExtent member of pCreateInfo
does not match the extents of the monitor. Other reasons for failure may
include the app not being set as high-dpi aware, or if the physical
device and monitor are not compatible in this mode.
Valid Usage (Implicit)
devicemust be a validDevicehandle
pCreateInfomust be a valid pointer to a validSwapchainCreateInfoKHRstructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure pSwapchainmust be a valid pointer to aSwapchainKHRhandle
Host Synchronization
- Host access to
pCreateInfo->surfacemust be externally synchronized
- Host access to
pCreateInfo->oldSwapchainmust be externally synchronized
Return Codes
See Also
AllocationCallbacks,
Device, SwapchainCreateInfoKHR,
SwapchainKHR
withSwapchainKHR :: forall a io r. (Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) => Device -> SwapchainCreateInfoKHR a -> Maybe AllocationCallbacks -> (io SwapchainKHR -> (SwapchainKHR -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createSwapchainKHR and destroySwapchainKHR
To ensure that destroySwapchainKHR is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the first argument.
To just extract the pair pass (,) as the first argument.
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io () |
vkDestroySwapchainKHR - Destroy a swapchain object
Description
The application must not destroy a swapchain until after completion of
all outstanding operations on images that were acquired from the
swapchain. swapchain and all associated Image
handles are destroyed, and must not be acquired or used any more by
the application. The memory of each Image will
only be freed after that image is no longer used by the presentation
engine. For example, if one image of the swapchain is being displayed in
a window, the memory for that image may not be freed until the window
is destroyed, or another swapchain is created for the window. Destroying
the swapchain does not invalidate the parent
SurfaceKHR, and a new swapchain can be
created with it.
When a swapchain associated with a display surface is destroyed, if the image most recently presented to the display surface is from the swapchain being destroyed, then either any display resources modified by presenting images from any swapchain associated with the display surface must be reverted by the implementation to their state prior to the first present performed on one of these swapchains, or such resources must be left in their current state.
If swapchain has exclusive full-screen access, it is released before
the swapchain is destroyed.
Valid Usage
- All uses of presentable images acquired from
swapchainmust have completed execution
- If
AllocationCallbackswere provided whenswapchainwas created, a compatible set of callbacks must be provided here - If no
AllocationCallbackswere provided whenswapchainwas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validDevicehandle
- If
swapchainis notNULL_HANDLE,swapchainmust be a validSwapchainKHRhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - Both of
device, andswapchainthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameInstance
Host Synchronization
- Host access to
swapchainmust be externally synchronized
See Also
getSwapchainImagesKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> io (Result, "swapchainImages" ::: Vector Image) |
vkGetSwapchainImagesKHR - Obtain the array of presentable images associated with a swapchain
Description
If pSwapchainImages is NULL, then the number of presentable images
for swapchain is returned in pSwapchainImageCount. Otherwise,
pSwapchainImageCount must point to a variable set by the user to the
number of elements in the pSwapchainImages array, and on return the
variable is overwritten with the number of structures actually written
to pSwapchainImages. If the value of pSwapchainImageCount is less
than the number of presentable images for swapchain, at most
pSwapchainImageCount structures will be written. If
pSwapchainImageCount is smaller than the number of presentable images
for swapchain, INCOMPLETE will be
returned instead of SUCCESS to indicate
that not all the available values were returned.
Valid Usage (Implicit)
devicemust be a validDevicehandle
swapchainmust be a validSwapchainKHRhandlepSwapchainImageCountmust be a valid pointer to auint32_tvalue- If the value referenced by
pSwapchainImageCountis not0, andpSwapchainImagesis notNULL,pSwapchainImagesmust be a valid pointer to an array ofpSwapchainImageCountImagehandles - Both of
device, andswapchainmust have been created, allocated, or retrieved from the sameInstance
Return Codes
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> ("timeout" ::: Word64) |
|
| -> Semaphore |
|
| -> Fence |
|
| -> io (Result, "imageIndex" ::: Word32) |
vkAcquireNextImageKHR - Retrieve the index of the next available presentable image
Valid Usage
swapchainmust not be in the retired state
- If
semaphoreis notNULL_HANDLEit must be unsignaled - If
semaphoreis notNULL_HANDLEit must not have any uncompleted signal or wait operations pending - If
fenceis notNULL_HANDLEit must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue semaphoreandfencemust not both be equal toNULL_HANDLE- If the number of currently acquired images is greater than the
difference between the number of images in
swapchainand the value ofSurfaceCapabilitiesKHR::minImageCountas returned by a call togetPhysicalDeviceSurfaceCapabilities2KHRwith thesurfaceused to createswapchain,timeoutmust not beUINT64_MAX semaphoremust have aSemaphoreTypeofSEMAPHORE_TYPE_BINARY
Valid Usage (Implicit)
devicemust be a validDevicehandle
swapchainmust be a validSwapchainKHRhandle- If
semaphoreis notNULL_HANDLE,semaphoremust be a validSemaphorehandle - If
fenceis notNULL_HANDLE,fencemust be a validFencehandle pImageIndexmust be a valid pointer to auint32_tvalue- If
semaphoreis a valid handle, it must have been created, allocated, or retrieved fromdevice - If
fenceis a valid handle, it must have been created, allocated, or retrieved fromdevice - Both of
device, andswapchainthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameInstance
Host Synchronization
- Host access to
swapchainmust be externally synchronized
- Host access to
semaphoremust be externally synchronized - Host access to
fencemust be externally synchronized
Return Codes
See Also
acquireNextImageKHRSafe Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> SwapchainKHR |
|
| -> ("timeout" ::: Word64) |
|
| -> Semaphore |
|
| -> Fence |
|
| -> io (Result, "imageIndex" ::: Word32) |
A variant of acquireNextImageKHR which makes a *safe* FFI call
Arguments
| :: forall a io. (Extendss PresentInfoKHR a, PokeChain a, MonadIO io) | |
| => Queue |
|
| -> PresentInfoKHR a |
|
| -> io Result |
vkQueuePresentKHR - Queue an image for presentation
Description
Note
There is no requirement for an application to present images in the same order that they were acquired - applications can arbitrarily present any image that is currently acquired.
Valid Usage
- Each element of
pSwapchainsmember ofpPresentInfomust be a swapchain that is created for a surface for which presentation is supported fromqueueas determined using a call togetPhysicalDeviceSurfaceSupportKHR
- If more than one member of
pSwapchainswas created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode - When a semaphore wait operation referring to a binary semaphore
defined by the elements of the
pWaitSemaphoresmember ofpPresentInfoexecutes onqueue, there must be no other queues waiting on the same semaphore - All elements of the
pWaitSemaphoresmember ofpPresentInfomust be semaphores that are signaled, or have semaphore signal operations previously submitted for execution - All elements of the
pWaitSemaphoresmember ofpPresentInfomust be created with aSemaphoreTypeofSEMAPHORE_TYPE_BINARY - All elements of the
pWaitSemaphoresmember ofpPresentInfomust reference a semaphore signal operation that has been submitted for execution and any semaphore signal operations on which it depends (if any) must have also been submitted for execution
Any writes to memory backing the images referenced by the
pImageIndices and pSwapchains members of pPresentInfo, that are
available before queuePresentKHR is executed, are automatically made
visible to the read access performed by the presentation engine. This
automatic visibility operation for an image happens-after the semaphore
signal operation, and happens-before the presentation engine accesses
the image.
Queueing an image for presentation defines a set of queue operations, including waiting on the semaphores and submitting a presentation request to the presentation engine. However, the scope of this set of queue operations does not include the actual processing of the image by the presentation engine.
Note
The origin of the native orientation of the surface coordinate system is
not specified in the Vulkan specification; it depends on the platform.
For most platforms the origin is by default upper-left, meaning the
pixel of the presented Image at coordinates
(0,0) would appear at the upper left pixel of the platform surface
(assuming
SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
and the display standing the right way up).
If queuePresentKHR fails to enqueue the corresponding set of queue
operations, it may return
ERROR_OUT_OF_HOST_MEMORY or
ERROR_OUT_OF_DEVICE_MEMORY. If it does, the
implementation must ensure that the state and contents of any
resources or synchronization primitives referenced is unaffected by the
call or its failure.
If queuePresentKHR fails in such a way that the implementation is
unable to make that guarantee, the implementation must return
ERROR_DEVICE_LOST.
However, if the presentation request is rejected by the presentation
engine with an error ERROR_OUT_OF_DATE_KHR,
ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT,
or ERROR_SURFACE_LOST_KHR, the set of queue
operations are still considered to be enqueued and thus any semaphore
wait operation specified in PresentInfoKHR will execute when the
corresponding queue operation is complete.
If any swapchain member of pPresentInfo was created with
FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT,
ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT
will be returned if that swapchain does not have exclusive full-screen
access, possibly for implementation-specific reasons outside of the
application’s control.
Valid Usage (Implicit)
queuemust be a validQueuehandle
pPresentInfomust be a valid pointer to a validPresentInfoKHRstructure
Host Synchronization
- Host access to
queuemust be externally synchronized
- Host access to
pPresentInfo->pWaitSemaphores[] must be externally synchronized - Host access to
pPresentInfo->pSwapchains[] must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| - | - | Any | - |
Return Codes
See Also
getDeviceGroupPresentCapabilitiesKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> io DeviceGroupPresentCapabilitiesKHR |
vkGetDeviceGroupPresentCapabilitiesKHR - Query present capabilities from other physical devices
Return Codes
See Also
getDeviceGroupSurfacePresentModesKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> SurfaceKHR |
|
| -> io ("modes" ::: DeviceGroupPresentModeFlagsKHR) |
vkGetDeviceGroupSurfacePresentModesKHR - Query present capabilities for a surface
Description
The modes returned by this command are not invariant, and may change
in response to the surface being moved, resized, or occluded. These
modes must be a subset of the modes returned by
getDeviceGroupPresentCapabilitiesKHR.
Valid Usage (Implicit)
devicemust be a validDevicehandle
surfacemust be a validSurfaceKHRhandlepModesmust be a valid pointer to aDeviceGroupPresentModeFlagsKHRvalue- Both of
device, andsurfacemust have been created, allocated, or retrieved from the sameInstance
Host Synchronization
- Host access to
surfacemust be externally synchronized
Return Codes
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> ("acquireInfo" ::: AcquireNextImageInfoKHR) |
|
| -> io (Result, "imageIndex" ::: Word32) |
vkAcquireNextImage2KHR - Retrieve the index of the next available presentable image
Valid Usage
- If the number of currently acquired images is greater than the
difference between the number of images in the
swapchainmember ofpAcquireInfoand the value ofSurfaceCapabilitiesKHR::minImageCountas returned by a call togetPhysicalDeviceSurfaceCapabilities2KHRwith thesurfaceused to createswapchain, thetimeoutmember ofpAcquireInfomust not beUINT64_MAX
Valid Usage (Implicit)
devicemust be a validDevicehandle
pAcquireInfomust be a valid pointer to a validAcquireNextImageInfoKHRstructurepImageIndexmust be a valid pointer to auint32_tvalue
Return Codes
See Also
acquireNextImage2KHRSafe Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> ("acquireInfo" ::: AcquireNextImageInfoKHR) |
|
| -> io (Result, "imageIndex" ::: Word32) |
A variant of acquireNextImage2KHR which makes a *safe* FFI call
getPhysicalDevicePresentRectanglesKHR Source #
Arguments
| :: forall io. MonadIO io | |
| => PhysicalDevice |
|
| -> SurfaceKHR |
|
| -> io (Result, "rects" ::: Vector Rect2D) |
vkGetPhysicalDevicePresentRectanglesKHR - Query present rectangles for a surface on a physical device
Description
If pRects is NULL, then the number of rectangles used when
presenting the given surface is returned in pRectCount. Otherwise,
pRectCount must point to a variable set by the user to the number of
elements in the pRects array, and on return the variable is
overwritten with the number of structures actually written to pRects.
If the value of pRectCount is less than the number of rectangles, at
most pRectCount structures will be written. If pRectCount is smaller
than the number of rectangles used for the given surface,
INCOMPLETE will be returned instead of
SUCCESS to indicate that not all the
available values were returned.
The values returned by this command are not invariant, and may change in response to the surface being moved, resized, or occluded.
The rectangles returned by this command must not overlap.
Valid Usage (Implicit)
physicalDevicemust be a validPhysicalDevicehandle
surfacemust be a validSurfaceKHRhandlepRectCountmust be a valid pointer to auint32_tvalue- If the value referenced by
pRectCountis not0, andpRectsis notNULL,pRectsmust be a valid pointer to an array ofpRectCountRect2Dstructures - Both of
physicalDevice, andsurfacemust have been created, allocated, or retrieved from the sameInstance
Host Synchronization
- Host access to
surfacemust be externally synchronized
Return Codes
See Also
data SwapchainCreateInfoKHR (es :: [Type]) Source #
VkSwapchainCreateInfoKHR - Structure specifying parameters of a newly created swapchain object
Description
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.
imageArrayLayersis the number of views in a multiview/stereo surface. For non-stereoscopic-3D applications, this value is 1.imageUsageis a bitmask ofImageUsageFlagBitsdescribing the intended usage of the (acquired) swapchain images.imageSharingModeis the sharing mode used for the image(s) of the swapchain.queueFamilyIndexCountis the number of queue families having access to the image(s) of the swapchain whenimageSharingModeisSHARING_MODE_CONCURRENT.pQueueFamilyIndicesis a pointer to an array of queue family indices having access to the images(s) of the swapchain whenimageSharingModeisSHARING_MODE_CONCURRENT.preTransformis aSurfaceTransformFlagBitsKHRvalue 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 bygetPhysicalDeviceSurfaceCapabilitiesKHR, the presentation engine will transform the image content as part of the presentation operation.compositeAlphais aCompositeAlphaFlagBitsKHRvalue indicating the alpha compositing mode to use when this surface is composited together with other surfaces on certain window systems.presentModeis the presentation mode the swapchain will use. A swapchain’s present mode determines how incoming present requests will be processed and queued internally.clippedspecifies whether the Vulkan implementation is allowed to discard rendering operations that affect regions of the surface that are not visible.- If set to
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.TRUEvalue does not guarantee any clipping will occur, but allows more optimal presentation methods to be used on some platforms. - If set to
FALSE, presentable images associated with the swapchain will own all of the pixels they contain.
- If set to
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.
oldSwapchainisNULL_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 createSwapchainKHR 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 createSwapchainKHR 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
SurfaceKHR 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.
Valid Usage
surfacemust be a surface that is supported by the device as determined usinggetPhysicalDeviceSurfaceSupportKHR
minImageCountmust be less than or equal to the value returned in themaxImageCountmember of theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface if the returnedmaxImageCountis not zero- 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 theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface minImageCountmust be1ifpresentModeis eitherPRESENT_MODE_SHARED_DEMAND_REFRESH_KHRorPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHRimageFormatandimageColorSpacemust match theformatandcolorSpacemembers, respectively, of one of theSurfaceFormatKHRstructures returned bygetPhysicalDeviceSurfaceFormatsKHRfor the surfaceimageExtentmust be betweenminImageExtentandmaxImageExtent, inclusive, whereminImageExtentandmaxImageExtentare members of theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surfaceimageExtentmemberswidthandheightmust both be non-zeroimageArrayLayersmust be greater than0and less than or equal to themaxImageArrayLayersmember of theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surface- If
presentModeisPRESENT_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 theSurfaceCapabilitiesKHRstructure 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 theSharedPresentSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilities2KHRforsurface - If
imageSharingModeisSHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
imageSharingModeisSHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than1 - 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 theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surfacecompositeAlphamust be one of the bits present in thesupportedCompositeAlphamember of theSurfaceCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilitiesKHRfor the surfacepresentModemust be one of thePresentModeKHRvalues returned bygetPhysicalDeviceSurfacePresentModesKHRfor the surface- If the logical device was created with
DeviceGroupDeviceCreateInfo::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 aImageFormatListCreateInfostructure with aviewFormatCountgreater than zero andpViewFormatsmust have an element equal toimageFormat - If a
ImageFormatListCreateInfostructure was included in thepNextchain andImageFormatListCreateInfo::viewFormatCountis not zero then all of the formats inImageFormatListCreateInfo::pViewFormatsmust be compatible with theformatas described in the compatibility table - If
flagsdose not containSWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHRand thepNextchain include aImageFormatListCreateInfostructure thenImageFormatListCreateInfo::viewFormatCountmust be0or1 - If
flagscontainsSWAPCHAIN_CREATE_PROTECTED_BIT_KHR, thenSurfaceProtectedCapabilitiesKHR::supportsProtectedmust beTRUEin theSurfaceProtectedCapabilitiesKHRstructure returned bygetPhysicalDeviceSurfaceCapabilities2KHRforsurface - If the
pNextchain includes aSurfaceFullScreenExclusiveInfoEXTstructure with itsfullScreenExclusivemember set toFULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT, andsurfacewas created usingcreateWin32SurfaceKHR, aSurfaceFullScreenExclusiveWin32InfoEXTstructure must be included in thepNextchain
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 ofDeviceGroupSwapchainCreateInfoKHR,ImageFormatListCreateInfo,SurfaceFullScreenExclusiveInfoEXT,SurfaceFullScreenExclusiveWin32InfoEXT,SwapchainCounterCreateInfoEXT, orSwapchainDisplayNativeHdrCreateInfoAMD - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofSwapchainCreateFlagBitsKHRvaluessurfacemust be a validSurfaceKHRhandleimageFormatmust be a validFormatvalueimageColorSpacemust be a validColorSpaceKHRvalueimageUsagemust be a valid combination ofImageUsageFlagBitsvaluesimageUsagemust not be0imageSharingModemust be a validSharingModevaluepreTransformmust be a validSurfaceTransformFlagBitsKHRvaluecompositeAlphamust be a validCompositeAlphaFlagBitsKHRvaluepresentModemust be a validPresentModeKHRvalue- If
oldSwapchainis notNULL_HANDLE,oldSwapchainmust be a validSwapchainKHRhandle - If
oldSwapchainis a valid handle, it must have been created, allocated, or retrieved fromsurface - Both of
oldSwapchain, andsurfacethat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameInstance
See Also
Bool32,
ColorSpaceKHR,
CompositeAlphaFlagBitsKHR,
Extent2D,
Format,
ImageUsageFlags,
PresentModeKHR,
SharingMode,
StructureType,
SurfaceKHR,
SurfaceTransformFlagBitsKHR,
SwapchainCreateFlagsKHR, SwapchainKHR,
createSharedSwapchainsKHR,
createSwapchainKHR
Constructors
| SwapchainCreateInfoKHR | |
Fields
| |
Instances
data PresentInfoKHR (es :: [Type]) Source #
VkPresentInfoKHR - Structure describing parameters of a queue presentation
Description
Before an application can present an image, the image’s layout must
be transitioned to the
IMAGE_LAYOUT_PRESENT_SRC_KHR layout,
or for a shared presentable image the
IMAGE_LAYOUT_SHARED_PRESENT_KHR
layout.
Note
When transitioning the image to
IMAGE_LAYOUT_SHARED_PRESENT_KHR or
IMAGE_LAYOUT_PRESENT_SRC_KHR, there is
no need to delay subsequent processing, or perform any visibility
operations (as queuePresentKHR performs automatic visibility
operations). To achieve this, the dstAccessMask member of the
ImageMemoryBarrier should be set to 0,
and the dstStageMask parameter should be set to
PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT.
Valid Usage
- Each element of
pImageIndicesmust be the index of a presentable image acquired from the swapchain specified by the corresponding element of thepSwapchainsarray, and the presented image subresource must be in theIMAGE_LAYOUT_PRESENT_SRC_KHRorIMAGE_LAYOUT_SHARED_PRESENT_KHRlayout at the time the operation is executed on aDevice
- All elements of the
pWaitSemaphoresmust have aSemaphoreTypeofSEMAPHORE_TYPE_BINARY
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_PRESENT_INFO_KHR
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofDeviceGroupPresentInfoKHR,DisplayPresentInfoKHR,PresentFrameTokenGGP,PresentRegionsKHR, orPresentTimesInfoGOOGLE - The
sTypevalue of each struct in thepNextchain must be unique - If
waitSemaphoreCountis not0,pWaitSemaphoresmust be a valid pointer to an array ofwaitSemaphoreCountvalidSemaphorehandles pSwapchainsmust be a valid pointer to an array ofswapchainCountvalidSwapchainKHRhandlespImageIndicesmust be a valid pointer to an array ofswapchainCountuint32_tvalues- If
pResultsis notNULL,pResultsmust be a valid pointer to an array ofswapchainCountResultvalues swapchainCountmust be greater than0- Both of the elements of
pSwapchains, and the elements ofpWaitSemaphoresthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameInstance
See Also
Result, Semaphore,
StructureType,
SwapchainKHR, queuePresentKHR
Constructors
| PresentInfoKHR | |
Fields
| |
Instances
data DeviceGroupPresentCapabilitiesKHR Source #
VkDeviceGroupPresentCapabilitiesKHR - Present capabilities from other physical devices
Description
modes always has DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR set.
The present mode flags are also used when presenting an image, in
DeviceGroupPresentInfoKHR::mode.
If a device group only includes a single physical device, then modes
must equal DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR.
Valid Usage (Implicit)
See Also
DeviceGroupPresentModeFlagsKHR,
StructureType,
getDeviceGroupPresentCapabilitiesKHR
Constructors
| DeviceGroupPresentCapabilitiesKHR | |
Fields
| |
Instances
data ImageSwapchainCreateInfoKHR Source #
VkImageSwapchainCreateInfoKHR - Specify that an image will be bound to swapchain memory
Valid Usage
- If
swapchainis notNULL_HANDLE, the fields ofImageCreateInfomust match the implied image creation parameters of the swapchain
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR
- If
swapchainis notNULL_HANDLE,swapchainmust be a validSwapchainKHRhandle
See Also
Constructors
| ImageSwapchainCreateInfoKHR | |
Fields
| |
Instances
data BindImageMemorySwapchainInfoKHR Source #
VkBindImageMemorySwapchainInfoKHR - Structure specifying swapchain image memory to bind to
Description
If swapchain is not NULL, the swapchain and imageIndex are used
to determine the memory that the image is bound to, instead of memory
and memoryOffset.
Memory can be bound to a swapchain and use the pDeviceIndices or
pSplitInstanceBindRegions members of
BindImageMemoryDeviceGroupInfo.
Valid Usage
imageIndexmust be less than the number of images inswapchain
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR
swapchainmust be a validSwapchainKHRhandle
Host Synchronization
- Host access to
swapchainmust be externally synchronized
See Also
Constructors
| BindImageMemorySwapchainInfoKHR | |
Fields
| |
Instances
data AcquireNextImageInfoKHR Source #
VkAcquireNextImageInfoKHR - Structure specifying parameters of the acquire
Description
If acquireNextImageKHR is used, the device mask is considered to
include all physical devices in the logical device.
Note
acquireNextImage2KHR signals at most one semaphore, even if the
application requests waiting for multiple physical devices to be ready
via the deviceMask. However, only a single physical device can wait
on that semaphore, since the semaphore becomes unsignaled when the wait
succeeds. For other physical devices to wait for the image to be ready,
it is necessary for the application to submit semaphore signal
operation(s) to that first physical device to signal additional
semaphore(s) after the wait succeeds, which the other physical device(s)
can wait upon.
Valid Usage
swapchainmust not be in the retired state
- If
semaphoreis notNULL_HANDLEit must be unsignaled - If
semaphoreis notNULL_HANDLEit must not have any uncompleted signal or wait operations pending - If
fenceis notNULL_HANDLEit must be unsignaled and must not be associated with any other queue command that has not yet completed execution on that queue semaphoreandfencemust not both be equal toNULL_HANDLEdeviceMaskmust be a valid device maskdeviceMaskmust not be zerosemaphoremust have aSemaphoreTypeofSEMAPHORE_TYPE_BINARY
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR
pNextmust beNULLswapchainmust be a validSwapchainKHRhandle- If
semaphoreis notNULL_HANDLE,semaphoremust be a validSemaphorehandle - If
fenceis notNULL_HANDLE,fencemust be a validFencehandle - Each of
fence,semaphore, andswapchainthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameInstance
Host Synchronization
- Host access to
swapchainmust be externally synchronized
- Host access to
semaphoremust be externally synchronized - Host access to
fencemust be externally synchronized
See Also
Fence, Semaphore,
StructureType,
SwapchainKHR, acquireNextImage2KHR
Constructors
| AcquireNextImageInfoKHR | |
Fields
| |
Instances
data DeviceGroupPresentInfoKHR Source #
VkDeviceGroupPresentInfoKHR - Mode and mask controlling which physical devices' images are presented
Description
If mode is DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, then each
element of pDeviceMasks selects which instance of the swapchain image
is presented. Each element of pDeviceMasks must have exactly one bit
set, and the corresponding physical device must have a presentation
engine as reported by DeviceGroupPresentCapabilitiesKHR.
If mode is DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, then each
element of pDeviceMasks selects which instance of the swapchain image
is presented. Each element of pDeviceMasks must have exactly one bit
set, and some physical device in the logical device must include that
bit in its DeviceGroupPresentCapabilitiesKHR::presentMask.
If mode is DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, then each element
of pDeviceMasks selects which instances of the swapchain image are
component-wise summed and the sum of those images is presented. If the
sum in any component is outside the representable range, the value of
that component is undefined. Each element of pDeviceMasks must have
a value for which all set bits are set in one of the elements of
DeviceGroupPresentCapabilitiesKHR::presentMask.
If mode is DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR,
then each element of pDeviceMasks selects which instance(s) of the
swapchain images are presented. For each bit set in each element of
pDeviceMasks, the corresponding physical device must have a
presentation engine as reported by DeviceGroupPresentCapabilitiesKHR.
If DeviceGroupPresentInfoKHR is not provided or swapchainCount is
zero then the masks are considered to be 1. If
DeviceGroupPresentInfoKHR is not provided, mode is considered to be
DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR.
Valid Usage
swapchainCountmust equal0orPresentInfoKHR::swapchainCount
- If
modeisDEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, then each element ofpDeviceMasksmust have exactly one bit set, and the corresponding element ofDeviceGroupPresentCapabilitiesKHR::presentMaskmust be non-zero - If
modeisDEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, then each element ofpDeviceMasksmust have exactly one bit set, and some physical device in the logical device must include that bit in itsDeviceGroupPresentCapabilitiesKHR::presentMask - If
modeisDEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, then each element ofpDeviceMasksmust have a value for which all set bits are set in one of the elements ofDeviceGroupPresentCapabilitiesKHR::presentMask - If
modeisDEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR, then for each bit set in each element ofpDeviceMasks, the corresponding element ofDeviceGroupPresentCapabilitiesKHR::presentMaskmust be non-zero - The value of each element of
pDeviceMasksmust be equal to the device mask passed inAcquireNextImageInfoKHR::deviceMaskwhen the image index was last acquired modemust have exactly one bit set, and that bit must have been included inDeviceGroupSwapchainCreateInfoKHR::modes
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR
- If
swapchainCountis not0,pDeviceMasksmust be a valid pointer to an array ofswapchainCountuint32_tvalues modemust be a validDeviceGroupPresentModeFlagBitsKHRvalue
See Also
Constructors
| DeviceGroupPresentInfoKHR | |
Fields
| |
Instances
data DeviceGroupSwapchainCreateInfoKHR Source #
VkDeviceGroupSwapchainCreateInfoKHR - Structure specifying parameters of a newly created swapchain object
Description
If this structure is not present, modes is considered to be
DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR.
Valid Usage (Implicit)
See Also
Constructors
| DeviceGroupSwapchainCreateInfoKHR | |
Fields
| |
Instances
newtype DeviceGroupPresentModeFlagBitsKHR Source #
VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported device group present modes
See Also
Constructors
| DeviceGroupPresentModeFlagBitsKHR Flags |
Bundled Patterns
| pattern DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR |
|
| pattern DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR |
|
| pattern DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR |
|
| pattern DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR |
|
Instances
newtype SwapchainCreateFlagBitsKHR Source #
VkSwapchainCreateFlagBitsKHR - Bitmask controlling swapchain creation
See Also
Constructors
| SwapchainCreateFlagBitsKHR Flags |
Bundled Patterns
| pattern SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR :: SwapchainCreateFlagBitsKHR |
|
| pattern SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR :: SwapchainCreateFlagBitsKHR |
|
| pattern SWAPCHAIN_CREATE_PROTECTED_BIT_KHR :: SwapchainCreateFlagBitsKHR |
|
Instances
type KHR_SWAPCHAIN_SPEC_VERSION = 70 Source #
pattern KHR_SWAPCHAIN_SPEC_VERSION :: forall a. Integral a => a Source #
type KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain" Source #
pattern KHR_SWAPCHAIN_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
newtype SurfaceKHR Source #
VkSurfaceKHR - Opaque handle to a surface object
Description
The VK_KHR_surface extension declares the SurfaceKHR object, and
provides a function for destroying SurfaceKHR objects. Separate
platform-specific extensions each provide a function for creating a
SurfaceKHR object for the respective platform. From the application’s
perspective this is an opaque handle, just like the handles of other
Vulkan objects.
See Also
PhysicalDeviceSurfaceInfo2KHR,
SwapchainCreateInfoKHR,
createAndroidSurfaceKHR,
createDirectFBSurfaceEXT,
createDisplayPlaneSurfaceKHR,
createHeadlessSurfaceEXT,
createIOSSurfaceMVK,
createImagePipeSurfaceFUCHSIA,
createMacOSSurfaceMVK,
createMetalSurfaceEXT,
createStreamDescriptorSurfaceGGP,
createViSurfaceNN,
createWaylandSurfaceKHR,
createWin32SurfaceKHR,
createXcbSurfaceKHR,
createXlibSurfaceKHR,
destroySurfaceKHR,
getDeviceGroupSurfacePresentModesKHR,
getPhysicalDevicePresentRectanglesKHR,
getPhysicalDeviceSurfaceCapabilities2EXT,
getPhysicalDeviceSurfaceCapabilitiesKHR,
getPhysicalDeviceSurfaceFormatsKHR,
getPhysicalDeviceSurfacePresentModesKHR,
getPhysicalDeviceSurfaceSupportKHR
Constructors
| SurfaceKHR Word64 |
Instances
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.
Note
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 presented 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 presentation engine controls the order in which presentable images are acquired for use by the application.
Note
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
AcquireNextImageInfoKHR,
BindImageMemorySwapchainInfoKHR,
ImageSwapchainCreateInfoKHR,
PresentInfoKHR,
SwapchainCreateInfoKHR,
acquireFullScreenExclusiveModeEXT,
acquireNextImageKHR,
createSharedSwapchainsKHR,
createSwapchainKHR,
destroySwapchainKHR,
getPastPresentationTimingGOOGLE,
getRefreshCycleDurationGOOGLE,
getSwapchainCounterEXT,
getSwapchainImagesKHR,
getSwapchainStatusKHR,
releaseFullScreenExclusiveModeEXT,
setHdrMetadataEXT,
setLocalDimmingAMD
Constructors
| SwapchainKHR Word64 |
Instances
newtype PresentModeKHR Source #
VkPresentModeKHR - presentation mode supported for a surface
Description
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_SHARED_DEMAND_REFRESH_KHR | SharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlags |
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR | SharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlags |
Presentable image usage queries
Note
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
SwapchainCreateInfoKHR,
getPhysicalDeviceSurfacePresentModes2EXT,
getPhysicalDeviceSurfacePresentModesKHR
Constructors
| PresentModeKHR Int32 |
Bundled Patterns
| pattern PRESENT_MODE_IMMEDIATE_KHR :: PresentModeKHR |
|
| pattern PRESENT_MODE_MAILBOX_KHR :: PresentModeKHR |
|
| pattern PRESENT_MODE_FIFO_KHR :: PresentModeKHR |
|
| pattern PRESENT_MODE_FIFO_RELAXED_KHR :: PresentModeKHR |
|
| pattern PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: PresentModeKHR |
|
| pattern PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: PresentModeKHR |
|
Instances
newtype ColorSpaceKHR Source #
VkColorSpaceKHR - supported color space of the presentation engine
Description
Note
In the initial release of the VK_KHR_surface and VK_KHR_swapchain
extensions, the token VK_COLORSPACE_SRGB_NONLINEAR_KHR was used.
Starting in the 2016-05-13 updates to the extension branches, matching
release 1.0.13 of the core API specification,
COLOR_SPACE_SRGB_NONLINEAR_KHR is used instead for consistency with
Vulkan naming rules. The older enum is still available for backwards
compatibility.
Note
In older versions of this extension COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
was misnamed
COLOR_SPACE_DCI_P3_LINEAR_EXT.
This has been updated to indicate that it uses RGB color encoding, not
XYZ. The old name is deprecated but is maintained for backwards
compatibility.
The color components of non-linear color space swap chain images must
have had the appropriate transfer function applied. The color space
selected for the swap chain image will not affect the processing of data
written into the image by the implementation. Vulkan requires that all
implementations support the sRGB transfer function by use of an SRGB
pixel format. Other transfer functions, such as SMPTE 170M or SMPTE2084,
can be performed by the application shader. This extension defines
enums for ColorSpaceKHR that correspond to the following color spaces:
| Name | Red Primary | Green Primary | Blue Primary | White-point | Transfer function |
|---|---|---|---|---|---|
| DCI-P3 | 1.000, 0.000 | 0.000, 1.000 | 0.000, 0.000 | 0.3333, 0.3333 | DCI P3 |
| Display-P3 | 0.680, 0.320 | 0.265, 0.690 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | Display-P3 |
| BT709 | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | ITU (SMPTE 170M) |
| sRGB | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | sRGB |
| extended sRGB | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | extended sRGB |
| HDR10_ST2084 | 0.708, 0.292 | 0.170, 0.797 | 0.131, 0.046 | 0.3127, 0.3290 (D65) | ST2084 PQ |
| DOLBYVISION | 0.708, 0.292 | 0.170, 0.797 | 0.131, 0.046 | 0.3127, 0.3290 (D65) | ST2084 PQ |
| HDR10_HLG | 0.708, 0.292 | 0.170, 0.797 | 0.131, 0.046 | 0.3127, 0.3290 (D65) | HLG |
| AdobeRGB | 0.640, 0.330 | 0.210, 0.710 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | AdobeRGB |
Color Spaces and Attributes
The transfer functions are described in the “Transfer Functions” chapter of the Khronos Data Format Specification.
Except Display-P3 OETF, which is:
[begin{aligned} E & = begin{cases} 1.055 times L^{1 over 2.4} - 0.055 & text{for} 0.0030186 leq L leq 1 -- 12.92 times L & text{for} 0 leq L < 0.0030186
Constructors
| ColorSpaceKHR Int32 |
Bundled Patterns
| pattern COLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_DISPLAY_NATIVE_AMD :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_PASS_THROUGH_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_ADOBERGB_LINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_HDR10_HLG_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_DOLBYVISION_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_HDR10_ST2084_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_BT2020_LINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_BT709_NONLINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_BT709_LINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_DCI_P3_NONLINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: ColorSpaceKHR |
|
| pattern COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: ColorSpaceKHR |
|
Instances
newtype CompositeAlphaFlagBitsKHR Source #
VkCompositeAlphaFlagBitsKHR - alpha compositing modes supported on a device
Description
These values are described as follows:
See Also
Constructors
| CompositeAlphaFlagBitsKHR Flags |
Bundled Patterns
| pattern COMPOSITE_ALPHA_OPAQUE_BIT_KHR :: CompositeAlphaFlagBitsKHR |
|
| pattern COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagBitsKHR |
|
| pattern COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagBitsKHR |
|
| pattern COMPOSITE_ALPHA_INHERIT_BIT_KHR :: CompositeAlphaFlagBitsKHR |
|
Instances
newtype SurfaceTransformFlagBitsKHR Source #
VkSurfaceTransformFlagBitsKHR - presentation transforms supported on a device
See Also
CommandBufferInheritanceRenderPassTransformInfoQCOM,
DisplaySurfaceCreateInfoKHR,
RenderPassTransformBeginInfoQCOM,
SurfaceCapabilities2EXT,
SurfaceCapabilitiesKHR, SurfaceTransformFlagsKHR,
SwapchainCreateInfoKHR
Constructors
| SurfaceTransformFlagBitsKHR Flags |
Bundled Patterns