{-# language CPP #-}
-- | = Name
--
-- VK_KHR_swapchain - device extension
--
-- == VK_KHR_swapchain
--
-- [__Name String__]
--     @VK_KHR_swapchain@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     2
--
-- [__Revision__]
--     70
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>
--
-- [__Contact__]
--
--     -   James Jones
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_swapchain] @cubanismo%0A*Here describe the issue or question you have about the VK_KHR_swapchain extension* >
--
--     -   Ian Elliott
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_swapchain] @ianelliottus%0A*Here describe the issue or question you have about the VK_KHR_swapchain extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2017-10-06
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with Vulkan 1.1
--
-- [__Contributors__]
--
--     -   Patrick Doane, Blizzard
--
--     -   Ian Elliott, LunarG
--
--     -   Jesse Hall, Google
--
--     -   Mathias Heyer, NVIDIA
--
--     -   James Jones, NVIDIA
--
--     -   David Mao, AMD
--
--     -   Norbert Nopper, Freescale
--
--     -   Alon Or-bach, Samsung
--
--     -   Daniel Rakos, AMD
--
--     -   Graham Sellers, AMD
--
--     -   Jeff Vigil, Qualcomm
--
--     -   Chia-I Wu, LunarG
--
--     -   Faith Ekstrand, Intel
--
--     -   Matthaeus G. Chajdas, AMD
--
--     -   Ray Smith, ARM
--
-- == Description
--
-- The @VK_KHR_swapchain@ extension is the device-level companion to the
-- @VK_KHR_surface@ extension. It introduces
-- 'Vulkan.Extensions.Handles.SwapchainKHR' objects, which provide the
-- ability to present rendering results to a surface.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.SwapchainKHR'
--
-- == New Commands
--
-- -   'acquireNextImageKHR'
--
-- -   'createSwapchainKHR'
--
-- -   'destroySwapchainKHR'
--
-- -   'getSwapchainImagesKHR'
--
-- -   'queuePresentKHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   'acquireNextImage2KHR'
--
-- -   'getDeviceGroupPresentCapabilitiesKHR'
--
-- -   'getDeviceGroupSurfacePresentModesKHR'
--
-- -   'getPhysicalDevicePresentRectanglesKHR'
--
-- == New Structures
--
-- -   'PresentInfoKHR'
--
-- -   'SwapchainCreateInfoKHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   'AcquireNextImageInfoKHR'
--
-- -   'DeviceGroupPresentCapabilitiesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo':
--
--     -   'BindImageMemorySwapchainInfoKHR'
--
-- -   Extending 'Vulkan.Core10.Image.ImageCreateInfo':
--
--     -   'ImageSwapchainCreateInfoKHR'
--
-- -   Extending 'PresentInfoKHR':
--
--     -   'DeviceGroupPresentInfoKHR'
--
-- -   Extending 'SwapchainCreateInfoKHR':
--
--     -   'DeviceGroupSwapchainCreateInfoKHR'
--
-- == New Enums
--
-- -   'SwapchainCreateFlagBitsKHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   'DeviceGroupPresentModeFlagBitsKHR'
--
-- == New Bitmasks
--
-- -   'SwapchainCreateFlagsKHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   'DeviceGroupPresentModeFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_SWAPCHAIN_EXTENSION_NAME'
--
-- -   'KHR_SWAPCHAIN_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ImageLayout.ImageLayout':
--
--     -   'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PRESENT_SRC_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_SWAPCHAIN_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR'
--
-- -   Extending 'SwapchainCreateFlagBitsKHR':
--
--     -   'SWAPCHAIN_CREATE_PROTECTED_BIT_KHR'
--
--     -   'SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR'
--
-- == Issues
--
-- 1) Does this extension allow the application to specify the memory
-- backing of the presentable images?
--
-- __RESOLVED__: No. Unlike standard images, the implementation will
-- allocate the memory backing of the presentable image.
--
-- 2) What operations are allowed on presentable images?
--
-- __RESOLVED__: This is determined by the image usage flags specified when
-- creating the presentable image’s swapchain.
--
-- 3) Does this extension support MSAA presentable images?
--
-- __RESOLVED__: No. Presentable images are always single-sampled.
-- Multi-sampled rendering must use regular images. To present the
-- rendering results the application must manually resolve the multi-
-- sampled image to a single-sampled presentable image prior to
-- presentation.
--
-- 4) Does this extension support stereo\/multi-view presentable images?
--
-- __RESOLVED__: Yes. The number of views associated with a presentable
-- image is determined by the @imageArrayLayers@ specified when creating a
-- swapchain. All presentable images in a given swapchain use the same
-- array size.
--
-- 5) Are the layers of stereo presentable images half-sized?
--
-- __RESOLVED__: No. The image extents always match those requested by the
-- application.
--
-- 6) Do the “present” and “acquire next image” commands operate on a
-- queue? If not, do they need to include explicit semaphore objects to
-- interlock them with queue operations?
--
-- __RESOLVED__: The present command operates on a queue. The image
-- ownership operation it represents happens in order with other operations
-- on the queue, so no explicit semaphore object is required to synchronize
-- its actions.
--
-- Applications may want to acquire the next image in separate threads from
-- those in which they manage their queue, or in multiple threads. To make
-- such usage easier, the acquire next image command takes a semaphore to
-- signal as a method of explicit synchronization. The application must
-- later queue a wait for this semaphore before queuing execution of any
-- commands using the image.
--
-- 7) Does 'acquireNextImageKHR' block if no images are available?
--
-- __RESOLVED__: The command takes a timeout parameter. Special values for
-- the timeout are 0, which makes the call a non-blocking operation, and
-- @UINT64_MAX@, which blocks indefinitely. Values in between will block
-- for up to the specified time. The call will return when an image becomes
-- available or an error occurs. It may, but is not required to, return
-- before the specified timeout expires if the swapchain becomes out of
-- date.
--
-- 8) Can multiple presents be queued using one 'queuePresentKHR' call?
--
-- __RESOLVED__: Yes. 'PresentInfoKHR' contains a list of swapchains and
-- corresponding image indices that will be presented. When supported, all
-- presentations queued with a single 'queuePresentKHR' call will be
-- applied atomically as one operation. The same swapchain must not appear
-- in the list more than once. Later extensions may provide applications
-- stronger guarantees of atomicity for such present operations, and\/or
-- allow them to query whether atomic presentation of a particular group of
-- swapchains is possible.
--
-- 9) How do the presentation and acquire next image functions notify the
-- application the targeted surface has changed?
--
-- __RESOLVED__: Two new result codes are introduced for this purpose:
--
-- -   'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR' - Presentation will
--     still succeed, subject to the window resize behavior, but the
--     swapchain is no longer configured optimally for the surface it
--     targets. Applications should query updated surface information and
--     recreate their swapchain at the next convenient opportunity.
--
-- -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR' - Failure. The
--     swapchain is no longer compatible with the surface it targets. The
--     application must query updated surface information and recreate the
--     swapchain before presentation will succeed.
--
-- These can be returned by both 'acquireNextImageKHR' and
-- 'queuePresentKHR'.
--
-- 10) Does the 'acquireNextImageKHR' command return a semaphore to the
-- application via an output parameter, or accept a semaphore to signal
-- from the application as an object handle parameter?
--
-- __RESOLVED__: Accept a semaphore to signal as an object handle. This
-- avoids the need to specify whether the application must destroy the
-- semaphore or whether it is owned by the swapchain, and if the latter,
-- what its lifetime is and whether it can be reused for other operations
-- once it is received from 'acquireNextImageKHR'.
--
-- 11) What types of swapchain queuing behavior should be exposed? Options
-- include swap interval specification, mailbox\/most recent vs. FIFO queue
-- management, targeting specific vertical blank intervals or absolute
-- times for a given present operation, and probably others. For some of
-- these, whether they are specified at swapchain creation time or as
-- per-present parameters needs to be decided as well.
--
-- __RESOLVED__: The base swapchain extension will expose 3 possible
-- behaviors (of which, FIFO will always be supported):
--
-- -   Immediate present: Does not wait for vertical blanking period to
--     update the current image, likely resulting in visible tearing. No
--     internal queue is used. Present requests are applied immediately.
--
-- -   Mailbox queue: Waits for the next vertical blanking period to update
--     the current image. No tearing should 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.
--
-- -   FIFO queue: Waits for the next vertical blanking period to update
--     the current image. No tearing should be observed. An internal queue
--     containing @numSwapchainImages@ - 1 entries 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
--
-- Not all surfaces will support all of these modes, so the modes supported
-- will be returned using a surface information query. All surfaces must
-- support the FIFO queue mode. Applications must choose one of these modes
-- up front when creating a swapchain. Switching modes can be accomplished
-- by recreating the swapchain.
--
-- 12) Can 'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_MAILBOX_KHR'
-- provide non-blocking guarantees for 'acquireNextImageKHR'? If so, what
-- is the proper criteria?
--
-- __RESOLVED__: Yes. The difficulty is not immediately obvious here.
-- Naively, if at least 3 images are requested, mailbox mode should always
-- have an image available for the application if the application does not
-- own any images when the call to 'acquireNextImageKHR' was made. However,
-- some presentation engines may have more than one “current” image, and
-- would still need to block in some cases. The right requirement appears
-- to be that if the application allocates the surface’s minimum number of
-- images + 1 then it is guaranteed non-blocking behavior when it does not
-- currently own any images.
--
-- 13) Is there a way to create and initialize a new swapchain for a
-- surface that has generated a 'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR'
-- return code while still using the old swapchain?
--
-- __RESOLVED__: Not as part of this specification. This could be useful to
-- allow the application to create an “optimal” replacement swapchain and
-- rebuild all its command buffers using it in a background thread at a low
-- priority while continuing to use the “suboptimal” swapchain in the main
-- thread. It could probably use the same “atomic replace” semantics
-- proposed for recreating direct-to-device swapchains without incurring a
-- mode switch. However, after discussion, it was determined some platforms
-- probably could not support concurrent swapchains for the same surface
-- though, so this will be left out of the base KHR extensions. A future
-- extension could add this for platforms where it is supported.
--
-- 14) Should there be a special value for
-- 'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR'::@maxImageCount@
-- to indicate there are no practical limits on the number of images in a
-- swapchain?
--
-- __RESOLVED__: Yes. There will often be cases where there is no practical
-- limit to the number of images in a swapchain other than the amount of
-- available resources (i.e., memory) in the system. Trying to derive a
-- hard limit from things like memory size is prone to failure. It is
-- better in such cases to leave it to applications to figure such soft
-- limits out via trial\/failure iterations.
--
-- 15) Should there be a special value for
-- 'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR'::@currentExtent@
-- to indicate the size of the platform surface is undefined?
--
-- __RESOLVED__: Yes. On some platforms (Wayland, for example), the surface
-- size is defined by the images presented to it rather than the other way
-- around.
--
-- 16) Should there be a special value for
-- 'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR'::@maxImageExtent@
-- to indicate there is no practical limit on the surface size?
--
-- __RESOLVED__: No. It seems unlikely such a system would exist. 0 could
-- be used to indicate the platform places no limits on the extents beyond
-- those imposed by Vulkan for normal images, but this query could just as
-- easily return those same limits, so a special “unlimited” value does not
-- seem useful for this field.
--
-- 17) How should surface rotation and mirroring be exposed to
-- applications? How do they specify rotation and mirroring transforms
-- applied prior to presentation?
--
-- __RESOLVED__: Applications can query both the supported and current
-- transforms of a surface. Both are specified relative to the device’s
-- “natural” display rotation and direction. The supported transforms
-- indicate which orientations the presentation engine accepts images in.
-- For example, a presentation engine that does not support transforming
-- surfaces as part of presentation, and which is presenting to a surface
-- that is displayed with a 90-degree rotation, would return only one
-- supported transform bit:
-- 'Vulkan.Extensions.VK_KHR_surface.SURFACE_TRANSFORM_ROTATE_90_BIT_KHR'.
-- Applications must transform their rendering by the transform they
-- specify when creating the swapchain in @preTransform@ field.
--
-- 18) Can surfaces ever not support @VK_MIRROR_NONE@? Can they support
-- vertical and horizontal mirroring simultaneously? Relatedly, should
-- @VK_MIRROR_NONE@[_BIT] be zero, or bit one, and should applications be
-- allowed to specify multiple pre and current mirror transform bits, or
-- exactly one?
--
-- __RESOLVED__: Since some platforms may not support presenting with a
-- transform other than the native window’s current transform, and
-- prerotation\/mirroring are specified relative to the device’s natural
-- rotation and direction, rather than relative to the surface’s current
-- rotation and direction, it is necessary to express lack of support for
-- no mirroring. To allow this, the @MIRROR_NONE@ enum must occupy a bit in
-- the flags. Since @MIRROR_NONE@ must be a bit in the bitmask rather than
-- a bitmask with no values set, allowing more than one bit to be set in
-- the bitmask would make it possible to describe undefined transforms such
-- as @VK_MIRROR_NONE_BIT@ | @VK_MIRROR_HORIZONTAL_BIT@, or a transform
-- that includes both “no mirroring” and “horizontal mirroring”
-- simultaneously. Therefore, it is desirable to allow specifying all
-- supported mirroring transforms using only one bit. The question then
-- becomes, should there be a @VK_MIRROR_HORIZONTAL_AND_VERTICAL_BIT@ to
-- represent a simultaneous horizontal and vertical mirror transform?
-- However, such a transform is equivalent to a 180 degree rotation, so
-- presentation engines and applications that wish to support or use such a
-- transform can express it through rotation instead. Therefore, 3
-- exclusive bits are sufficient to express all needed mirroring
-- transforms.
--
-- 19) Should support for sRGB be required?
--
-- __RESOLVED__: In the advent of UHD and HDR display devices, proper color
-- space information is vital to the display pipeline represented by the
-- swapchain. The app can discover the supported format\/color-space pairs
-- and select a pair most suited to its rendering needs. Currently only the
-- sRGB color space is supported, future extensions may provide support for
-- more color spaces. See issues 23 and 24.
--
-- 20) Is there a mechanism to modify or replace an existing swapchain with
-- one targeting the same surface?
--
-- __RESOLVED__: Yes. This is described above in the text.
--
-- 21) Should there be a way to set prerotation and mirroring using native
-- APIs when presenting using a Vulkan swapchain?
--
-- __RESOLVED__: Yes. The transforms that can be expressed in this
-- extension are a subset of those possible on native platforms. If a
-- platform exposes a method to specify the transform of presented images
-- for a given surface using native methods and exposes more transforms or
-- other properties for surfaces than Vulkan supports, it might be
-- impossible, difficult, or inconvenient to set some of those properties
-- using Vulkan KHR extensions and some using the native interfaces. To
-- avoid overwriting properties set using native commands when presenting
-- using a Vulkan swapchain, the application can set the pretransform to
-- “inherit”, in which case the current native properties will be used, or
-- if none are available, a platform-specific default will be used.
-- Platforms that do not specify a reasonable default or do not provide
-- native mechanisms to specify such transforms should not include the
-- inherit bits in the @supportedTransforms@ bitmask they return in
-- 'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR'.
--
-- 22) Should the content of presentable images be clipped by objects
-- obscuring their target surface?
--
-- __RESOLVED__: Applications can choose which behavior they prefer.
-- Allowing the content to be clipped could enable more efficient
-- presentation methods on some platforms, but some applications might rely
-- on the content of presentable images to perform techniques such as
-- partial updates or motion blurs.
--
-- 23) What is the purpose of specifying a
-- 'Vulkan.Extensions.VK_KHR_surface.ColorSpaceKHR' along with
-- 'Vulkan.Core10.Enums.Format.Format' when creating a swapchain?
--
-- __RESOLVED__: While Vulkan itself is color space agnostic (e.g. even the
-- meaning of R, G, B and A can be freely defined by the rendering
-- application), the swapchain eventually will have to present the images
-- on a display device with specific color reproduction characteristics. If
-- any color space transformations are necessary before an image can be
-- displayed, the color space of the presented image must be known to the
-- swapchain. A swapchain will only support a restricted set of color
-- format and -space pairs. This set can be discovered via
-- 'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceFormatsKHR'.
-- As it can be expected that most display devices support the sRGB color
-- space, at least one format\/color-space pair has to be exposed, where
-- the color space is
-- 'Vulkan.Extensions.VK_KHR_surface.COLOR_SPACE_SRGB_NONLINEAR_KHR'.
--
-- 24) How are sRGB formats and the sRGB color space related?
--
-- __RESOLVED__: While Vulkan exposes a number of SRGB texture formats,
-- using such formats does not guarantee working in a specific color space.
-- It merely means that the hardware can directly support applying the
-- non-linear transfer functions defined by the sRGB standard color space
-- when reading from or writing to images of those formats. Still, it is
-- unlikely that a swapchain will expose a @*_SRGB@ format along with any
-- color space other than
-- 'Vulkan.Extensions.VK_KHR_surface.COLOR_SPACE_SRGB_NONLINEAR_KHR'.
--
-- On the other hand, non-@*_SRGB@ formats will be very likely exposed in
-- pair with a SRGB color space. This means, the hardware will not apply
-- any transfer function when reading from or writing to such images, yet
-- they will still be presented on a device with sRGB display
-- characteristics. In this case the application is responsible for
-- applying the transfer function, for instance by using shader math.
--
-- 25) How are the lifetimes of surfaces and swapchains targeting them
-- related?
--
-- __RESOLVED__: A surface must outlive any swapchains targeting it. A
-- 'Vulkan.Extensions.Handles.SurfaceKHR' owns the binding of the native
-- window to the Vulkan driver.
--
-- 26) How can the client control the way the alpha component of swapchain
-- images is treated by the presentation engine during compositing?
--
-- __RESOLVED__: We should add new enum values to allow the client to
-- negotiate with the presentation engine on how to treat image alpha
-- values during the compositing process. Since not all platforms can
-- practically control this through the Vulkan driver, a value of
-- 'Vulkan.Extensions.VK_KHR_surface.COMPOSITE_ALPHA_INHERIT_BIT_KHR' is
-- provided like for surface transforms.
--
-- 27) Is 'createSwapchainKHR' the right function to return
-- 'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR', or should
-- the various platform-specific 'Vulkan.Extensions.Handles.SurfaceKHR'
-- factory functions catch this error earlier?
--
-- __RESOLVED__: For most platforms, the
-- 'Vulkan.Extensions.Handles.SurfaceKHR' structure is a simple container
-- holding the data that identifies a native window or other object
-- representing a surface on a particular platform. For the surface factory
-- functions to return this error, they would likely need to register a
-- reference on the native objects with the native display server somehow,
-- and ensure no other such references exist. Surfaces were not intended to
-- be that heavyweight.
--
-- Swapchains are intended to be the objects that directly manipulate
-- native windows and communicate with the native presentation mechanisms.
-- Swapchains will already need to communicate with the native display
-- server to negotiate allocation and\/or presentation of presentable
-- images for a native surface. Therefore, it makes more sense for
-- swapchain creation to be the point at which native object exclusivity is
-- enforced. Platforms may choose to enforce further restrictions on the
-- number of 'Vulkan.Extensions.Handles.SurfaceKHR' objects that may be
-- created for the same native window if such a requirement makes sense on
-- a particular platform, but a global requirement is only sensible at the
-- swapchain level.
--
-- == Examples
--
-- Note
--
-- The example code for the @VK_KHR_surface@ and @VK_KHR_swapchain@
-- extensions was removed from the appendix after revision 1.0.29. This WSI
-- example code was ported to the cube demo that is shipped with the
-- official Khronos SDK, and is being kept up-to-date in that location
-- (see:
-- <https://github.com/KhronosGroup/Vulkan-Tools/blob/master/cube/cube.c>).
--
-- == Version History
--
-- -   Revision 1, 2015-05-20 (James Jones)
--
--     -   Initial draft, based on LunarG KHR spec, other KHR specs,
--         patches attached to bugs.
--
-- -   Revision 2, 2015-05-22 (Ian Elliott)
--
--     -   Made many agreed-upon changes from 2015-05-21 KHR TSG meeting.
--         This includes using only a queue for presentation, and having an
--         explicit function to acquire the next image.
--
--     -   Fixed typos and other minor mistakes.
--
-- -   Revision 3, 2015-05-26 (Ian Elliott)
--
--     -   Improved the Description section.
--
--     -   Added or resolved issues that were found in improving the
--         Description. For example, pSurfaceDescription is used
--         consistently, instead of sometimes using pSurface.
--
-- -   Revision 4, 2015-05-27 (James Jones)
--
--     -   Fixed some grammatical errors and typos
--
--     -   Filled in the description of imageUseFlags when creating a
--         swapchain.
--
--     -   Added a description of swapInterval.
--
--     -   Replaced the paragraph describing the order of operations on a
--         queue for image ownership and presentation.
--
-- -   Revision 5, 2015-05-27 (James Jones)
--
--     -   Imported relevant issues from the (abandoned)
--         vk_wsi_persistent_swapchain_images extension.
--
--     -   Added issues 6 and 7, regarding behavior of the acquire next
--         image and present commands with respect to queues.
--
--     -   Updated spec language and examples to align with proposed
--         resolutions to issues 6 and 7.
--
-- -   Revision 6, 2015-05-27 (James Jones)
--
--     -   Added issue 8, regarding atomic presentation of multiple
--         swapchains
--
--     -   Updated spec language and examples to align with proposed
--         resolution to issue 8.
--
-- -   Revision 7, 2015-05-27 (James Jones)
--
--     -   Fixed compilation errors in example code, and made related spec
--         fixes.
--
-- -   Revision 8, 2015-05-27 (James Jones)
--
--     -   Added issue 9, and the related VK_SUBOPTIMAL_KHR result code.
--
--     -   Renamed VK_OUT_OF_DATE_KHR to VK_ERROR_OUT_OF_DATE_KHR.
--
-- -   Revision 9, 2015-05-27 (James Jones)
--
--     -   Added inline proposed resolutions (marked with [JRJ]) to some
--         XXX questions\/issues. These should be moved to the issues
--         section in a subsequent update if the proposals are adopted.
--
-- -   Revision 10, 2015-05-28 (James Jones)
--
--     -   Converted vkAcquireNextImageKHR back to a non-queue operation
--         that uses a VkSemaphore object for explicit synchronization.
--
--     -   Added issue 10 to determine whether vkAcquireNextImageKHR
--         generates or returns semaphores, or whether it operates on a
--         semaphore provided by the application.
--
-- -   Revision 11, 2015-05-28 (James Jones)
--
--     -   Marked issues 6, 7, and 8 resolved.
--
--     -   Renamed VkSurfaceCapabilityPropertiesKHR to
--         VkSurfacePropertiesKHR to better convey the mutable nature of
--         the information it contains.
--
-- -   Revision 12, 2015-05-28 (James Jones)
--
--     -   Added issue 11 with a proposed resolution, and the related issue
--         12.
--
--     -   Updated various sections of the spec to match the proposed
--         resolution to issue 11.
--
-- -   Revision 13, 2015-06-01 (James Jones)
--
--     -   Moved some structures to VK_EXT_KHR_swap_chain to resolve the
--         specification’s issues 1 and 2.
--
-- -   Revision 14, 2015-06-01 (James Jones)
--
--     -   Added code for example 4 demonstrating how an application might
--         make use of the two different present and acquire next image KHR
--         result codes.
--
--     -   Added issue 13.
--
-- -   Revision 15, 2015-06-01 (James Jones)
--
--     -   Added issues 14 - 16 and related spec language.
--
--     -   Fixed some spelling errors.
--
--     -   Added language describing the meaningful return values for
--         vkAcquireNextImageKHR and vkQueuePresentKHR.
--
-- -   Revision 16, 2015-06-02 (James Jones)
--
--     -   Added issues 17 and 18, as well as related spec language.
--
--     -   Removed some erroneous text added by mistake in the last update.
--
-- -   Revision 17, 2015-06-15 (Ian Elliott)
--
--     -   Changed special value from “-1” to “0” so that the data types
--         can be unsigned.
--
-- -   Revision 18, 2015-06-15 (Ian Elliott)
--
--     -   Clarified the values of VkSurfacePropertiesKHR::minImageCount
--         and the timeout parameter of the vkAcquireNextImageKHR function.
--
-- -   Revision 19, 2015-06-17 (James Jones)
--
--     -   Misc. cleanup. Removed resolved inline issues and fixed typos.
--
--     -   Fixed clarification of VkSurfacePropertiesKHR::minImageCount
--         made in version 18.
--
--     -   Added a brief “Image Ownership” definition to the list of terms
--         used in the spec.
--
-- -   Revision 20, 2015-06-17 (James Jones)
--
--     -   Updated enum-extending values using new convention.
--
-- -   Revision 21, 2015-06-17 (James Jones)
--
--     -   Added language describing how to use
--         VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR.
--
--     -   Cleaned up an XXX comment regarding the description of which
--         queues vkQueuePresentKHR can be used on.
--
-- -   Revision 22, 2015-06-17 (James Jones)
--
--     -   Rebased on Vulkan API version 126.
--
-- -   Revision 23, 2015-06-18 (James Jones)
--
--     -   Updated language for issue 12 to read as a proposed resolution.
--
--     -   Marked issues 11, 12, 13, 16, and 17 resolved.
--
--     -   Temporarily added links to the relevant bugs under the remaining
--         unresolved issues.
--
--     -   Added issues 19 and 20 as well as proposed resolutions.
--
-- -   Revision 24, 2015-06-19 (Ian Elliott)
--
--     -   Changed special value for VkSurfacePropertiesKHR::currentExtent
--         back to “-1” from “0”. This value will never need to be
--         unsigned, and “0” is actually a legal value.
--
-- -   Revision 25, 2015-06-23 (Ian Elliott)
--
--     -   Examples now show use of function pointers for extension
--         functions.
--
--     -   Eliminated extraneous whitespace.
--
-- -   Revision 26, 2015-06-25 (Ian Elliott)
--
--     -   Resolved Issues 9 & 10 per KHR TSG meeting.
--
-- -   Revision 27, 2015-06-25 (James Jones)
--
--     -   Added oldSwapchain member to VkSwapchainCreateInfoKHR.
--
-- -   Revision 28, 2015-06-25 (James Jones)
--
--     -   Added the “inherit” bits to the rotation and mirroring flags and
--         the associated issue 21.
--
-- -   Revision 29, 2015-06-25 (James Jones)
--
--     -   Added the “clipped” flag to VkSwapchainCreateInfoKHR, and the
--         associated issue 22.
--
--     -   Specified that presenting an image does not modify it.
--
-- -   Revision 30, 2015-06-25 (James Jones)
--
--     -   Added language to the spec that clarifies the behavior of
--         vkCreateSwapchainKHR() when the oldSwapchain field of
--         VkSwapchainCreateInfoKHR is not NULL.
--
-- -   Revision 31, 2015-06-26 (Ian Elliott)
--
--     -   Example of new VkSwapchainCreateInfoKHR members, “oldSwapchain”
--         and “clipped”.
--
--     -   Example of using VkSurfacePropertiesKHR::{min|max}ImageCount to
--         set VkSwapchainCreateInfoKHR::minImageCount.
--
--     -   Rename vkGetSurfaceInfoKHR()\'s 4th parameter to “pDataSize”,
--         for consistency with other functions.
--
--     -   Add macro with C-string name of extension (just to header file).
--
-- -   Revision 32, 2015-06-26 (James Jones)
--
--     -   Minor adjustments to the language describing the behavior of
--         “oldSwapchain”
--
--     -   Fixed the version date on my previous two updates.
--
-- -   Revision 33, 2015-06-26 (Jesse Hall)
--
--     -   Add usage flags to VkSwapchainCreateInfoKHR
--
-- -   Revision 34, 2015-06-26 (Ian Elliott)
--
--     -   Rename vkQueuePresentKHR()\'s 2nd parameter to “pPresentInfo”,
--         for consistency with other functions.
--
-- -   Revision 35, 2015-06-26 (Faith Ekstrand)
--
--     -   Merged the VkRotationFlagBitsKHR and VkMirrorFlagBitsKHR enums
--         into a single VkSurfaceTransformFlagBitsKHR enum.
--
-- -   Revision 36, 2015-06-26 (Faith Ekstrand)
--
--     -   Added a VkSurfaceTransformKHR enum that is not a bitmask. Each
--         value in VkSurfaceTransformKHR corresponds directly to one of
--         the bits in VkSurfaceTransformFlagBitsKHR so transforming from
--         one to the other is easy. Having a separate enum means that
--         currentTransform and preTransform are now unambiguous by
--         definition.
--
-- -   Revision 37, 2015-06-29 (Ian Elliott)
--
--     -   Corrected one of the signatures of vkAcquireNextImageKHR, which
--         had the last two parameters switched from what it is elsewhere
--         in the specification and header files.
--
-- -   Revision 38, 2015-06-30 (Ian Elliott)
--
--     -   Corrected a typo in description of the vkGetSwapchainInfoKHR()
--         function.
--
--     -   Corrected a typo in header file comment for
--         VkPresentInfoKHR::sType.
--
-- -   Revision 39, 2015-07-07 (Daniel Rakos)
--
--     -   Added error section describing when each error is expected to be
--         reported.
--
--     -   Replaced bool32_t with VkBool32.
--
-- -   Revision 40, 2015-07-10 (Ian Elliott)
--
--     -   Updated to work with version 138 of the @vulkan.h@ header. This
--         includes declaring the VkSwapchainKHR type using the new
--         VK_DEFINE_NONDISP_HANDLE macro, and no longer extending
--         VkObjectType (which was eliminated).
--
-- -   Revision 41 2015-07-09 (Mathias Heyer)
--
--     -   Added color space language.
--
-- -   Revision 42, 2015-07-10 (Daniel Rakos)
--
--     -   Updated query mechanism to reflect the convention changes done
--         in the core spec.
--
--     -   Removed “queue” from the name of
--         VK_STRUCTURE_TYPE_QUEUE_PRESENT_INFO_KHR to be consistent with
--         the established naming convention.
--
--     -   Removed reference to the no longer existing VkObjectType enum.
--
-- -   Revision 43, 2015-07-17 (Daniel Rakos)
--
--     -   Added support for concurrent sharing of swapchain images across
--         queue families.
--
--     -   Updated sample code based on recent changes
--
-- -   Revision 44, 2015-07-27 (Ian Elliott)
--
--     -   Noted that support for VK_PRESENT_MODE_FIFO_KHR is required.
--         That is ICDs may optionally support IMMEDIATE and MAILBOX, but
--         must support FIFO.
--
-- -   Revision 45, 2015-08-07 (Ian Elliott)
--
--     -   Corrected a typo in spec file (type and variable name had wrong
--         case for the imageColorSpace member of the
--         VkSwapchainCreateInfoKHR struct).
--
--     -   Corrected a typo in header file (last parameter in
--         PFN_vkGetSurfacePropertiesKHR was missing “KHR” at the end of
--         type: VkSurfacePropertiesKHR).
--
-- -   Revision 46, 2015-08-20 (Ian Elliott)
--
--     -   Renamed this extension and all of its enumerations, types,
--         functions, etc. This makes it compliant with the proposed
--         standard for Vulkan extensions.
--
--     -   Switched from “revision” to “version”, including use of the
--         VK_MAKE_VERSION macro in the header file.
--
--     -   Made improvements to several descriptions.
--
--     -   Changed the status of several issues from PROPOSED to RESOLVED,
--         leaving no unresolved issues.
--
--     -   Resolved several TODOs, did miscellaneous cleanup, etc.
--
-- -   Revision 47, 2015-08-20 (Ian Elliott—​porting a 2015-07-29 change
--     from James Jones)
--
--     -   Moved the surface transform enums to VK_WSI_swapchain so they
--         could be reused by VK_WSI_display.
--
-- -   Revision 48, 2015-09-01 (James Jones)
--
--     -   Various minor cleanups.
--
-- -   Revision 49, 2015-09-01 (James Jones)
--
--     -   Restore single-field revision number.
--
-- -   Revision 50, 2015-09-01 (James Jones)
--
--     -   Update Example #4 to include code that illustrates how to use
--         the oldSwapchain field.
--
-- -   Revision 51, 2015-09-01 (James Jones)
--
--     -   Fix example code compilation errors.
--
-- -   Revision 52, 2015-09-08 (Matthaeus G. Chajdas)
--
--     -   Corrected a typo.
--
-- -   Revision 53, 2015-09-10 (Alon Or-bach)
--
--     -   Removed underscore from SWAP_CHAIN left in
--         VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR.
--
-- -   Revision 54, 2015-09-11 (Jesse Hall)
--
--     -   Described the execution and memory coherence requirements for
--         image transitions to and from
--         VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR.
--
-- -   Revision 55, 2015-09-11 (Ray Smith)
--
--     -   Added errors for destroying and binding memory to presentable
--         images
--
-- -   Revision 56, 2015-09-18 (James Jones)
--
--     -   Added fence argument to vkAcquireNextImageKHR
--
--     -   Added example of how to meter a host thread based on
--         presentation rate.
--
-- -   Revision 57, 2015-09-26 (Jesse Hall)
--
--     -   Replace VkSurfaceDescriptionKHR with VkSurfaceKHR.
--
--     -   Added issue 25 with agreed resolution.
--
-- -   Revision 58, 2015-09-28 (Jesse Hall)
--
--     -   Renamed from VK_EXT_KHR_device_swapchain to
--         VK_EXT_KHR_swapchain.
--
-- -   Revision 59, 2015-09-29 (Ian Elliott)
--
--     -   Changed vkDestroySwapchainKHR() to return void.
--
-- -   Revision 60, 2015-10-01 (Jeff Vigil)
--
--     -   Added error result VK_ERROR_SURFACE_LOST_KHR.
--
-- -   Revision 61, 2015-10-05 (Faith Ekstrand)
--
--     -   Added the VkCompositeAlpha enum and corresponding structure
--         fields.
--
-- -   Revision 62, 2015-10-12 (Daniel Rakos)
--
--     -   Added VK_PRESENT_MODE_FIFO_RELAXED_KHR.
--
-- -   Revision 63, 2015-10-15 (Daniel Rakos)
--
--     -   Moved surface capability queries to VK_EXT_KHR_surface.
--
-- -   Revision 64, 2015-10-26 (Ian Elliott)
--
--     -   Renamed from VK_EXT_KHR_swapchain to VK_KHR_swapchain.
--
-- -   Revision 65, 2015-10-28 (Ian Elliott)
--
--     -   Added optional pResult member to VkPresentInfoKHR, so that
--         per-swapchain results can be obtained from vkQueuePresentKHR().
--
-- -   Revision 66, 2015-11-03 (Daniel Rakos)
--
--     -   Added allocation callbacks to create and destroy functions.
--
--     -   Updated resource transition language.
--
--     -   Updated sample code.
--
-- -   Revision 67, 2015-11-10 (Jesse Hall)
--
--     -   Add reserved flags bitmask to VkSwapchainCreateInfoKHR.
--
--     -   Modify naming and member ordering to match API style
--         conventions, and so the VkSwapchainCreateInfoKHR image property
--         members mirror corresponding VkImageCreateInfo members but with
--         an \'image\' prefix.
--
--     -   Make VkPresentInfoKHR::pResults non-const; it is an output array
--         parameter.
--
--     -   Make pPresentInfo parameter to vkQueuePresentKHR const.
--
-- -   Revision 68, 2016-04-05 (Ian Elliott)
--
--     -   Moved the “validity” include for vkAcquireNextImage to be in its
--         proper place, after the prototype and list of parameters.
--
--     -   Clarified language about presentable images, including how they
--         are acquired, when applications can and cannot use them, etc. As
--         part of this, removed language about “ownership” of presentable
--         images, and replaced it with more-consistent language about
--         presentable images being “acquired” by the application.
--
-- -   2016-08-23 (Ian Elliott)
--
--     -   Update the example code, to use the final API command names, to
--         not have so many characters per line, and to split out a new
--         example to show how to obtain function pointers. This code is
--         more similar to the LunarG “cube” demo program.
--
-- -   2016-08-25 (Ian Elliott)
--
--     -   A note was added at the beginning of the example code, stating
--         that it will be removed from future versions of the appendix.
--
-- -   Revision 69, 2017-09-07 (Tobias Hector)
--
--     -   Added interactions with Vulkan 1.1
--
-- -   Revision 70, 2017-10-06 (Ian Elliott)
--
--     -   Corrected interactions with Vulkan 1.1
--
-- == See Also
--
-- 'PresentInfoKHR', 'SwapchainCreateFlagBitsKHR',
-- 'SwapchainCreateFlagsKHR', 'SwapchainCreateInfoKHR',
-- 'Vulkan.Extensions.Handles.SwapchainKHR', 'acquireNextImageKHR',
-- 'createSwapchainKHR', 'destroySwapchainKHR', 'getSwapchainImagesKHR',
-- 'queuePresentKHR'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_swapchain Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_swapchain  ( createSwapchainKHR
                                           , withSwapchainKHR
                                           , destroySwapchainKHR
                                           , getSwapchainImagesKHR
                                           , acquireNextImageKHR
                                           , acquireNextImageKHRSafe
                                           , queuePresentKHR
                                           , getDeviceGroupPresentCapabilitiesKHR
                                           , getDeviceGroupSurfacePresentModesKHR
                                           , acquireNextImage2KHR
                                           , acquireNextImage2KHRSafe
                                           , getPhysicalDevicePresentRectanglesKHR
                                           , SwapchainCreateInfoKHR(..)
                                           , PresentInfoKHR(..)
                                           , DeviceGroupPresentCapabilitiesKHR(..)
                                           , ImageSwapchainCreateInfoKHR(..)
                                           , BindImageMemorySwapchainInfoKHR(..)
                                           , AcquireNextImageInfoKHR(..)
                                           , DeviceGroupPresentInfoKHR(..)
                                           , DeviceGroupSwapchainCreateInfoKHR(..)
                                           , DeviceGroupPresentModeFlagsKHR
                                           , DeviceGroupPresentModeFlagBitsKHR( DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR
                                                                              , DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR
                                                                              , DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR
                                                                              , DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR
                                                                              , ..
                                                                              )
                                           , SwapchainCreateFlagsKHR
                                           , SwapchainCreateFlagBitsKHR( SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT
                                                                       , SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR
                                                                       , SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR
                                                                       , SWAPCHAIN_CREATE_PROTECTED_BIT_KHR
                                                                       , ..
                                                                       )
                                           , KHR_SWAPCHAIN_SPEC_VERSION
                                           , pattern KHR_SWAPCHAIN_SPEC_VERSION
                                           , KHR_SWAPCHAIN_EXTENSION_NAME
                                           , pattern KHR_SWAPCHAIN_EXTENSION_NAME
                                           , SurfaceKHR(..)
                                           , SwapchainKHR(..)
                                           , PresentModeKHR(..)
                                           , ColorSpaceKHR(..)
                                           , CompositeAlphaFlagBitsKHR(..)
                                           , CompositeAlphaFlagsKHR
                                           , SurfaceTransformFlagBitsKHR(..)
                                           , SurfaceTransformFlagsKHR
                                           ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Extensions.VK_KHR_surface (ColorSpaceKHR)
import Vulkan.Extensions.VK_KHR_surface (CompositeAlphaFlagBitsKHR)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkAcquireNextImage2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkAcquireNextImageKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCreateSwapchainKHR))
import Vulkan.Dynamic (DeviceCmds(pVkDestroySwapchainKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceGroupPresentCapabilitiesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceGroupSurfacePresentModesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetSwapchainImagesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkQueuePresentKHR))
import Vulkan.Core10.Handles (Device_T)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_display_swapchain (DisplayPresentInfoKHR)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.Core10.Handles (Fence)
import Vulkan.Core10.Handles (Fence(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.Format (Format)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_frame_boundary (FrameBoundaryEXT)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Handles (Image(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_image_compression_control (ImageCompressionControlEXT)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_image_format_list (ImageFormatListCreateInfo)
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlags)
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDevicePresentRectanglesKHR))
import Vulkan.Core10.APIConstants (MAX_DEVICE_GROUP_SIZE)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_GGP_frame_token (PresentFrameTokenGGP)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_present_id (PresentIdKHR)
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_incremental_present (PresentRegionsKHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_GOOGLE_display_timing (PresentTimesInfoGOOGLE)
import Vulkan.Core10.Handles (Queue)
import Vulkan.Core10.Handles (Queue(..))
import Vulkan.Core10.Handles (Queue(Queue))
import Vulkan.Core10.Handles (Queue_T)
import Vulkan.Core10.FundamentalTypes (Rect2D)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Handles (Semaphore)
import Vulkan.Core10.Handles (Semaphore(..))
import Vulkan.Core10.Enums.SharingMode (SharingMode)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_full_screen_exclusive (SurfaceFullScreenExclusiveInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_full_screen_exclusive (SurfaceFullScreenExclusiveWin32InfoEXT)
import Vulkan.Extensions.Handles (SurfaceKHR)
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Extensions.VK_KHR_surface (SurfaceTransformFlagBitsKHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_display_control (SwapchainCounterCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_AMD_display_native_hdr (SwapchainDisplayNativeHdrCreateInfoAMD)
import Vulkan.Extensions.Handles (SwapchainKHR)
import Vulkan.Extensions.Handles (SwapchainKHR(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_low_latency2 (SwapchainLatencyCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_present_barrier (SwapchainPresentBarrierCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_swapchain_maintenance1 (SwapchainPresentFenceInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_swapchain_maintenance1 (SwapchainPresentModeInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_swapchain_maintenance1 (SwapchainPresentModesCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_swapchain_maintenance1 (SwapchainPresentScalingCreateInfoEXT)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.APIConstants (pattern MAX_DEVICE_GROUP_SIZE)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_KHR_surface (ColorSpaceKHR(..))
import Vulkan.Extensions.VK_KHR_surface (CompositeAlphaFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_surface (CompositeAlphaFlagsKHR)
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR(..))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Extensions.VK_KHR_surface (SurfaceTransformFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_surface (SurfaceTransformFlagsKHR)
import Vulkan.Extensions.Handles (SwapchainKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateSwapchainKHR
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct SwapchainCreateInfoKHR) -> Ptr AllocationCallbacks -> Ptr SwapchainKHR -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct SwapchainCreateInfoKHR) -> Ptr AllocationCallbacks -> Ptr SwapchainKHR -> IO Result

-- | vkCreateSwapchainKHR - Create a swapchain
--
-- = Description
--
-- As mentioned above, if 'createSwapchainKHR' succeeds, it will return a
-- handle to a swapchain containing an array of at least
-- @pCreateInfo->minImageCount@ presentable images.
--
-- While acquired by the application, presentable images /can/ be used in
-- any way that equivalent non-presentable images /can/ be used. A
-- presentable image is equivalent to a non-presentable image created with
-- the following 'Vulkan.Core10.Image.ImageCreateInfo' parameters:
--
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | 'Vulkan.Core10.Image.ImageCreateInfo' | Value                                                                                  |
-- | Field                                 |                                                                                        |
-- +=======================================+========================================================================================+
-- | @flags@                               | 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT' |
-- |                                       | is set if 'SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR' is set                |
-- |                                       |                                                                                        |
-- |                                       | 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_PROTECTED_BIT' is set if         |
-- |                                       | 'SWAPCHAIN_CREATE_PROTECTED_BIT_KHR' is set                                            |
-- |                                       |                                                                                        |
-- |                                       | 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_MUTABLE_FORMAT_BIT' and          |
-- |                                       | 'Vulkan.Extensions.VK_KHR_maintenance2.IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR' are both   |
-- |                                       | set if 'SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR' is set                                |
-- |                                       |                                                                                        |
-- |                                       | all other bits are unset                                                               |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @imageType@                           | 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D'                                          |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @format@                              | @pCreateInfo->imageFormat@                                                             |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @extent@                              | {@pCreateInfo->imageExtent.width@, @pCreateInfo->imageExtent.height@, @1@}             |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @mipLevels@                           | 1                                                                                      |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @arrayLayers@                         | @pCreateInfo->imageArrayLayers@                                                        |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @samples@                             | 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'                           |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @tiling@                              | 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL'                                 |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @usage@                               | @pCreateInfo->imageUsage@                                                              |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @sharingMode@                         | @pCreateInfo->imageSharingMode@                                                        |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @queueFamilyIndexCount@               | @pCreateInfo->queueFamilyIndexCount@                                                   |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @pQueueFamilyIndices@                 | @pCreateInfo->pQueueFamilyIndices@                                                     |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
-- | @initialLayout@                       | 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED'                               |
-- +---------------------------------------+----------------------------------------------------------------------------------------+
--
-- The @pCreateInfo->surface@ /must/ not be destroyed until after the
-- swapchain is destroyed.
--
-- If @oldSwapchain@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE', and the
-- native window referred to by @pCreateInfo->surface@ is already
-- associated with a Vulkan swapchain,
-- 'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR' /must/ be
-- returned.
--
-- If the native window referred to by @pCreateInfo->surface@ is already
-- associated with a non-Vulkan graphics API surface,
-- 'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR' /must/ be
-- returned.
--
-- The native window referred to by @pCreateInfo->surface@ /must/ not
-- become associated with a non-Vulkan graphics API surface before all
-- associated Vulkan swapchains have been destroyed.
--
-- 'createSwapchainKHR' will return
-- 'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST' if the logical device was
-- lost. The 'Vulkan.Extensions.Handles.SwapchainKHR' is a child of the
-- @device@, and /must/ be destroyed before the @device@. However,
-- 'Vulkan.Extensions.Handles.SurfaceKHR' is not a child of any
-- 'Vulkan.Core10.Handles.Device' and is not affected by the lost device.
-- After successfully recreating a 'Vulkan.Core10.Handles.Device', the same
-- 'Vulkan.Extensions.Handles.SurfaceKHR' /can/ be used to create a new
-- 'Vulkan.Extensions.Handles.SwapchainKHR', provided the previous one was
-- destroyed.
--
-- If the @oldSwapchain@ parameter of @pCreateInfo@ is a valid swapchain,
-- which has exclusive full-screen access, that access is released from
-- @pCreateInfo->oldSwapchain@. If the command succeeds in this case, the
-- newly created swapchain will automatically acquire exclusive full-screen
-- access from @pCreateInfo->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, 'Vulkan.Core10.Enums.Result.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.
--
-- If the @pNext@ chain of 'SwapchainCreateInfoKHR' includes a
-- 'Vulkan.Extensions.VK_NV_present_barrier.SwapchainPresentBarrierCreateInfoNV'
-- structure, then that structure includes additional swapchain creation
-- parameters specific to the present barrier. Swapchain creation /may/
-- fail if the state of the current system restricts the usage of the
-- present barrier feature
-- 'Vulkan.Extensions.VK_NV_present_barrier.SurfaceCapabilitiesPresentBarrierNV',
-- or a swapchain itself does not satisfy all the required conditions. In
-- this scenario 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
-- is returned.
--
-- When the 'Vulkan.Extensions.Handles.SurfaceKHR' in
-- 'SwapchainCreateInfoKHR' is a display surface, then the
-- 'Vulkan.Extensions.Handles.DisplayModeKHR' in display surface’s
-- 'Vulkan.Extensions.VK_KHR_display.DisplaySurfaceCreateInfoKHR' is
-- associated with a particular 'Vulkan.Extensions.Handles.DisplayKHR'.
-- Swapchain creation /may/ fail if that
-- 'Vulkan.Extensions.Handles.DisplayKHR' is not acquired by the
-- application. In this scenario
-- 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED' is returned.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateSwapchainKHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateSwapchainKHR-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'SwapchainCreateInfoKHR'
--     structure
--
-- -   #VUID-vkCreateSwapchainKHR-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateSwapchainKHR-pSwapchain-parameter# @pSwapchain@ /must/
--     be a valid pointer to a 'Vulkan.Extensions.Handles.SwapchainKHR'
--     handle
--
-- == Host Synchronization
--
-- -   Host access to @pCreateInfo->surface@ /must/ be externally
--     synchronized
--
-- -   Host access to @pCreateInfo->oldSwapchain@ /must/ be externally
--     synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_COMPRESSION_EXHAUSTED_EXT'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'SwapchainCreateInfoKHR',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
createSwapchainKHR :: forall a io
                    . ( Extendss SwapchainCreateInfoKHR a
                      , PokeChain a
                      , MonadIO io )
                   => -- | @device@ is the device to create the swapchain for.
                      Device
                   -> -- | @pCreateInfo@ is a pointer to a 'SwapchainCreateInfoKHR' structure
                      -- specifying the parameters of the created swapchain.
                      (SwapchainCreateInfoKHR a)
                   -> -- | @pAllocator@ is the allocator used for host memory allocated for the
                      -- swapchain object when there is no more specific allocator available (see
                      -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
                      ("allocator" ::: Maybe AllocationCallbacks)
                   -> io (SwapchainKHR)
createSwapchainKHR :: forall (a :: [*]) (io :: * -> *).
(Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) =>
Device
-> SwapchainCreateInfoKHR a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SwapchainKHR
createSwapchainKHR Device
device SwapchainCreateInfoKHR a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCreateSwapchainKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSwapchain" ::: Ptr SwapchainKHR)
   -> IO Result)
vkCreateSwapchainKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSwapchain" ::: Ptr SwapchainKHR)
      -> IO Result)
pVkCreateSwapchainKHR (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSwapchain" ::: Ptr SwapchainKHR)
   -> IO Result)
vkCreateSwapchainKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateSwapchainKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateSwapchainKHR' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSwapchain" ::: Ptr SwapchainKHR)
-> IO Result
vkCreateSwapchainKHR' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSwapchain" ::: Ptr SwapchainKHR)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSwapchain" ::: Ptr SwapchainKHR)
-> IO Result
mkVkCreateSwapchainKHR FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSwapchain" ::: Ptr SwapchainKHR)
   -> IO Result)
vkCreateSwapchainKHRPtr
  Ptr (SwapchainCreateInfoKHR a)
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SwapchainCreateInfoKHR a
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pSwapchain" ::: Ptr SwapchainKHR
pPSwapchain <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @SwapchainKHR Int
8) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateSwapchainKHR" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct SwapchainCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSwapchain" ::: Ptr SwapchainKHR)
-> IO Result
vkCreateSwapchainKHR'
                                                         (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                         (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SwapchainCreateInfoKHR a)
pCreateInfo)
                                                         "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
                                                         ("pSwapchain" ::: Ptr SwapchainKHR
pPSwapchain))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  SwapchainKHR
pSwapchain <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR "pSwapchain" ::: Ptr SwapchainKHR
pPSwapchain
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (SwapchainKHR
pSwapchain)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createSwapchainKHR' and 'destroySwapchainKHR'
--
-- To ensure that 'destroySwapchainKHR' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withSwapchainKHR :: forall a io r . (Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) => Device -> SwapchainCreateInfoKHR a -> Maybe AllocationCallbacks -> (io SwapchainKHR -> (SwapchainKHR -> io ()) -> r) -> r
withSwapchainKHR :: forall (a :: [*]) (io :: * -> *) r.
(Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) =>
Device
-> SwapchainCreateInfoKHR a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io SwapchainKHR -> (SwapchainKHR -> io ()) -> r)
-> r
withSwapchainKHR Device
device SwapchainCreateInfoKHR a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io SwapchainKHR -> (SwapchainKHR -> io ()) -> r
b =
  io SwapchainKHR -> (SwapchainKHR -> io ()) -> r
b (forall (a :: [*]) (io :: * -> *).
(Extendss SwapchainCreateInfoKHR a, PokeChain a, MonadIO io) =>
Device
-> SwapchainCreateInfoKHR a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SwapchainKHR
createSwapchainKHR Device
device SwapchainCreateInfoKHR a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(SwapchainKHR
o0) -> forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySwapchainKHR Device
device SwapchainKHR
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroySwapchainKHR
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> SwapchainKHR -> Ptr 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 'Vulkan.Core10.Handles.Image'
-- handles are destroyed, and /must/ not be acquired or used any more by
-- the application. The memory of each 'Vulkan.Core10.Handles.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
-- 'Vulkan.Extensions.Handles.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
--
-- -   #VUID-vkDestroySwapchainKHR-swapchain-01282# All uses of presentable
--     images acquired from @swapchain@ /must/ have completed execution
--
-- -   #VUID-vkDestroySwapchainKHR-swapchain-01283# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @swapchain@ was created, a compatible set of callbacks
--     /must/ be provided here
--
-- -   #VUID-vkDestroySwapchainKHR-swapchain-01284# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @swapchain@ was created, @pAllocator@ /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroySwapchainKHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroySwapchainKHR-swapchain-parameter# If @swapchain@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @swapchain@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkDestroySwapchainKHR-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroySwapchainKHR-swapchain-parent# If @swapchain@ is a
--     valid handle, it /must/ have been created, allocated, or retrieved
--     from @device@
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.SwapchainKHR'
destroySwapchainKHR :: forall io
                     . (MonadIO io)
                    => -- | @device@ is the 'Vulkan.Core10.Handles.Device' associated with
                       -- @swapchain@.
                       Device
                    -> -- | @swapchain@ is the swapchain to destroy.
                       SwapchainKHR
                    -> -- | @pAllocator@ is the allocator used for host memory allocated for the
                       -- swapchain object when there is no more specific allocator available (see
                       -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
                       ("allocator" ::: Maybe AllocationCallbacks)
                    -> io ()
destroySwapchainKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySwapchainKHR Device
device SwapchainKHR
swapchain "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkDestroySwapchainKHRPtr :: FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroySwapchainKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroySwapchainKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroySwapchainKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroySwapchainKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkDestroySwapchainKHR' :: Ptr Device_T
-> SwapchainKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroySwapchainKHR' = FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> SwapchainKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroySwapchainKHR FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroySwapchainKHRPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroySwapchainKHR" (Ptr Device_T
-> SwapchainKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroySwapchainKHR'
                                                     (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                     (SwapchainKHR
swapchain)
                                                     "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetSwapchainImagesKHR
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> Ptr Word32 -> Ptr Image -> IO Result) -> Ptr Device_T -> SwapchainKHR -> Ptr Word32 -> Ptr Image -> IO Result

-- | 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, and
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not all the
-- available presentable images were returned.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetSwapchainImagesKHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetSwapchainImagesKHR-swapchain-parameter# @swapchain@
--     /must/ be a valid 'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter#
--     @pSwapchainImageCount@ /must/ be a valid pointer to a @uint32_t@
--     value
--
-- -   #VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter# If the
--     value referenced by @pSwapchainImageCount@ is not @0@, and
--     @pSwapchainImages@ is not @NULL@, @pSwapchainImages@ /must/ be a
--     valid pointer to an array of @pSwapchainImageCount@
--     'Vulkan.Core10.Handles.Image' handles
--
-- -   #VUID-vkGetSwapchainImagesKHR-swapchain-parent# @swapchain@ /must/
--     have been created, allocated, or retrieved from @device@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
getSwapchainImagesKHR :: forall io
                       . (MonadIO io)
                      => -- | @device@ is the device associated with @swapchain@.
                         Device
                      -> -- | @swapchain@ is the swapchain to query.
                         SwapchainKHR
                      -> io (Result, ("swapchainImages" ::: Vector Image))
getSwapchainImagesKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR -> io (Result, "swapchainImages" ::: Vector Image)
getSwapchainImagesKHR Device
device SwapchainKHR
swapchain = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetSwapchainImagesKHRPtr :: FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pSwapchainImages" ::: Ptr Image)
   -> IO Result)
vkGetSwapchainImagesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> ("pSwapchainImageCount" ::: Ptr Flags)
      -> ("pSwapchainImages" ::: Ptr Image)
      -> IO Result)
pVkGetSwapchainImagesKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pSwapchainImages" ::: Ptr Image)
   -> IO Result)
vkGetSwapchainImagesKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetSwapchainImagesKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetSwapchainImagesKHR' :: Ptr Device_T
-> SwapchainKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pSwapchainImages" ::: Ptr Image)
-> IO Result
vkGetSwapchainImagesKHR' = FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pSwapchainImages" ::: Ptr Image)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pSwapchainImages" ::: Ptr Image)
-> IO Result
mkVkGetSwapchainImagesKHR FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pSwapchainImages" ::: Ptr Image)
   -> IO Result)
vkGetSwapchainImagesKHRPtr
  let device' :: Ptr Device_T
device' = Device -> Ptr Device_T
deviceHandle (Device
device)
  "pSwapchainImageCount" ::: Ptr Flags
pPSwapchainImageCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetSwapchainImagesKHR" (Ptr Device_T
-> SwapchainKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pSwapchainImages" ::: Ptr Image)
-> IO Result
vkGetSwapchainImagesKHR'
                                                            Ptr Device_T
device'
                                                            (SwapchainKHR
swapchain)
                                                            ("pSwapchainImageCount" ::: Ptr Flags
pPSwapchainImageCount)
                                                            (forall a. Ptr a
nullPtr))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Flags
pSwapchainImageCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPSwapchainImageCount
  "pSwapchainImages" ::: Ptr Image
pPSwapchainImages <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Image ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Flags
pSwapchainImageCount)) forall a. Num a => a -> a -> a
* Int
8)) forall a. Ptr a -> IO ()
free
  Result
r' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetSwapchainImagesKHR" (Ptr Device_T
-> SwapchainKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pSwapchainImages" ::: Ptr Image)
-> IO Result
vkGetSwapchainImagesKHR'
                                                             Ptr Device_T
device'
                                                             (SwapchainKHR
swapchain)
                                                             ("pSwapchainImageCount" ::: Ptr Flags
pPSwapchainImageCount)
                                                             ("pSwapchainImages" ::: Ptr Image
pPSwapchainImages))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Flags
pSwapchainImageCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPSwapchainImageCount
  "swapchainImages" ::: Vector Image
pSwapchainImages' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Flags
pSwapchainImageCount')) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Image (("pSwapchainImages" ::: Ptr Image
pPSwapchainImages forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Image)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "swapchainImages" ::: Vector Image
pSwapchainImages')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkAcquireNextImageKHRUnsafe
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result) -> Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result

foreign import ccall
  "dynamic" mkVkAcquireNextImageKHRSafe
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result) -> Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result

-- | acquireNextImageKHR with selectable safeness
acquireNextImageKHRSafeOrUnsafe :: forall io
                                 . (MonadIO io)
                                => (FunPtr (Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result) -> Ptr Device_T -> SwapchainKHR -> Word64 -> Semaphore -> Fence -> Ptr Word32 -> IO Result)
                                -> -- | @device@ is the device associated with @swapchain@.
                                   Device
                                -> -- | @swapchain@ is the non-retired swapchain from which an image is being
                                   -- acquired.
                                   SwapchainKHR
                                -> -- | @timeout@ specifies how long the function waits, in nanoseconds, if no
                                   -- image is available.
                                   ("timeout" ::: Word64)
                                -> -- | @semaphore@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a semaphore
                                   -- to signal.
                                   Semaphore
                                -> -- | @fence@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a fence to
                                   -- signal.
                                   Fence
                                -> io (Result, ("imageIndex" ::: Word32))
acquireNextImageKHRSafeOrUnsafe :: forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> SwapchainKHR
    -> Word64
    -> Semaphore
    -> Fence
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> SwapchainKHR
 -> Word64
 -> Semaphore
 -> Fence
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> io (Result, Flags)
acquireNextImageKHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImageKHR Device
device
                                                          SwapchainKHR
swapchain
                                                          Word64
timeout
                                                          Semaphore
semaphore
                                                          Fence
fence = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkAcquireNextImageKHRPtr :: FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImageKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> Word64
      -> Semaphore
      -> Fence
      -> ("pSwapchainImageCount" ::: Ptr Flags)
      -> IO Result)
pVkAcquireNextImageKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImageKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkAcquireNextImageKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkAcquireNextImageKHR' :: Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
vkAcquireNextImageKHR' = FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImageKHR FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImageKHRPtr
  "pSwapchainImageCount" ::: Ptr Flags
pPImageIndex <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkAcquireNextImageKHR" (Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
vkAcquireNextImageKHR'
                                                          (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                          (SwapchainKHR
swapchain)
                                                          (Word64
timeout)
                                                          (Semaphore
semaphore)
                                                          (Fence
fence)
                                                          ("pSwapchainImageCount" ::: Ptr Flags
pPImageIndex))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Flags
pImageIndex <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPImageIndex
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Result
r, Flags
pImageIndex)

-- | vkAcquireNextImageKHR - Retrieve the index of the next available
-- presentable image
--
-- = Description
--
-- If the @swapchain@ has been created with the
-- 'SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT' flag, the image
-- whose index is returned in @pImageIndex@ will be fully backed by memory
-- before this call returns to the application, as if it is bound
-- completely and contiguously to a single
-- 'Vulkan.Core10.Handles.DeviceMemory' object.
--
-- == Valid Usage
--
-- -   #VUID-vkAcquireNextImageKHR-swapchain-01285# @swapchain@ /must/ not
--     be in the retired state
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-01286# If @semaphore@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ be unsignaled
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-01779# If @semaphore@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ not have any
--     uncompleted signal or wait operations pending
--
-- -   #VUID-vkAcquireNextImageKHR-fence-01287# If @fence@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ be unsignaled and
--     /must/ not be associated with any other queue command that has not
--     yet completed execution on that queue
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-01780# @semaphore@ and @fence@
--     /must/ not both be equal to 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkAcquireNextImageKHR-surface-07783# If
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#swapchain-acquire-forward-progress forward progress>
--     cannot be guaranteed for the @surface@ used to create the
--     @swapchain@ member of @pAcquireInfo@, the @timeout@ member of
--     @pAcquireInfo@ /must/ not be @UINT64_MAX@
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-03265# @semaphore@ /must/ have
--     a 'Vulkan.Core12.Enums.SemaphoreType.SemaphoreType' of
--     'Vulkan.Core12.Enums.SemaphoreType.SEMAPHORE_TYPE_BINARY'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkAcquireNextImageKHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkAcquireNextImageKHR-swapchain-parameter# @swapchain@ /must/
--     be a valid 'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-parameter# If @semaphore@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @semaphore@ /must/ be
--     a valid 'Vulkan.Core10.Handles.Semaphore' handle
--
-- -   #VUID-vkAcquireNextImageKHR-fence-parameter# If @fence@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @fence@ /must/ be a valid
--     'Vulkan.Core10.Handles.Fence' handle
--
-- -   #VUID-vkAcquireNextImageKHR-pImageIndex-parameter# @pImageIndex@
--     /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkAcquireNextImageKHR-swapchain-parent# @swapchain@ /must/
--     have been created, allocated, or retrieved from @device@
--
-- -   #VUID-vkAcquireNextImageKHR-semaphore-parent# If @semaphore@ is a
--     valid handle, it /must/ have been created, allocated, or retrieved
--     from @device@
--
-- -   #VUID-vkAcquireNextImageKHR-fence-parent# If @fence@ is a valid
--     handle, it /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /must/ be externally synchronized
--
-- -   Host access to @semaphore@ /must/ be externally synchronized
--
-- -   Host access to @fence@ /must/ be externally synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.TIMEOUT'
--
--     -   'Vulkan.Core10.Enums.Result.NOT_READY'
--
--     -   'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Fence',
-- 'Vulkan.Core10.Handles.Semaphore',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
acquireNextImageKHR :: forall io
                     . (MonadIO io)
                    => -- | @device@ is the device associated with @swapchain@.
                       Device
                    -> -- | @swapchain@ is the non-retired swapchain from which an image is being
                       -- acquired.
                       SwapchainKHR
                    -> -- | @timeout@ specifies how long the function waits, in nanoseconds, if no
                       -- image is available.
                       ("timeout" ::: Word64)
                    -> -- | @semaphore@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a semaphore
                       -- to signal.
                       Semaphore
                    -> -- | @fence@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a fence to
                       -- signal.
                       Fence
                    -> io (Result, ("imageIndex" ::: Word32))
acquireNextImageKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> io (Result, Flags)
acquireNextImageKHR = forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> SwapchainKHR
    -> Word64
    -> Semaphore
    -> Fence
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> SwapchainKHR
 -> Word64
 -> Semaphore
 -> Fence
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> io (Result, Flags)
acquireNextImageKHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImageKHRUnsafe

-- | A variant of 'acquireNextImageKHR' which makes a *safe* FFI call
acquireNextImageKHRSafe :: forall io
                         . (MonadIO io)
                        => -- | @device@ is the device associated with @swapchain@.
                           Device
                        -> -- | @swapchain@ is the non-retired swapchain from which an image is being
                           -- acquired.
                           SwapchainKHR
                        -> -- | @timeout@ specifies how long the function waits, in nanoseconds, if no
                           -- image is available.
                           ("timeout" ::: Word64)
                        -> -- | @semaphore@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a semaphore
                           -- to signal.
                           Semaphore
                        -> -- | @fence@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a fence to
                           -- signal.
                           Fence
                        -> io (Result, ("imageIndex" ::: Word32))
acquireNextImageKHRSafe :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> io (Result, Flags)
acquireNextImageKHRSafe = forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> SwapchainKHR
    -> Word64
    -> Semaphore
    -> Fence
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> SwapchainKHR
 -> Word64
 -> Semaphore
 -> Fence
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> io (Result, Flags)
acquireNextImageKHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Word64
   -> Semaphore
   -> Fence
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Word64
-> Semaphore
-> Fence
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImageKHRSafe


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkQueuePresentKHR
  :: FunPtr (Ptr Queue_T -> Ptr (SomeStruct PresentInfoKHR) -> IO Result) -> Ptr Queue_T -> Ptr (SomeStruct PresentInfoKHR) -> 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
--
-- -   #VUID-vkQueuePresentKHR-pSwapchains-01292# Each element of
--     @pSwapchains@ member of @pPresentInfo@ /must/ be a swapchain that is
--     created for a surface for which presentation is supported from
--     @queue@ as determined using a call to
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR'
--
-- -   #VUID-vkQueuePresentKHR-pSwapchains-01293# If more than one member
--     of @pSwapchains@ was created from a display surface, all display
--     surfaces referenced that refer to the same display /must/ use the
--     same display mode
--
-- -   #VUID-vkQueuePresentKHR-pWaitSemaphores-01294# When a semaphore wait
--     operation referring to a binary semaphore defined by the elements of
--     the @pWaitSemaphores@ member of @pPresentInfo@ executes on @queue@,
--     there /must/ be no other queues waiting on the same semaphore
--
-- -   #VUID-vkQueuePresentKHR-pWaitSemaphores-03267# All elements of the
--     @pWaitSemaphores@ member of @pPresentInfo@ /must/ be created with a
--     'Vulkan.Core12.Enums.SemaphoreType.SemaphoreType' of
--     'Vulkan.Core12.Enums.SemaphoreType.SEMAPHORE_TYPE_BINARY'
--
-- -   #VUID-vkQueuePresentKHR-pWaitSemaphores-03268# All elements of the
--     @pWaitSemaphores@ member of @pPresentInfo@ /must/ reference a
--     semaphore signal operation that has been submitted for execution and
--     any
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-semaphores-signaling 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 'Vulkan.Core10.Handles.Image' at coordinates
-- (0,0) would appear at the upper left pixel of the platform surface
-- (assuming
-- 'Vulkan.Extensions.VK_KHR_surface.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
-- 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY' or
-- 'Vulkan.Core10.Enums.Result.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
-- 'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST'.
--
-- However, if the presentation request is rejected by the presentation
-- engine with an error 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR',
-- 'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT',
-- or 'Vulkan.Core10.Enums.Result.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.
--
-- Calls to 'queuePresentKHR' /may/ block, but /must/ return in finite
-- time.
--
-- If any @swapchain@ member of @pPresentInfo@ was created with
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT',
-- 'Vulkan.Core10.Enums.Result.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)
--
-- -   #VUID-vkQueuePresentKHR-queue-parameter# @queue@ /must/ be a valid
--     'Vulkan.Core10.Handles.Queue' handle
--
-- -   #VUID-vkQueuePresentKHR-pPresentInfo-parameter# @pPresentInfo@
--     /must/ be a valid pointer to a valid 'PresentInfoKHR' structure
--
-- == Host Synchronization
--
-- -   Host access to @queue@ /must/ be externally synchronized
--
-- -   Host access to @pPresentInfo->pWaitSemaphores@[] /must/ be
--     externally synchronized
--
-- -   Host access to @pPresentInfo->pSwapchains@[] /must/ be externally
--     synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | -                                                                                                                          | -                                                                                                                      | -                                                                                                                           | Any                                                                                                                   | -                                                                                                                                      |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'PresentInfoKHR', 'Vulkan.Core10.Handles.Queue'
queuePresentKHR :: forall a io
                 . (Extendss PresentInfoKHR a, PokeChain a, MonadIO io)
                => -- | @queue@ is a queue that is capable of presentation to the target
                   -- surface’s platform on the same device as the image’s swapchain.
                   Queue
                -> -- | @pPresentInfo@ is a pointer to a 'PresentInfoKHR' structure specifying
                   -- parameters of the presentation.
                   (PresentInfoKHR a)
                -> io (Result)
queuePresentKHR :: forall (a :: [*]) (io :: * -> *).
(Extendss PresentInfoKHR a, PokeChain a, MonadIO io) =>
Queue -> PresentInfoKHR a -> io Result
queuePresentKHR Queue
queue PresentInfoKHR a
presentInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkQueuePresentKHRPtr :: FunPtr
  (Ptr Queue_T
   -> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
   -> IO Result)
vkQueuePresentKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Queue_T
      -> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
      -> IO Result)
pVkQueuePresentKHR (case Queue
queue of Queue{DeviceCmds
$sel:deviceCmds:Queue :: Queue -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Queue_T
   -> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
   -> IO Result)
vkQueuePresentKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkQueuePresentKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkQueuePresentKHR' :: Ptr Queue_T
-> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
-> IO Result
vkQueuePresentKHR' = FunPtr
  (Ptr Queue_T
   -> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
   -> IO Result)
-> Ptr Queue_T
-> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
-> IO Result
mkVkQueuePresentKHR FunPtr
  (Ptr Queue_T
   -> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
   -> IO Result)
vkQueuePresentKHRPtr
  Ptr (PresentInfoKHR a)
pPresentInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PresentInfoKHR a
presentInfo)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkQueuePresentKHR" (Ptr Queue_T
-> ("pPresentInfo" ::: Ptr (SomeStruct PresentInfoKHR))
-> IO Result
vkQueuePresentKHR'
                                                      (Queue -> Ptr Queue_T
queueHandle (Queue
queue))
                                                      (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PresentInfoKHR a)
pPresentInfo))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Result
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceGroupPresentCapabilitiesKHR
  :: FunPtr (Ptr Device_T -> Ptr DeviceGroupPresentCapabilitiesKHR -> IO Result) -> Ptr Device_T -> Ptr DeviceGroupPresentCapabilitiesKHR -> IO Result

-- | vkGetDeviceGroupPresentCapabilitiesKHR - Query present capabilities from
-- other physical devices
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceGroupPresentCapabilitiesKHR'
getDeviceGroupPresentCapabilitiesKHR :: forall io
                                      . (MonadIO io)
                                     => -- | @device@ is the logical device.
                                        --
                                        -- #VUID-vkGetDeviceGroupPresentCapabilitiesKHR-device-parameter# @device@
                                        -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                        Device
                                     -> io (DeviceGroupPresentCapabilitiesKHR)
getDeviceGroupPresentCapabilitiesKHR :: forall (io :: * -> *).
MonadIO io =>
Device -> io DeviceGroupPresentCapabilitiesKHR
getDeviceGroupPresentCapabilitiesKHR Device
device = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceGroupPresentCapabilitiesKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("pDeviceGroupPresentCapabilities"
       ::: Ptr DeviceGroupPresentCapabilitiesKHR)
   -> IO Result)
vkGetDeviceGroupPresentCapabilitiesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pDeviceGroupPresentCapabilities"
          ::: Ptr DeviceGroupPresentCapabilitiesKHR)
      -> IO Result)
pVkGetDeviceGroupPresentCapabilitiesKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pDeviceGroupPresentCapabilities"
       ::: Ptr DeviceGroupPresentCapabilitiesKHR)
   -> IO Result)
vkGetDeviceGroupPresentCapabilitiesKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDeviceGroupPresentCapabilitiesKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceGroupPresentCapabilitiesKHR' :: Ptr Device_T
-> ("pDeviceGroupPresentCapabilities"
    ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO Result
vkGetDeviceGroupPresentCapabilitiesKHR' = FunPtr
  (Ptr Device_T
   -> ("pDeviceGroupPresentCapabilities"
       ::: Ptr DeviceGroupPresentCapabilitiesKHR)
   -> IO Result)
-> Ptr Device_T
-> ("pDeviceGroupPresentCapabilities"
    ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO Result
mkVkGetDeviceGroupPresentCapabilitiesKHR FunPtr
  (Ptr Device_T
   -> ("pDeviceGroupPresentCapabilities"
       ::: Ptr DeviceGroupPresentCapabilitiesKHR)
   -> IO Result)
vkGetDeviceGroupPresentCapabilitiesKHRPtr
  "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
pPDeviceGroupPresentCapabilities <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @DeviceGroupPresentCapabilitiesKHR)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceGroupPresentCapabilitiesKHR" (Ptr Device_T
-> ("pDeviceGroupPresentCapabilities"
    ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO Result
vkGetDeviceGroupPresentCapabilitiesKHR'
                                                                           (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                           ("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
pPDeviceGroupPresentCapabilities))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  DeviceGroupPresentCapabilitiesKHR
pDeviceGroupPresentCapabilities <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DeviceGroupPresentCapabilitiesKHR "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
pPDeviceGroupPresentCapabilities
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DeviceGroupPresentCapabilitiesKHR
pDeviceGroupPresentCapabilities)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceGroupSurfacePresentModesKHR
  :: FunPtr (Ptr Device_T -> SurfaceKHR -> Ptr DeviceGroupPresentModeFlagsKHR -> IO Result) -> Ptr Device_T -> SurfaceKHR -> Ptr DeviceGroupPresentModeFlagsKHR -> IO Result

-- | 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
--
-- -   #VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-06212#
--     @surface@ /must/ be supported by all physical devices associated
--     with @device@, as reported by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR'
--     or an equivalent platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDeviceGroupSurfacePresentModesKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDeviceGroupSurfacePresentModesKHR-surface-parameter#
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter#
--     @pModes@ /must/ be a valid pointer to a
--     'DeviceGroupPresentModeFlagsKHR' value
--
-- -   #VUID-vkGetDeviceGroupSurfacePresentModesKHR-commonparent# Both of
--     @device@, and @surface@ /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Instance'
--
-- == Host Synchronization
--
-- -   Host access to @surface@ /must/ be externally synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceGroupPresentModeFlagsKHR',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getDeviceGroupSurfacePresentModesKHR :: forall io
                                      . (MonadIO io)
                                     => -- | @device@ is the logical device.
                                        Device
                                     -> -- | @surface@ is the surface.
                                        SurfaceKHR
                                     -> io (("modes" ::: DeviceGroupPresentModeFlagsKHR))
getDeviceGroupSurfacePresentModesKHR :: forall (io :: * -> *).
MonadIO io =>
Device -> SurfaceKHR -> io DeviceGroupPresentModeFlagBitsKHR
getDeviceGroupSurfacePresentModesKHR Device
device SurfaceKHR
surface = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceGroupSurfacePresentModesKHRPtr :: FunPtr
  (Ptr Device_T
   -> SurfaceKHR
   -> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
   -> IO Result)
vkGetDeviceGroupSurfacePresentModesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SurfaceKHR
      -> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
      -> IO Result)
pVkGetDeviceGroupSurfacePresentModesKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SurfaceKHR
   -> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
   -> IO Result)
vkGetDeviceGroupSurfacePresentModesKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDeviceGroupSurfacePresentModesKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceGroupSurfacePresentModesKHR' :: Ptr Device_T
-> SurfaceKHR
-> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO Result
vkGetDeviceGroupSurfacePresentModesKHR' = FunPtr
  (Ptr Device_T
   -> SurfaceKHR
   -> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
   -> IO Result)
-> Ptr Device_T
-> SurfaceKHR
-> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO Result
mkVkGetDeviceGroupSurfacePresentModesKHR FunPtr
  (Ptr Device_T
   -> SurfaceKHR
   -> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
   -> IO Result)
vkGetDeviceGroupSurfacePresentModesKHRPtr
  "pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR
pPModes <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @DeviceGroupPresentModeFlagsKHR Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceGroupSurfacePresentModesKHR" (Ptr Device_T
-> SurfaceKHR
-> ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO Result
vkGetDeviceGroupSurfacePresentModesKHR'
                                                                           (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                           (SurfaceKHR
surface)
                                                                           ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR
pPModes))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  DeviceGroupPresentModeFlagBitsKHR
pModes <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @DeviceGroupPresentModeFlagsKHR "pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR
pPModes
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DeviceGroupPresentModeFlagBitsKHR
pModes)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkAcquireNextImage2KHRUnsafe
  :: FunPtr (Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result) -> Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result

foreign import ccall
  "dynamic" mkVkAcquireNextImage2KHRSafe
  :: FunPtr (Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result) -> Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result

-- | acquireNextImage2KHR with selectable safeness
acquireNextImage2KHRSafeOrUnsafe :: forall io
                                  . (MonadIO io)
                                 => (FunPtr (Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result) -> Ptr Device_T -> Ptr AcquireNextImageInfoKHR -> Ptr Word32 -> IO Result)
                                 -> -- | @device@ is the device associated with @swapchain@.
                                    Device
                                 -> -- | @pAcquireInfo@ is a pointer to a 'AcquireNextImageInfoKHR' structure
                                    -- containing parameters of the acquire.
                                    ("acquireInfo" ::: AcquireNextImageInfoKHR)
                                 -> io (Result, ("imageIndex" ::: Word32))
acquireNextImage2KHRSafeOrUnsafe :: forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> Ptr AcquireNextImageInfoKHR
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> Ptr AcquireNextImageInfoKHR
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device -> AcquireNextImageInfoKHR -> io (Result, Flags)
acquireNextImage2KHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImage2KHR Device
device
                                                            AcquireNextImageInfoKHR
acquireInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkAcquireNextImage2KHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImage2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr AcquireNextImageInfoKHR
      -> ("pSwapchainImageCount" ::: Ptr Flags)
      -> IO Result)
pVkAcquireNextImage2KHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImage2KHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkAcquireNextImage2KHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkAcquireNextImage2KHR' :: Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
vkAcquireNextImage2KHR' = FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImage2KHR FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
vkAcquireNextImage2KHRPtr
  Ptr AcquireNextImageInfoKHR
pAcquireInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AcquireNextImageInfoKHR
acquireInfo)
  "pSwapchainImageCount" ::: Ptr Flags
pPImageIndex <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkAcquireNextImage2KHR" (Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
vkAcquireNextImage2KHR'
                                                           (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                           Ptr AcquireNextImageInfoKHR
pAcquireInfo
                                                           ("pSwapchainImageCount" ::: Ptr Flags
pPImageIndex))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Flags
pImageIndex <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPImageIndex
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Result
r, Flags
pImageIndex)

-- | vkAcquireNextImage2KHR - Retrieve the index of the next available
-- presentable image
--
-- = Description
--
-- If the @swapchain@ has been created with the
-- 'SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT' flag, the image
-- whose index is returned in @pImageIndex@ will be fully backed by memory
-- before this call returns to the application.
--
-- == Valid Usage
--
-- -   #VUID-vkAcquireNextImage2KHR-surface-07784# If
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#swapchain-acquire-forward-progress forward progress>
--     cannot be guaranteed for the @surface@ used to create @swapchain@,
--     the @timeout@ member of @pAcquireInfo@ /must/ not be @UINT64_MAX@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkAcquireNextImage2KHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter# @pAcquireInfo@
--     /must/ be a valid pointer to a valid 'AcquireNextImageInfoKHR'
--     structure
--
-- -   #VUID-vkAcquireNextImage2KHR-pImageIndex-parameter# @pImageIndex@
--     /must/ be a valid pointer to a @uint32_t@ value
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.TIMEOUT'
--
--     -   'Vulkan.Core10.Enums.Result.NOT_READY'
--
--     -   'Vulkan.Core10.Enums.Result.SUBOPTIMAL_KHR'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_DEVICE_LOST'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'AcquireNextImageInfoKHR', 'Vulkan.Core10.Handles.Device'
acquireNextImage2KHR :: forall io
                      . (MonadIO io)
                     => -- | @device@ is the device associated with @swapchain@.
                        Device
                     -> -- | @pAcquireInfo@ is a pointer to a 'AcquireNextImageInfoKHR' structure
                        -- containing parameters of the acquire.
                        ("acquireInfo" ::: AcquireNextImageInfoKHR)
                     -> io (Result, ("imageIndex" ::: Word32))
acquireNextImage2KHR :: forall (io :: * -> *).
MonadIO io =>
Device -> AcquireNextImageInfoKHR -> io (Result, Flags)
acquireNextImage2KHR = forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> Ptr AcquireNextImageInfoKHR
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> Ptr AcquireNextImageInfoKHR
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device -> AcquireNextImageInfoKHR -> io (Result, Flags)
acquireNextImage2KHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImage2KHRUnsafe

-- | A variant of 'acquireNextImage2KHR' which makes a *safe* FFI call
acquireNextImage2KHRSafe :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the device associated with @swapchain@.
                            Device
                         -> -- | @pAcquireInfo@ is a pointer to a 'AcquireNextImageInfoKHR' structure
                            -- containing parameters of the acquire.
                            ("acquireInfo" ::: AcquireNextImageInfoKHR)
                         -> io (Result, ("imageIndex" ::: Word32))
acquireNextImage2KHRSafe :: forall (io :: * -> *).
MonadIO io =>
Device -> AcquireNextImageInfoKHR -> io (Result, Flags)
acquireNextImage2KHRSafe = forall (io :: * -> *).
MonadIO io =>
(FunPtr
   (Ptr Device_T
    -> Ptr AcquireNextImageInfoKHR
    -> ("pSwapchainImageCount" ::: Ptr Flags)
    -> IO Result)
 -> Ptr Device_T
 -> Ptr AcquireNextImageInfoKHR
 -> ("pSwapchainImageCount" ::: Ptr Flags)
 -> IO Result)
-> Device -> AcquireNextImageInfoKHR -> io (Result, Flags)
acquireNextImage2KHRSafeOrUnsafe FunPtr
  (Ptr Device_T
   -> Ptr AcquireNextImageInfoKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> IO Result)
-> Ptr Device_T
-> Ptr AcquireNextImageInfoKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> IO Result
mkVkAcquireNextImage2KHRSafe


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDevicePresentRectanglesKHR
  :: FunPtr (Ptr PhysicalDevice_T -> SurfaceKHR -> Ptr Word32 -> Ptr Rect2D -> IO Result) -> Ptr PhysicalDevice_T -> SurfaceKHR -> Ptr Word32 -> Ptr Rect2D -> IO Result

-- | 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, and
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not all the
-- available rectangles 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
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-06523#
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-06211#
--     @surface@ /must/ be supported by @physicalDevice@, as reported by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR'
--     or an equivalent platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-surface-parameter#
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter#
--     @pRectCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter# If
--     the value referenced by @pRectCount@ is not @0@, and @pRects@ is not
--     @NULL@, @pRects@ /must/ be a valid pointer to an array of
--     @pRectCount@ 'Vulkan.Core10.FundamentalTypes.Rect2D' structures
--
-- -   #VUID-vkGetPhysicalDevicePresentRectanglesKHR-commonparent# Both of
--     @physicalDevice@, and @surface@ /must/ have been created, allocated,
--     or retrieved from the same 'Vulkan.Core10.Handles.Instance'
--
-- == Host Synchronization
--
-- -   Host access to @surface@ /must/ be externally synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Handles.PhysicalDevice',
-- 'Vulkan.Core10.FundamentalTypes.Rect2D',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getPhysicalDevicePresentRectanglesKHR :: forall io
                                       . (MonadIO io)
                                      => -- | @physicalDevice@ is the physical device.
                                         PhysicalDevice
                                      -> -- | @surface@ is the surface.
                                         SurfaceKHR
                                      -> io (Result, ("rects" ::: Vector Rect2D))
getPhysicalDevicePresentRectanglesKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> SurfaceKHR -> io (Result, "rects" ::: Vector Rect2D)
getPhysicalDevicePresentRectanglesKHR PhysicalDevice
physicalDevice
                                        SurfaceKHR
surface = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDevicePresentRectanglesKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pRects" ::: Ptr Rect2D)
   -> IO Result)
vkGetPhysicalDevicePresentRectanglesKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR
      -> ("pSwapchainImageCount" ::: Ptr Flags)
      -> ("pRects" ::: Ptr Rect2D)
      -> IO Result)
pVkGetPhysicalDevicePresentRectanglesKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pRects" ::: Ptr Rect2D)
   -> IO Result)
vkGetPhysicalDevicePresentRectanglesKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPhysicalDevicePresentRectanglesKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetPhysicalDevicePresentRectanglesKHR' :: Ptr PhysicalDevice_T
-> SurfaceKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pRects" ::: Ptr Rect2D)
-> IO Result
vkGetPhysicalDevicePresentRectanglesKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pRects" ::: Ptr Rect2D)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> SurfaceKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pRects" ::: Ptr Rect2D)
-> IO Result
mkVkGetPhysicalDevicePresentRectanglesKHR FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR
   -> ("pSwapchainImageCount" ::: Ptr Flags)
   -> ("pRects" ::: Ptr Rect2D)
   -> IO Result)
vkGetPhysicalDevicePresentRectanglesKHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  "pSwapchainImageCount" ::: Ptr Flags
pPRectCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDevicePresentRectanglesKHR" (Ptr PhysicalDevice_T
-> SurfaceKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pRects" ::: Ptr Rect2D)
-> IO Result
vkGetPhysicalDevicePresentRectanglesKHR'
                                                                            Ptr PhysicalDevice_T
physicalDevice'
                                                                            (SurfaceKHR
surface)
                                                                            ("pSwapchainImageCount" ::: Ptr Flags
pPRectCount)
                                                                            (forall a. Ptr a
nullPtr))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Flags
pRectCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPRectCount
  "pRects" ::: Ptr Rect2D
pPRects <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Rect2D ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Flags
pRectCount)) forall a. Num a => a -> a -> a
* Int
16)) forall a. Ptr a -> IO ()
free
  [()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pRects" ::: Ptr Rect2D
pPRects forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
16) :: Ptr Rect2D) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral (Flags
pRectCount)) forall a. Num a => a -> a -> a
- Int
1]
  Result
r' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDevicePresentRectanglesKHR" (Ptr PhysicalDevice_T
-> SurfaceKHR
-> ("pSwapchainImageCount" ::: Ptr Flags)
-> ("pRects" ::: Ptr Rect2D)
-> IO Result
vkGetPhysicalDevicePresentRectanglesKHR'
                                                                             Ptr PhysicalDevice_T
physicalDevice'
                                                                             (SurfaceKHR
surface)
                                                                             ("pSwapchainImageCount" ::: Ptr Flags
pPRectCount)
                                                                             (("pRects" ::: Ptr Rect2D
pPRects)))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Flags
pRectCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSwapchainImageCount" ::: Ptr Flags
pPRectCount
  "rects" ::: Vector Rect2D
pRects' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Flags
pRectCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Rect2D ((("pRects" ::: Ptr Rect2D
pPRects) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "rects" ::: Vector Rect2D
pRects')


-- | VkSwapchainCreateInfoKHR - Structure specifying parameters of a newly
-- created swapchain object
--
-- = Description
--
-- Upon calling 'createSwapchainKHR' with an @oldSwapchain@ that is not
-- 'Vulkan.Core10.APIConstants.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
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE'.
--
-- Upon calling 'createSwapchainKHR' with an @oldSwapchain@ that is not
-- 'Vulkan.Core10.APIConstants.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
-- 'Vulkan.Extensions.Handles.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
-- 'Vulkan.Core10.Enums.Result.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 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'.
--
-- == Valid Usage
--
-- -   #VUID-VkSwapchainCreateInfoKHR-surface-01270# @surface@ /must/ be a
--     surface that is supported by the device as determined using
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-minImageCount-01272# @minImageCount@
--     /must/ be less than or equal to the value returned in the
--     @maxImageCount@ member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface if the returned @maxImageCount@ is not zero
--
-- -   #VUID-VkSwapchainCreateInfoKHR-presentMode-02839# If @presentMode@
--     is not
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR'
--     nor
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR',
--     then @minImageCount@ /must/ be greater than or equal to the value
--     returned in the @minImageCount@ member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-minImageCount-01383# @minImageCount@
--     /must/ be @1@ if @presentMode@ is either
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageFormat-01273# @imageFormat@ and
--     @imageColorSpace@ /must/ match the @format@ and @colorSpace@
--     members, respectively, of one of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceFormatKHR' structures
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceFormatsKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-07781# If a
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT'
--     structure was not included in the @pNext@ chain, or it is included
--     and
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT'::@scalingBehavior@
--     is zero then @imageExtent@ /must/ be between @minImageExtent@ and
--     @maxImageExtent@, inclusive, where @minImageExtent@ and
--     @maxImageExtent@ are members of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-07782# If a
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT'
--     structure was included in the @pNext@ chain and
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT'::@scalingBehavior@
--     is not zero then @imageExtent@ /must/ be between
--     @minScaledImageExtent@ and @maxScaledImageExtent@, inclusive, where
--     @minScaledImageExtent@ and @maxScaledImageExtent@ are members of the
--     'Vulkan.Extensions.VK_EXT_surface_maintenance1.SurfacePresentScalingCapabilitiesEXT'
--     structure returned by
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR'
--     for the surface and @presentMode@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageExtent-01689# @imageExtent@
--     members @width@ and @height@ /must/ both be non-zero
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275#
--     @imageArrayLayers@ /must/ be greater than @0@ and less than or equal
--     to the @maxImageArrayLayers@ member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-presentMode-01427# If @presentMode@
--     is 'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_IMMEDIATE_KHR',
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_MAILBOX_KHR',
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_FIFO_KHR' or
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_FIFO_RELAXED_KHR',
--     @imageUsage@ /must/ be a subset of the supported usage flags present
--     in the @supportedUsageFlags@ member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for @surface@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageUsage-01384# If @presentMode@ is
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR',
--     @imageUsage@ /must/ be a subset of the supported usage flags present
--     in the @sharedPresentSupportedUsageFlags@ member of the
--     'Vulkan.Extensions.VK_KHR_shared_presentable_image.SharedPresentSurfaceCapabilitiesKHR'
--     structure returned by
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR'
--     for @surface@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01277# If
--     @imageSharingMode@ is
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_CONCURRENT',
--     @pQueueFamilyIndices@ /must/ be a valid pointer to an array of
--     @queueFamilyIndexCount@ @uint32_t@ values
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01278# If
--     @imageSharingMode@ is
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_CONCURRENT',
--     @queueFamilyIndexCount@ /must/ be greater than @1@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageSharingMode-01428# If
--     @imageSharingMode@ is
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_CONCURRENT', each
--     element of @pQueueFamilyIndices@ /must/ be unique and /must/ be less
--     than @pQueueFamilyPropertyCount@ returned by either
--     'Vulkan.Core10.DeviceInitialization.getPhysicalDeviceQueueFamilyProperties'
--     or
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceQueueFamilyProperties2'
--     for the @physicalDevice@ that was used to create @device@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-preTransform-01279# @preTransform@
--     /must/ be one of the bits present in the @supportedTransforms@
--     member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-compositeAlpha-01280#
--     @compositeAlpha@ /must/ be one of the bits present in the
--     @supportedCompositeAlpha@ member of the
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceCapabilitiesKHR' structure
--     returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-presentMode-01281# @presentMode@
--     /must/ be one of the
--     'Vulkan.Extensions.VK_KHR_surface.PresentModeKHR' values returned by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfacePresentModesKHR'
--     for the surface
--
-- -   #VUID-VkSwapchainCreateInfoKHR-physicalDeviceCount-01429# If the
--     logical device was created with
--     'Vulkan.Core11.Promoted_From_VK_KHR_device_group_creation.DeviceGroupDeviceCreateInfo'::@physicalDeviceCount@
--     equal to 1, @flags@ /must/ not contain
--     'SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933# If @oldSwapchain@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @oldSwapchain@
--     /must/ be a non-retired swapchain associated with native window
--     referred to by @surface@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageFormat-01778# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#swapchain-wsi-image-create-info implied image creation parameters>
--     of the swapchain /must/ be supported as reported by
--     'Vulkan.Core10.DeviceInitialization.getPhysicalDeviceImageFormatProperties'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-flags-03168# If @flags@ contains
--     'SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR' then the @pNext@ chain
--     /must/ include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'
--     structure with a @viewFormatCount@ greater than zero and
--     @pViewFormats@ /must/ have an element equal to @imageFormat@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-04099# If a
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'
--     structure was included in the @pNext@ chain and
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'::@viewFormatCount@
--     is not zero then all of the formats in
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'::@pViewFormats@
--     /must/ be compatible with the @format@ as described in the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-compatibility compatibility table>
--
-- -   #VUID-VkSwapchainCreateInfoKHR-flags-04100# If @flags@ does not
--     contain 'SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR' and the @pNext@
--     chain include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'
--     structure then
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'::@viewFormatCount@
--     /must/ be @0@ or @1@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-flags-03187# If @flags@ contains
--     'SWAPCHAIN_CREATE_PROTECTED_BIT_KHR', then
--     'Vulkan.Extensions.VK_KHR_surface_protected_capabilities.SurfaceProtectedCapabilitiesKHR'::@supportsProtected@
--     /must/ be 'Vulkan.Core10.FundamentalTypes.TRUE' in the
--     'Vulkan.Extensions.VK_KHR_surface_protected_capabilities.SurfaceProtectedCapabilitiesKHR'
--     structure returned by
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR'
--     for @surface@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-02679# If the @pNext@ chain
--     includes a
--     'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveInfoEXT'
--     structure with its @fullScreenExclusive@ member set to
--     'Vulkan.Extensions.VK_EXT_full_screen_exclusive.FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT',
--     and @surface@ was created using
--     'Vulkan.Extensions.VK_KHR_win32_surface.createWin32SurfaceKHR', a
--     'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveWin32InfoEXT'
--     structure /must/ be included in the @pNext@ chain
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-06752# If the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-imageCompressionControlSwapchain imageCompressionControlSwapchain>
--     feature is not enabled, the @pNext@ chain /must/ not include an
--     'Vulkan.Extensions.VK_EXT_image_compression_control.ImageCompressionControlEXT'
--     structure
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSwapchainCreateInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-pNext-pNext# Each @pNext@ member of
--     any structure (including this one) in the @pNext@ chain /must/ be
--     either @NULL@ or a pointer to a valid instance of
--     'DeviceGroupSwapchainCreateInfoKHR',
--     'Vulkan.Extensions.VK_EXT_image_compression_control.ImageCompressionControlEXT',
--     'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo',
--     'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveInfoEXT',
--     'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveWin32InfoEXT',
--     'Vulkan.Extensions.VK_EXT_display_control.SwapchainCounterCreateInfoEXT',
--     'Vulkan.Extensions.VK_AMD_display_native_hdr.SwapchainDisplayNativeHdrCreateInfoAMD',
--     'Vulkan.Extensions.VK_NV_low_latency2.SwapchainLatencyCreateInfoNV',
--     'Vulkan.Extensions.VK_NV_present_barrier.SwapchainPresentBarrierCreateInfoNV',
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentModesCreateInfoEXT',
--     or
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT'
--
-- -   #VUID-VkSwapchainCreateInfoKHR-sType-unique# The @sType@ value of
--     each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkSwapchainCreateInfoKHR-flags-parameter# @flags@ /must/ be a
--     valid combination of 'SwapchainCreateFlagBitsKHR' values
--
-- -   #VUID-VkSwapchainCreateInfoKHR-surface-parameter# @surface@ /must/
--     be a valid 'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter# @imageFormat@
--     /must/ be a valid 'Vulkan.Core10.Enums.Format.Format' value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter#
--     @imageColorSpace@ /must/ be a valid
--     'Vulkan.Extensions.VK_KHR_surface.ColorSpaceKHR' value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter# @imageUsage@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits' values
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask#
--     @imageUsage@ /must/ not be @0@
--
-- -   #VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter#
--     @imageSharingMode@ /must/ be a valid
--     'Vulkan.Core10.Enums.SharingMode.SharingMode' value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-preTransform-parameter#
--     @preTransform@ /must/ be a valid
--     'Vulkan.Extensions.VK_KHR_surface.SurfaceTransformFlagBitsKHR' value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter#
--     @compositeAlpha@ /must/ be a valid
--     'Vulkan.Extensions.VK_KHR_surface.CompositeAlphaFlagBitsKHR' value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-presentMode-parameter# @presentMode@
--     /must/ be a valid 'Vulkan.Extensions.VK_KHR_surface.PresentModeKHR'
--     value
--
-- -   #VUID-VkSwapchainCreateInfoKHR-oldSwapchain-parameter# If
--     @oldSwapchain@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @oldSwapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-VkSwapchainCreateInfoKHR-commonparent# Both of @oldSwapchain@,
--     and @surface@ that are valid handles of non-ignored parameters
--     /must/ have been created, allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Instance'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Extensions.VK_KHR_surface.ColorSpaceKHR',
-- 'Vulkan.Extensions.VK_KHR_surface.CompositeAlphaFlagBitsKHR',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlags',
-- 'Vulkan.Extensions.VK_KHR_surface.PresentModeKHR',
-- 'Vulkan.Core10.Enums.SharingMode.SharingMode',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SurfaceKHR',
-- 'Vulkan.Extensions.VK_KHR_surface.SurfaceTransformFlagBitsKHR',
-- 'SwapchainCreateFlagsKHR', 'Vulkan.Extensions.Handles.SwapchainKHR',
-- 'Vulkan.Extensions.VK_KHR_display_swapchain.createSharedSwapchainsKHR',
-- 'createSwapchainKHR'
data SwapchainCreateInfoKHR (es :: [Type]) = SwapchainCreateInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of 'SwapchainCreateFlagBitsKHR' indicating
    -- parameters of the swapchain creation.
    forall (es :: [*]).
SwapchainCreateInfoKHR es -> SwapchainCreateFlagBitsKHR
flags :: SwapchainCreateFlagsKHR
  , -- | @surface@ is the surface onto which the swapchain will present images.
    -- If the creation succeeds, the swapchain becomes associated with
    -- @surface@.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> SurfaceKHR
surface :: SurfaceKHR
  , -- | @minImageCount@ is the minimum number of presentable images that the
    -- application needs. The implementation will either create the swapchain
    -- with at least that many images, or it will fail to create the swapchain.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
minImageCount :: Word32
  , -- | @imageFormat@ is a 'Vulkan.Core10.Enums.Format.Format' value specifying
    -- the format the swapchain image(s) will be created with.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Format
imageFormat :: Format
  , -- | @imageColorSpace@ is a 'Vulkan.Extensions.VK_KHR_surface.ColorSpaceKHR'
    -- value specifying the way the swapchain interprets image data.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> ColorSpaceKHR
imageColorSpace :: ColorSpaceKHR
  , -- | @imageExtent@ is the size (in pixels) of the swapchain image(s). The
    -- behavior is platform-dependent if the image extent does not match the
    -- surface’s @currentExtent@ as returned by
    -- 'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR'.
    --
    -- Note
    --
    -- On some platforms, it is normal that @maxImageExtent@ /may/ become
    -- @(0, 0)@, for example when the window is minimized. In such a case, it
    -- is not possible to create a swapchain due to the Valid Usage
    -- requirements , unless scaling is selected through
    -- 'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentScalingCreateInfoEXT',
    -- if supported .
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Extent2D
imageExtent :: Extent2D
  , -- | @imageArrayLayers@ is the number of views in a multiview\/stereo
    -- surface. For non-stereoscopic-3D applications, this value is 1.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
imageArrayLayers :: Word32
  , -- | @imageUsage@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits' describing
    -- the intended usage of the (acquired) swapchain images.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> ImageUsageFlags
imageUsage :: ImageUsageFlags
  , -- | @imageSharingMode@ is the sharing mode used for the image(s) of the
    -- swapchain.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> SharingMode
imageSharingMode :: SharingMode
  , -- | @pQueueFamilyIndices@ is a pointer to an array of queue family indices
    -- having access to the images(s) of the swapchain when @imageSharingMode@
    -- is 'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_CONCURRENT'.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Vector Flags
queueFamilyIndices :: Vector Word32
  , -- | @preTransform@ is a
    -- 'Vulkan.Extensions.VK_KHR_surface.SurfaceTransformFlagBitsKHR' value
    -- describing the transform, relative to the presentation engine’s natural
    -- orientation, applied to the image content prior to presentation. If it
    -- does not match the @currentTransform@ value returned by
    -- 'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceCapabilitiesKHR',
    -- the presentation engine will transform the image content as part of the
    -- presentation operation.
    forall (es :: [*]).
SwapchainCreateInfoKHR es -> SurfaceTransformFlagBitsKHR
preTransform :: SurfaceTransformFlagBitsKHR
  , -- | @compositeAlpha@ is a
    -- 'Vulkan.Extensions.VK_KHR_surface.CompositeAlphaFlagBitsKHR' value
    -- indicating the alpha compositing mode to use when this surface is
    -- composited together with other surfaces on certain window systems.
    forall (es :: [*]).
SwapchainCreateInfoKHR es -> CompositeAlphaFlagBitsKHR
compositeAlpha :: CompositeAlphaFlagBitsKHR
  , -- | @presentMode@ is the presentation mode the swapchain will use. A
    -- swapchain’s present mode determines how incoming present requests will
    -- be processed and queued internally.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> PresentModeKHR
presentMode :: PresentModeKHR
  , -- | @clipped@ specifies whether the Vulkan implementation is allowed to
    -- discard rendering operations that affect regions of the surface that are
    -- not visible.
    --
    -- -   If set to 'Vulkan.Core10.FundamentalTypes.TRUE', the presentable
    --     images associated with the swapchain /may/ not own all of their
    --     pixels. Pixels in the presentable images that correspond to regions
    --     of the target surface obscured by another window on the desktop, or
    --     subject to some other clipping mechanism will have undefined content
    --     when read back. Fragment shaders /may/ not execute for these pixels,
    --     and thus any side effects they would have had will not occur.
    --     Setting 'Vulkan.Core10.FundamentalTypes.TRUE' does not guarantee any
    --     clipping will occur, but allows more efficient presentation methods
    --     to be used on some platforms.
    --
    -- -   If set to 'Vulkan.Core10.FundamentalTypes.FALSE', presentable images
    --     associated with the swapchain will own all of the pixels they
    --     contain.
    --
    --     Note
    --
    --     Applications /should/ set this value to
    --     'Vulkan.Core10.FundamentalTypes.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.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> Bool
clipped :: Bool
  , -- | @oldSwapchain@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE', or the
    -- existing non-retired swapchain currently associated with @surface@.
    -- Providing a valid @oldSwapchain@ /may/ aid in the resource reuse, and
    -- also allows the application to still present any images that are already
    -- acquired from it.
    forall (es :: [*]). SwapchainCreateInfoKHR es -> SwapchainKHR
oldSwapchain :: SwapchainKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainCreateInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SwapchainCreateInfoKHR es)

instance Extensible SwapchainCreateInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"SwapchainCreateInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
SwapchainCreateInfoKHR ds -> Chain es -> SwapchainCreateInfoKHR es
setNext SwapchainCreateInfoKHR{Bool
Flags
Vector Flags
Chain ds
Format
ImageUsageFlags
Extent2D
SwapchainKHR
SurfaceKHR
PresentModeKHR
SharingMode
SurfaceTransformFlagBitsKHR
CompositeAlphaFlagBitsKHR
ColorSpaceKHR
SwapchainCreateFlagBitsKHR
oldSwapchain :: SwapchainKHR
clipped :: Bool
presentMode :: PresentModeKHR
compositeAlpha :: CompositeAlphaFlagBitsKHR
preTransform :: SurfaceTransformFlagBitsKHR
queueFamilyIndices :: Vector Flags
imageSharingMode :: SharingMode
imageUsage :: ImageUsageFlags
imageArrayLayers :: Flags
imageExtent :: Extent2D
imageColorSpace :: ColorSpaceKHR
imageFormat :: Format
minImageCount :: Flags
surface :: SurfaceKHR
flags :: SwapchainCreateFlagBitsKHR
next :: Chain ds
$sel:oldSwapchain:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SwapchainKHR
$sel:clipped:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Bool
$sel:presentMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> PresentModeKHR
$sel:compositeAlpha:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> CompositeAlphaFlagBitsKHR
$sel:preTransform:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SurfaceTransformFlagBitsKHR
$sel:queueFamilyIndices:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Vector Flags
$sel:imageSharingMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SharingMode
$sel:imageUsage:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ImageUsageFlags
$sel:imageArrayLayers:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:imageExtent:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Extent2D
$sel:imageColorSpace:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ColorSpaceKHR
$sel:imageFormat:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Format
$sel:minImageCount:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:surface:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SurfaceKHR
$sel:flags:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SwapchainCreateFlagBitsKHR
$sel:next:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Chain es
..} Chain es
next' = SwapchainCreateInfoKHR{$sel:next:SwapchainCreateInfoKHR :: Chain es
next = Chain es
next', Bool
Flags
Vector Flags
Format
ImageUsageFlags
Extent2D
SwapchainKHR
SurfaceKHR
PresentModeKHR
SharingMode
SurfaceTransformFlagBitsKHR
CompositeAlphaFlagBitsKHR
ColorSpaceKHR
SwapchainCreateFlagBitsKHR
oldSwapchain :: SwapchainKHR
clipped :: Bool
presentMode :: PresentModeKHR
compositeAlpha :: CompositeAlphaFlagBitsKHR
preTransform :: SurfaceTransformFlagBitsKHR
queueFamilyIndices :: Vector Flags
imageSharingMode :: SharingMode
imageUsage :: ImageUsageFlags
imageArrayLayers :: Flags
imageExtent :: Extent2D
imageColorSpace :: ColorSpaceKHR
imageFormat :: Format
minImageCount :: Flags
surface :: SurfaceKHR
flags :: SwapchainCreateFlagBitsKHR
$sel:oldSwapchain:SwapchainCreateInfoKHR :: SwapchainKHR
$sel:clipped:SwapchainCreateInfoKHR :: Bool
$sel:presentMode:SwapchainCreateInfoKHR :: PresentModeKHR
$sel:compositeAlpha:SwapchainCreateInfoKHR :: CompositeAlphaFlagBitsKHR
$sel:preTransform:SwapchainCreateInfoKHR :: SurfaceTransformFlagBitsKHR
$sel:queueFamilyIndices:SwapchainCreateInfoKHR :: Vector Flags
$sel:imageSharingMode:SwapchainCreateInfoKHR :: SharingMode
$sel:imageUsage:SwapchainCreateInfoKHR :: ImageUsageFlags
$sel:imageArrayLayers:SwapchainCreateInfoKHR :: Flags
$sel:imageExtent:SwapchainCreateInfoKHR :: Extent2D
$sel:imageColorSpace:SwapchainCreateInfoKHR :: ColorSpaceKHR
$sel:imageFormat:SwapchainCreateInfoKHR :: Format
$sel:minImageCount:SwapchainCreateInfoKHR :: Flags
$sel:surface:SwapchainCreateInfoKHR :: SurfaceKHR
$sel:flags:SwapchainCreateInfoKHR :: SwapchainCreateFlagBitsKHR
..}
  getNext :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Chain es
getNext SwapchainCreateInfoKHR{Bool
Flags
Vector Flags
Chain es
Format
ImageUsageFlags
Extent2D
SwapchainKHR
SurfaceKHR
PresentModeKHR
SharingMode
SurfaceTransformFlagBitsKHR
CompositeAlphaFlagBitsKHR
ColorSpaceKHR
SwapchainCreateFlagBitsKHR
oldSwapchain :: SwapchainKHR
clipped :: Bool
presentMode :: PresentModeKHR
compositeAlpha :: CompositeAlphaFlagBitsKHR
preTransform :: SurfaceTransformFlagBitsKHR
queueFamilyIndices :: Vector Flags
imageSharingMode :: SharingMode
imageUsage :: ImageUsageFlags
imageArrayLayers :: Flags
imageExtent :: Extent2D
imageColorSpace :: ColorSpaceKHR
imageFormat :: Format
minImageCount :: Flags
surface :: SurfaceKHR
flags :: SwapchainCreateFlagBitsKHR
next :: Chain es
$sel:oldSwapchain:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SwapchainKHR
$sel:clipped:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Bool
$sel:presentMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> PresentModeKHR
$sel:compositeAlpha:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> CompositeAlphaFlagBitsKHR
$sel:preTransform:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SurfaceTransformFlagBitsKHR
$sel:queueFamilyIndices:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Vector Flags
$sel:imageSharingMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SharingMode
$sel:imageUsage:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ImageUsageFlags
$sel:imageArrayLayers:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:imageExtent:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Extent2D
$sel:imageColorSpace:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ColorSpaceKHR
$sel:imageFormat:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Format
$sel:minImageCount:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:surface:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SurfaceKHR
$sel:flags:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SwapchainCreateFlagBitsKHR
$sel:next:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SwapchainCreateInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SwapchainCreateInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainLatencyCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainLatencyCreateInfoNV = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainPresentScalingCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainPresentScalingCreateInfoEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainPresentModesCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainPresentModesCreateInfoEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: ImageCompressionControlEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ImageCompressionControlEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainPresentBarrierCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainPresentBarrierCreateInfoNV = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SurfaceFullScreenExclusiveWin32InfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SurfaceFullScreenExclusiveWin32InfoEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SurfaceFullScreenExclusiveInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SurfaceFullScreenExclusiveInfoEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: ImageFormatListCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ImageFormatListCreateInfo = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainDisplayNativeHdrCreateInfoAMD
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainDisplayNativeHdrCreateInfoAMD = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: DeviceGroupSwapchainCreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @DeviceGroupSwapchainCreateInfoKHR = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Just e :~: SwapchainCounterCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainCounterCreateInfoEXT = forall a. a -> Maybe a
Just Extends SwapchainCreateInfoKHR e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss SwapchainCreateInfoKHR es
         , PokeChain es ) => ToCStruct (SwapchainCreateInfoKHR es) where
  withCStruct :: forall b.
SwapchainCreateInfoKHR es
-> (Ptr (SwapchainCreateInfoKHR es) -> IO b) -> IO b
withCStruct SwapchainCreateInfoKHR es
x Ptr (SwapchainCreateInfoKHR es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
104 forall a b. (a -> b) -> a -> b
$ \Ptr (SwapchainCreateInfoKHR es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SwapchainCreateInfoKHR es)
p SwapchainCreateInfoKHR es
x (Ptr (SwapchainCreateInfoKHR es) -> IO b
f Ptr (SwapchainCreateInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (SwapchainCreateInfoKHR es)
-> SwapchainCreateInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (SwapchainCreateInfoKHR es)
p SwapchainCreateInfoKHR{Bool
Flags
Vector Flags
Chain es
Format
ImageUsageFlags
Extent2D
SwapchainKHR
SurfaceKHR
PresentModeKHR
SharingMode
SurfaceTransformFlagBitsKHR
CompositeAlphaFlagBitsKHR
ColorSpaceKHR
SwapchainCreateFlagBitsKHR
oldSwapchain :: SwapchainKHR
clipped :: Bool
presentMode :: PresentModeKHR
compositeAlpha :: CompositeAlphaFlagBitsKHR
preTransform :: SurfaceTransformFlagBitsKHR
queueFamilyIndices :: Vector Flags
imageSharingMode :: SharingMode
imageUsage :: ImageUsageFlags
imageArrayLayers :: Flags
imageExtent :: Extent2D
imageColorSpace :: ColorSpaceKHR
imageFormat :: Format
minImageCount :: Flags
surface :: SurfaceKHR
flags :: SwapchainCreateFlagBitsKHR
next :: Chain es
$sel:oldSwapchain:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SwapchainKHR
$sel:clipped:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Bool
$sel:presentMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> PresentModeKHR
$sel:compositeAlpha:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> CompositeAlphaFlagBitsKHR
$sel:preTransform:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SurfaceTransformFlagBitsKHR
$sel:queueFamilyIndices:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Vector Flags
$sel:imageSharingMode:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SharingMode
$sel:imageUsage:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ImageUsageFlags
$sel:imageArrayLayers:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:imageExtent:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Extent2D
$sel:imageColorSpace:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> ColorSpaceKHR
$sel:imageFormat:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Format
$sel:minImageCount:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Flags
$sel:surface:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> SurfaceKHR
$sel:flags:SwapchainCreateInfoKHR :: forall (es :: [*]).
SwapchainCreateInfoKHR es -> SwapchainCreateFlagBitsKHR
$sel:next:SwapchainCreateInfoKHR :: forall (es :: [*]). SwapchainCreateInfoKHR es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
    Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainCreateFlagsKHR)) (SwapchainCreateFlagBitsKHR
flags)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SurfaceKHR)) (SurfaceKHR
surface)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Flags
minImageCount)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
imageFormat)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ColorSpaceKHR)) (ColorSpaceKHR
imageColorSpace)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Extent2D)) (Extent2D
imageExtent)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Word32)) (Flags
imageArrayLayers)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageUsageFlags)) (ImageUsageFlags
imageUsage)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SharingMode)) (SharingMode
imageSharingMode)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Flags
queueFamilyIndices)) :: Word32))
    "pSwapchainImageCount" ::: Ptr Flags
pPQueueFamilyIndices' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector Flags
queueFamilyIndices)) forall a. Num a => a -> a -> a
* Int
4)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Flags
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pSwapchainImageCount" ::: Ptr Flags
pPQueueFamilyIndices' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Flags
e)) (Vector Flags
queueFamilyIndices)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr Word32))) ("pSwapchainImageCount" ::: Ptr Flags
pPQueueFamilyIndices')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr SurfaceTransformFlagBitsKHR)) (SurfaceTransformFlagBitsKHR
preTransform)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84 :: Ptr CompositeAlphaFlagBitsKHR)) (CompositeAlphaFlagBitsKHR
compositeAlpha)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr PresentModeKHR)) (PresentModeKHR
presentMode)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
clipped))
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr SwapchainKHR)) (SwapchainKHR
oldSwapchain)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
104
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (SwapchainCreateInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (SwapchainCreateInfoKHR es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
    Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SurfaceKHR)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ColorSpaceKHR)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Extent2D)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageUsageFlags)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SharingMode)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr SurfaceTransformFlagBitsKHR)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84 :: Ptr CompositeAlphaFlagBitsKHR)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr PresentModeKHR)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss SwapchainCreateInfoKHR es
         , PeekChain es ) => FromCStruct (SwapchainCreateInfoKHR es) where
  peekCStruct :: Ptr (SwapchainCreateInfoKHR es) -> IO (SwapchainCreateInfoKHR es)
peekCStruct Ptr (SwapchainCreateInfoKHR es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    SwapchainCreateFlagBitsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainCreateFlagsKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainCreateFlagsKHR))
    SurfaceKHR
surface <- forall a. Storable a => Ptr a -> IO a
peek @SurfaceKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SurfaceKHR))
    Flags
minImageCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    Format
imageFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format))
    ColorSpaceKHR
imageColorSpace <- forall a. Storable a => Ptr a -> IO a
peek @ColorSpaceKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ColorSpaceKHR))
    Extent2D
imageExtent <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Extent2D))
    Flags
imageArrayLayers <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Word32))
    ImageUsageFlags
imageUsage <- forall a. Storable a => Ptr a -> IO a
peek @ImageUsageFlags ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageUsageFlags))
    SharingMode
imageSharingMode <- forall a. Storable a => Ptr a -> IO a
peek @SharingMode ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SharingMode))
    Flags
queueFamilyIndexCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32))
    "pSwapchainImageCount" ::: Ptr Flags
pQueueFamilyIndices <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr Word32)))
    Vector Flags
pQueueFamilyIndices' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
queueFamilyIndexCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pSwapchainImageCount" ::: Ptr Flags
pQueueFamilyIndices forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    SurfaceTransformFlagBitsKHR
preTransform <- forall a. Storable a => Ptr a -> IO a
peek @SurfaceTransformFlagBitsKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr SurfaceTransformFlagBitsKHR))
    CompositeAlphaFlagBitsKHR
compositeAlpha <- forall a. Storable a => Ptr a -> IO a
peek @CompositeAlphaFlagBitsKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84 :: Ptr CompositeAlphaFlagBitsKHR))
    PresentModeKHR
presentMode <- forall a. Storable a => Ptr a -> IO a
peek @PresentModeKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr PresentModeKHR))
    Bool32
clipped <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr Bool32))
    SwapchainKHR
oldSwapchain <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR ((Ptr (SwapchainCreateInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr SwapchainKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> SwapchainCreateFlagBitsKHR
-> SurfaceKHR
-> Flags
-> Format
-> ColorSpaceKHR
-> Extent2D
-> Flags
-> ImageUsageFlags
-> SharingMode
-> Vector Flags
-> SurfaceTransformFlagBitsKHR
-> CompositeAlphaFlagBitsKHR
-> PresentModeKHR
-> Bool
-> SwapchainKHR
-> SwapchainCreateInfoKHR es
SwapchainCreateInfoKHR
             Chain es
next
             SwapchainCreateFlagBitsKHR
flags
             SurfaceKHR
surface
             Flags
minImageCount
             Format
imageFormat
             ColorSpaceKHR
imageColorSpace
             Extent2D
imageExtent
             Flags
imageArrayLayers
             ImageUsageFlags
imageUsage
             SharingMode
imageSharingMode
             Vector Flags
pQueueFamilyIndices'
             SurfaceTransformFlagBitsKHR
preTransform
             CompositeAlphaFlagBitsKHR
compositeAlpha
             PresentModeKHR
presentMode
             (Bool32 -> Bool
bool32ToBool Bool32
clipped)
             SwapchainKHR
oldSwapchain

instance es ~ '[] => Zero (SwapchainCreateInfoKHR es) where
  zero :: SwapchainCreateInfoKHR es
zero = forall (es :: [*]).
Chain es
-> SwapchainCreateFlagBitsKHR
-> SurfaceKHR
-> Flags
-> Format
-> ColorSpaceKHR
-> Extent2D
-> Flags
-> ImageUsageFlags
-> SharingMode
-> Vector Flags
-> SurfaceTransformFlagBitsKHR
-> CompositeAlphaFlagBitsKHR
-> PresentModeKHR
-> Bool
-> SwapchainKHR
-> SwapchainCreateInfoKHR es
SwapchainCreateInfoKHR
           ()
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | 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
-- 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PRESENT_SRC_KHR' layout,
-- or for a shared presentable image the
-- 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
-- layout.
--
-- Note
--
-- When transitioning the image to
-- 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR' or
-- 'Vulkan.Core10.Enums.ImageLayout.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
-- 'Vulkan.Core10.OtherTypes.ImageMemoryBarrier' /should/ be set to @0@,
-- and the @dstStageMask@ parameter /should/ be set to
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT'.
--
-- == Valid Usage
--
-- -   #VUID-VkPresentInfoKHR-pSwapchain-09231# Elements of @pSwapchain@
--     /must/ be unique
--
-- -   #VUID-VkPresentInfoKHR-pImageIndices-01430# Each element of
--     @pImageIndices@ /must/ be the index of a presentable image acquired
--     from the swapchain specified by the corresponding element of the
--     @pSwapchains@ array, and the presented image subresource /must/ be
--     in the
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PRESENT_SRC_KHR' or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
--     layout at the time the operation is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkPresentInfoKHR-pNext-06235# If a
--     'Vulkan.Extensions.VK_KHR_present_id.PresentIdKHR' structure is
--     included in the @pNext@ chain, and the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-presentId presentId>
--     feature is not enabled, each @presentIds@ entry in that structure
--     /must/ be NULL
--
-- -   #VUID-VkPresentInfoKHR-pSwapchains-09199# If any element of the
--     @pSwapchains@ array has been created with
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentModesCreateInfoEXT',
--     all of the elements of this array /must/ be created with
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentModesCreateInfoEXT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPresentInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_INFO_KHR'
--
-- -   #VUID-VkPresentInfoKHR-pNext-pNext# Each @pNext@ member of any
--     structure (including this one) in the @pNext@ chain /must/ be either
--     @NULL@ or a pointer to a valid instance of
--     'DeviceGroupPresentInfoKHR',
--     'Vulkan.Extensions.VK_KHR_display_swapchain.DisplayPresentInfoKHR',
--     'Vulkan.Extensions.VK_EXT_frame_boundary.FrameBoundaryEXT',
--     'Vulkan.Extensions.VK_GGP_frame_token.PresentFrameTokenGGP',
--     'Vulkan.Extensions.VK_KHR_present_id.PresentIdKHR',
--     'Vulkan.Extensions.VK_KHR_incremental_present.PresentRegionsKHR',
--     'Vulkan.Extensions.VK_GOOGLE_display_timing.PresentTimesInfoGOOGLE',
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentFenceInfoEXT',
--     or
--     'Vulkan.Extensions.VK_EXT_swapchain_maintenance1.SwapchainPresentModeInfoEXT'
--
-- -   #VUID-VkPresentInfoKHR-sType-unique# The @sType@ value of each
--     struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPresentInfoKHR-pWaitSemaphores-parameter# If
--     @waitSemaphoreCount@ is not @0@, @pWaitSemaphores@ /must/ be a valid
--     pointer to an array of @waitSemaphoreCount@ valid
--     'Vulkan.Core10.Handles.Semaphore' handles
--
-- -   #VUID-VkPresentInfoKHR-pSwapchains-parameter# @pSwapchains@ /must/
--     be a valid pointer to an array of @swapchainCount@ valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handles
--
-- -   #VUID-VkPresentInfoKHR-pImageIndices-parameter# @pImageIndices@
--     /must/ be a valid pointer to an array of @swapchainCount@ @uint32_t@
--     values
--
-- -   #VUID-VkPresentInfoKHR-pResults-parameter# If @pResults@ is not
--     @NULL@, @pResults@ /must/ be a valid pointer to an array of
--     @swapchainCount@ 'Vulkan.Core10.Enums.Result.Result' values
--
-- -   #VUID-VkPresentInfoKHR-swapchainCount-arraylength# @swapchainCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkPresentInfoKHR-commonparent# Both of the elements of
--     @pSwapchains@, and the elements of @pWaitSemaphores@ that are valid
--     handles of non-ignored parameters /must/ have been created,
--     allocated, or retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'Vulkan.Core10.Enums.Result.Result', 'Vulkan.Core10.Handles.Semaphore',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR', 'queuePresentKHR'
data PresentInfoKHR (es :: [Type]) = PresentInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). PresentInfoKHR es -> Chain es
next :: Chain es
  , -- | @pWaitSemaphores@ is @NULL@ or a pointer to an array of
    -- 'Vulkan.Core10.Handles.Semaphore' objects with @waitSemaphoreCount@
    -- entries, and specifies the semaphores to wait for before issuing the
    -- present request.
    forall (es :: [*]). PresentInfoKHR es -> Vector Semaphore
waitSemaphores :: Vector Semaphore
  , -- | @pSwapchains@ is a pointer to an array of
    -- 'Vulkan.Extensions.Handles.SwapchainKHR' objects with @swapchainCount@
    -- entries.
    forall (es :: [*]). PresentInfoKHR es -> Vector SwapchainKHR
swapchains :: Vector SwapchainKHR
  , -- | @pImageIndices@ is a pointer to an array of indices into the array of
    -- each swapchain’s presentable images, with @swapchainCount@ entries. Each
    -- entry in this array identifies the image to present on the corresponding
    -- entry in the @pSwapchains@ array.
    forall (es :: [*]). PresentInfoKHR es -> Vector Flags
imageIndices :: Vector Word32
  , -- | @pResults@ is a pointer to an array of
    -- 'Vulkan.Core10.Enums.Result.Result' typed elements with @swapchainCount@
    -- entries. Applications that do not need per-swapchain results /can/ use
    -- @NULL@ for @pResults@. If non-@NULL@, each entry in @pResults@ will be
    -- set to the 'Vulkan.Core10.Enums.Result.Result' for presenting the
    -- swapchain corresponding to the same index in @pSwapchains@.
    forall (es :: [*]). PresentInfoKHR es -> Ptr Result
results :: Ptr Result
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PresentInfoKHR es)

instance Extensible PresentInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"PresentInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
PresentInfoKHR ds -> Chain es -> PresentInfoKHR es
setNext PresentInfoKHR{Ptr Result
Vector Flags
Vector Semaphore
Vector SwapchainKHR
Chain ds
results :: Ptr Result
imageIndices :: Vector Flags
swapchains :: Vector SwapchainKHR
waitSemaphores :: Vector Semaphore
next :: Chain ds
$sel:results:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Ptr Result
$sel:imageIndices:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Flags
$sel:swapchains:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector SwapchainKHR
$sel:waitSemaphores:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Semaphore
$sel:next:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Chain es
..} Chain es
next' = PresentInfoKHR{$sel:next:PresentInfoKHR :: Chain es
next = Chain es
next', Ptr Result
Vector Flags
Vector Semaphore
Vector SwapchainKHR
results :: Ptr Result
imageIndices :: Vector Flags
swapchains :: Vector SwapchainKHR
waitSemaphores :: Vector Semaphore
$sel:results:PresentInfoKHR :: Ptr Result
$sel:imageIndices:PresentInfoKHR :: Vector Flags
$sel:swapchains:PresentInfoKHR :: Vector SwapchainKHR
$sel:waitSemaphores:PresentInfoKHR :: Vector Semaphore
..}
  getNext :: forall (es :: [*]). PresentInfoKHR es -> Chain es
getNext PresentInfoKHR{Ptr Result
Vector Flags
Vector Semaphore
Vector SwapchainKHR
Chain es
results :: Ptr Result
imageIndices :: Vector Flags
swapchains :: Vector SwapchainKHR
waitSemaphores :: Vector Semaphore
next :: Chain es
$sel:results:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Ptr Result
$sel:imageIndices:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Flags
$sel:swapchains:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector SwapchainKHR
$sel:waitSemaphores:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Semaphore
$sel:next:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends PresentInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PresentInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends PresentInfoKHR e => b
f
    | Just e :~: SwapchainPresentModeInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainPresentModeInfoEXT = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: SwapchainPresentFenceInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SwapchainPresentFenceInfoEXT = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: FrameBoundaryEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @FrameBoundaryEXT = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: PresentFrameTokenGGP
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PresentFrameTokenGGP = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: PresentTimesInfoGOOGLE
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PresentTimesInfoGOOGLE = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: PresentIdKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PresentIdKHR = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: DeviceGroupPresentInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @DeviceGroupPresentInfoKHR = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: PresentRegionsKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PresentRegionsKHR = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Just e :~: DisplayPresentInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @DisplayPresentInfoKHR = forall a. a -> Maybe a
Just Extends PresentInfoKHR e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss PresentInfoKHR es
         , PokeChain es ) => ToCStruct (PresentInfoKHR es) where
  withCStruct :: forall b.
PresentInfoKHR es -> (Ptr (PresentInfoKHR es) -> IO b) -> IO b
withCStruct PresentInfoKHR es
x Ptr (PresentInfoKHR es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr (PresentInfoKHR es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PresentInfoKHR es)
p PresentInfoKHR es
x (Ptr (PresentInfoKHR es) -> IO b
f Ptr (PresentInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (PresentInfoKHR es) -> PresentInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (PresentInfoKHR es)
p PresentInfoKHR{Ptr Result
Vector Flags
Vector Semaphore
Vector SwapchainKHR
Chain es
results :: Ptr Result
imageIndices :: Vector Flags
swapchains :: Vector SwapchainKHR
waitSemaphores :: Vector Semaphore
next :: Chain es
$sel:results:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Ptr Result
$sel:imageIndices:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Flags
$sel:swapchains:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector SwapchainKHR
$sel:waitSemaphores:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Vector Semaphore
$sel:next:PresentInfoKHR :: forall (es :: [*]). PresentInfoKHR es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_INFO_KHR)
    Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Semaphore
waitSemaphores)) :: Word32))
    Ptr Semaphore
pPWaitSemaphores' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Semaphore ((forall a. Vector a -> Int
Data.Vector.length (Vector Semaphore
waitSemaphores)) forall a. Num a => a -> a -> a
* Int
8)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Semaphore
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Semaphore
pPWaitSemaphores' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Semaphore) (Semaphore
e)) (Vector Semaphore
waitSemaphores)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Semaphore))) (Ptr Semaphore
pPWaitSemaphores')
    let pSwapchainsLength :: Int
pSwapchainsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector SwapchainKHR
swapchains)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Flags
imageIndices)) forall a. Eq a => a -> a -> Bool
== Int
pSwapchainsLength) forall a b. (a -> b) -> a -> b
$
      forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pImageIndices and pSwapchains must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pSwapchainsLength :: Word32))
    "pSwapchain" ::: Ptr SwapchainKHR
pPSwapchains' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SwapchainKHR ((forall a. Vector a -> Int
Data.Vector.length (Vector SwapchainKHR
swapchains)) forall a. Num a => a -> a -> a
* Int
8)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SwapchainKHR
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pSwapchain" ::: Ptr SwapchainKHR
pPSwapchains' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SwapchainKHR) (SwapchainKHR
e)) (Vector SwapchainKHR
swapchains)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SwapchainKHR))) ("pSwapchain" ::: Ptr SwapchainKHR
pPSwapchains')
    "pSwapchainImageCount" ::: Ptr Flags
pPImageIndices' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector Flags
imageIndices)) forall a. Num a => a -> a -> a
* Int
4)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Flags
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pSwapchainImageCount" ::: Ptr Flags
pPImageIndices' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Flags
e)) (Vector Flags
imageIndices)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr Word32))) ("pSwapchainImageCount" ::: Ptr Flags
pPImageIndices')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr Result))) (Ptr Result
results)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (PresentInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (PresentInfoKHR es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_INFO_KHR)
    Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss PresentInfoKHR es
         , PeekChain es ) => FromCStruct (PresentInfoKHR es) where
  peekCStruct :: Ptr (PresentInfoKHR es) -> IO (PresentInfoKHR es)
peekCStruct Ptr (PresentInfoKHR es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    Flags
waitSemaphoreCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    Ptr Semaphore
pWaitSemaphores <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Semaphore) ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Semaphore)))
    Vector Semaphore
pWaitSemaphores' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
waitSemaphoreCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Semaphore ((Ptr Semaphore
pWaitSemaphores forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Semaphore)))
    Flags
swapchainCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    "pSwapchain" ::: Ptr SwapchainKHR
pSwapchains <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SwapchainKHR) ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SwapchainKHR)))
    Vector SwapchainKHR
pSwapchains' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
swapchainCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR (("pSwapchain" ::: Ptr SwapchainKHR
pSwapchains forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SwapchainKHR)))
    "pSwapchainImageCount" ::: Ptr Flags
pImageIndices <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr Word32)))
    Vector Flags
pImageIndices' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
swapchainCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pSwapchainImageCount" ::: Ptr Flags
pImageIndices forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    Ptr Result
pResults <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Result) ((Ptr (PresentInfoKHR es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr Result)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> Vector Semaphore
-> Vector SwapchainKHR
-> Vector Flags
-> Ptr Result
-> PresentInfoKHR es
PresentInfoKHR
             Chain es
next Vector Semaphore
pWaitSemaphores' Vector SwapchainKHR
pSwapchains' Vector Flags
pImageIndices' Ptr Result
pResults

instance es ~ '[] => Zero (PresentInfoKHR es) where
  zero :: PresentInfoKHR es
zero = forall (es :: [*]).
Chain es
-> Vector Semaphore
-> Vector SwapchainKHR
-> Vector Flags
-> Ptr Result
-> PresentInfoKHR es
PresentInfoKHR
           ()
           forall a. Monoid a => a
mempty
           forall a. Monoid a => a
mempty
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero


-- | 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
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'DeviceGroupPresentModeFlagsKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceGroupPresentCapabilitiesKHR'
data DeviceGroupPresentCapabilitiesKHR = DeviceGroupPresentCapabilitiesKHR
  { -- | @presentMask@ is an array of
    -- 'Vulkan.Core10.APIConstants.MAX_DEVICE_GROUP_SIZE' @uint32_t@ masks,
    -- where the mask at element i is non-zero if physical device i has a
    -- presentation engine, and where bit j is set in element i if physical
    -- device i /can/ present swapchain images from physical device j. If
    -- element i is non-zero, then bit i /must/ be set.
    DeviceGroupPresentCapabilitiesKHR -> Vector Flags
presentMask :: Vector Word32
  , -- | @modes@ is a bitmask of 'DeviceGroupPresentModeFlagBitsKHR' indicating
    -- which device group presentation modes are supported.
    DeviceGroupPresentCapabilitiesKHR
-> DeviceGroupPresentModeFlagBitsKHR
modes :: DeviceGroupPresentModeFlagsKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupPresentCapabilitiesKHR)
#endif
deriving instance Show DeviceGroupPresentCapabilitiesKHR

instance ToCStruct DeviceGroupPresentCapabilitiesKHR where
  withCStruct :: forall b.
DeviceGroupPresentCapabilitiesKHR
-> (("pDeviceGroupPresentCapabilities"
     ::: Ptr DeviceGroupPresentCapabilitiesKHR)
    -> IO b)
-> IO b
withCStruct DeviceGroupPresentCapabilitiesKHR
x ("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
152 forall a b. (a -> b) -> a -> b
$ \"pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p DeviceGroupPresentCapabilitiesKHR
x (("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO b
f "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p)
  pokeCStruct :: forall b.
("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> DeviceGroupPresentCapabilitiesKHR -> IO b -> IO b
pokeCStruct "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p DeviceGroupPresentCapabilitiesKHR{Vector Flags
DeviceGroupPresentModeFlagBitsKHR
modes :: DeviceGroupPresentModeFlagBitsKHR
presentMask :: Vector Flags
$sel:modes:DeviceGroupPresentCapabilitiesKHR :: DeviceGroupPresentCapabilitiesKHR
-> DeviceGroupPresentModeFlagBitsKHR
$sel:presentMask:DeviceGroupPresentCapabilitiesKHR :: DeviceGroupPresentCapabilitiesKHR -> Vector Flags
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Flags
presentMask)) forall a. Ord a => a -> a -> Bool
<= forall a. Integral a => a
MAX_DEVICE_GROUP_SIZE) forall a b. (a -> b) -> a -> b
$
      forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"presentMask is too long, a maximum of MAX_DEVICE_GROUP_SIZE elements are allowed" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
    forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Flags
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray MAX_DEVICE_GROUP_SIZE Word32)))) forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Flags
e)) (Vector Flags
presentMask)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
144 :: Ptr DeviceGroupPresentModeFlagsKHR)) (DeviceGroupPresentModeFlagBitsKHR
modes)
    IO b
f
  cStructSize :: Int
cStructSize = Int
152
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO b -> IO b
pokeZeroCStruct "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
144 :: Ptr DeviceGroupPresentModeFlagsKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DeviceGroupPresentCapabilitiesKHR where
  peekCStruct :: ("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO DeviceGroupPresentCapabilitiesKHR
peekCStruct "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p = do
    Vector Flags
presentMask <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a. Integral a => a
MAX_DEVICE_GROUP_SIZE) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Word32 (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray MAX_DEVICE_GROUP_SIZE Word32)))) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    DeviceGroupPresentModeFlagBitsKHR
modes <- forall a. Storable a => Ptr a -> IO a
peek @DeviceGroupPresentModeFlagsKHR (("pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
144 :: Ptr DeviceGroupPresentModeFlagsKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector Flags
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentCapabilitiesKHR
DeviceGroupPresentCapabilitiesKHR
             Vector Flags
presentMask DeviceGroupPresentModeFlagBitsKHR
modes

instance Storable DeviceGroupPresentCapabilitiesKHR where
  sizeOf :: DeviceGroupPresentCapabilitiesKHR -> Int
sizeOf ~DeviceGroupPresentCapabilitiesKHR
_ = Int
152
  alignment :: DeviceGroupPresentCapabilitiesKHR -> Int
alignment ~DeviceGroupPresentCapabilitiesKHR
_ = Int
8
  peek :: ("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> IO DeviceGroupPresentCapabilitiesKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pDeviceGroupPresentCapabilities"
 ::: Ptr DeviceGroupPresentCapabilitiesKHR)
-> DeviceGroupPresentCapabilitiesKHR -> IO ()
poke "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
ptr DeviceGroupPresentCapabilitiesKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pDeviceGroupPresentCapabilities"
::: Ptr DeviceGroupPresentCapabilitiesKHR
ptr DeviceGroupPresentCapabilitiesKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DeviceGroupPresentCapabilitiesKHR where
  zero :: DeviceGroupPresentCapabilitiesKHR
zero = Vector Flags
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentCapabilitiesKHR
DeviceGroupPresentCapabilitiesKHR
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero


-- | VkImageSwapchainCreateInfoKHR - Specify that an image will be bound to
-- swapchain memory
--
-- == Valid Usage
--
-- -   #VUID-VkImageSwapchainCreateInfoKHR-swapchain-00995# If @swapchain@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', the fields of
--     'Vulkan.Core10.Image.ImageCreateInfo' /must/ match the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#swapchain-wsi-image-create-info implied image creation parameters>
--     of the swapchain
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImageSwapchainCreateInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR'
--
-- -   #VUID-VkImageSwapchainCreateInfoKHR-swapchain-parameter# If
--     @swapchain@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
data ImageSwapchainCreateInfoKHR = ImageSwapchainCreateInfoKHR
  { -- | @swapchain@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a handle of a
    -- swapchain that the image will be bound to.
    ImageSwapchainCreateInfoKHR -> SwapchainKHR
swapchain :: SwapchainKHR }
  deriving (Typeable, ImageSwapchainCreateInfoKHR -> ImageSwapchainCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageSwapchainCreateInfoKHR -> ImageSwapchainCreateInfoKHR -> Bool
$c/= :: ImageSwapchainCreateInfoKHR -> ImageSwapchainCreateInfoKHR -> Bool
== :: ImageSwapchainCreateInfoKHR -> ImageSwapchainCreateInfoKHR -> Bool
$c== :: ImageSwapchainCreateInfoKHR -> ImageSwapchainCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageSwapchainCreateInfoKHR)
#endif
deriving instance Show ImageSwapchainCreateInfoKHR

instance ToCStruct ImageSwapchainCreateInfoKHR where
  withCStruct :: forall b.
ImageSwapchainCreateInfoKHR
-> (Ptr ImageSwapchainCreateInfoKHR -> IO b) -> IO b
withCStruct ImageSwapchainCreateInfoKHR
x Ptr ImageSwapchainCreateInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ImageSwapchainCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageSwapchainCreateInfoKHR
p ImageSwapchainCreateInfoKHR
x (Ptr ImageSwapchainCreateInfoKHR -> IO b
f Ptr ImageSwapchainCreateInfoKHR
p)
  pokeCStruct :: forall b.
Ptr ImageSwapchainCreateInfoKHR
-> ImageSwapchainCreateInfoKHR -> IO b -> IO b
pokeCStruct Ptr ImageSwapchainCreateInfoKHR
p ImageSwapchainCreateInfoKHR{SwapchainKHR
swapchain :: SwapchainKHR
$sel:swapchain:ImageSwapchainCreateInfoKHR :: ImageSwapchainCreateInfoKHR -> SwapchainKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (SwapchainKHR
swapchain)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ImageSwapchainCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr ImageSwapchainCreateInfoKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct ImageSwapchainCreateInfoKHR where
  peekCStruct :: Ptr ImageSwapchainCreateInfoKHR -> IO ImageSwapchainCreateInfoKHR
peekCStruct Ptr ImageSwapchainCreateInfoKHR
p = do
    SwapchainKHR
swapchain <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR ((Ptr ImageSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SwapchainKHR -> ImageSwapchainCreateInfoKHR
ImageSwapchainCreateInfoKHR
             SwapchainKHR
swapchain

instance Storable ImageSwapchainCreateInfoKHR where
  sizeOf :: ImageSwapchainCreateInfoKHR -> Int
sizeOf ~ImageSwapchainCreateInfoKHR
_ = Int
24
  alignment :: ImageSwapchainCreateInfoKHR -> Int
alignment ~ImageSwapchainCreateInfoKHR
_ = Int
8
  peek :: Ptr ImageSwapchainCreateInfoKHR -> IO ImageSwapchainCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr ImageSwapchainCreateInfoKHR
-> ImageSwapchainCreateInfoKHR -> IO ()
poke Ptr ImageSwapchainCreateInfoKHR
ptr ImageSwapchainCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageSwapchainCreateInfoKHR
ptr ImageSwapchainCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero ImageSwapchainCreateInfoKHR where
  zero :: ImageSwapchainCreateInfoKHR
zero = SwapchainKHR -> ImageSwapchainCreateInfoKHR
ImageSwapchainCreateInfoKHR
           forall a. Zero a => a
zero


-- | 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
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_groupAndVK_KHR_bind_memory2.BindImageMemoryDeviceGroupInfo'.
--
-- == Valid Usage
--
-- -   #VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644#
--     @imageIndex@ /must/ be less than the number of images in @swapchain@
--
-- -   #VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-07756# If the
--     @swapchain@ has been created with
--     'SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT', @imageIndex@
--     /must/ be one that has previously been returned by
--     'acquireNextImageKHR' or 'acquireNextImage2KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR'
--
-- -   #VUID-VkBindImageMemorySwapchainInfoKHR-swapchain-parameter#
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
data BindImageMemorySwapchainInfoKHR = BindImageMemorySwapchainInfoKHR
  { -- | @swapchain@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a swapchain
    -- handle.
    BindImageMemorySwapchainInfoKHR -> SwapchainKHR
swapchain :: SwapchainKHR
  , -- | @imageIndex@ is an image index within @swapchain@.
    BindImageMemorySwapchainInfoKHR -> Flags
imageIndex :: Word32
  }
  deriving (Typeable, BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> Bool
$c/= :: BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> Bool
== :: BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> Bool
$c== :: BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindImageMemorySwapchainInfoKHR)
#endif
deriving instance Show BindImageMemorySwapchainInfoKHR

instance ToCStruct BindImageMemorySwapchainInfoKHR where
  withCStruct :: forall b.
BindImageMemorySwapchainInfoKHR
-> (Ptr BindImageMemorySwapchainInfoKHR -> IO b) -> IO b
withCStruct BindImageMemorySwapchainInfoKHR
x Ptr BindImageMemorySwapchainInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr BindImageMemorySwapchainInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindImageMemorySwapchainInfoKHR
p BindImageMemorySwapchainInfoKHR
x (Ptr BindImageMemorySwapchainInfoKHR -> IO b
f Ptr BindImageMemorySwapchainInfoKHR
p)
  pokeCStruct :: forall b.
Ptr BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> IO b -> IO b
pokeCStruct Ptr BindImageMemorySwapchainInfoKHR
p BindImageMemorySwapchainInfoKHR{Flags
SwapchainKHR
imageIndex :: Flags
swapchain :: SwapchainKHR
$sel:imageIndex:BindImageMemorySwapchainInfoKHR :: BindImageMemorySwapchainInfoKHR -> Flags
$sel:swapchain:BindImageMemorySwapchainInfoKHR :: BindImageMemorySwapchainInfoKHR -> SwapchainKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (SwapchainKHR
swapchain)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
imageIndex)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr BindImageMemorySwapchainInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr BindImageMemorySwapchainInfoKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindImageMemorySwapchainInfoKHR where
  peekCStruct :: Ptr BindImageMemorySwapchainInfoKHR
-> IO BindImageMemorySwapchainInfoKHR
peekCStruct Ptr BindImageMemorySwapchainInfoKHR
p = do
    SwapchainKHR
swapchain <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR))
    Flags
imageIndex <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BindImageMemorySwapchainInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SwapchainKHR -> Flags -> BindImageMemorySwapchainInfoKHR
BindImageMemorySwapchainInfoKHR
             SwapchainKHR
swapchain Flags
imageIndex

instance Storable BindImageMemorySwapchainInfoKHR where
  sizeOf :: BindImageMemorySwapchainInfoKHR -> Int
sizeOf ~BindImageMemorySwapchainInfoKHR
_ = Int
32
  alignment :: BindImageMemorySwapchainInfoKHR -> Int
alignment ~BindImageMemorySwapchainInfoKHR
_ = Int
8
  peek :: Ptr BindImageMemorySwapchainInfoKHR
-> IO BindImageMemorySwapchainInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr BindImageMemorySwapchainInfoKHR
-> BindImageMemorySwapchainInfoKHR -> IO ()
poke Ptr BindImageMemorySwapchainInfoKHR
ptr BindImageMemorySwapchainInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindImageMemorySwapchainInfoKHR
ptr BindImageMemorySwapchainInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero BindImageMemorySwapchainInfoKHR where
  zero :: BindImageMemorySwapchainInfoKHR
zero = SwapchainKHR -> Flags -> BindImageMemorySwapchainInfoKHR
BindImageMemorySwapchainInfoKHR
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | 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
--
-- -   #VUID-VkAcquireNextImageInfoKHR-swapchain-01675# @swapchain@ /must/
--     not be in the retired state
--
-- -   #VUID-VkAcquireNextImageInfoKHR-semaphore-01288# If @semaphore@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ be unsignaled
--
-- -   #VUID-VkAcquireNextImageInfoKHR-semaphore-01781# If @semaphore@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ not have any
--     uncompleted signal or wait operations pending
--
-- -   #VUID-VkAcquireNextImageInfoKHR-fence-01289# If @fence@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' it /must/ be unsignaled and
--     /must/ not be associated with any other queue command that has not
--     yet completed execution on that queue
--
-- -   #VUID-VkAcquireNextImageInfoKHR-semaphore-01782# @semaphore@ and
--     @fence@ /must/ not both be equal to
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-VkAcquireNextImageInfoKHR-deviceMask-01290# @deviceMask@
--     /must/ be a valid device mask
--
-- -   #VUID-VkAcquireNextImageInfoKHR-deviceMask-01291# @deviceMask@
--     /must/ not be zero
--
-- -   #VUID-VkAcquireNextImageInfoKHR-semaphore-03266# @semaphore@ /must/
--     have a 'Vulkan.Core12.Enums.SemaphoreType.SemaphoreType' of
--     'Vulkan.Core12.Enums.SemaphoreType.SEMAPHORE_TYPE_BINARY'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAcquireNextImageInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR'
--
-- -   #VUID-VkAcquireNextImageInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkAcquireNextImageInfoKHR-swapchain-parameter# @swapchain@
--     /must/ be a valid 'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-VkAcquireNextImageInfoKHR-semaphore-parameter# If @semaphore@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @semaphore@ /must/
--     be a valid 'Vulkan.Core10.Handles.Semaphore' handle
--
-- -   #VUID-VkAcquireNextImageInfoKHR-fence-parameter# If @fence@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @fence@ /must/ be a valid
--     'Vulkan.Core10.Handles.Fence' handle
--
-- -   #VUID-VkAcquireNextImageInfoKHR-commonparent# Each of @fence@,
--     @semaphore@, and @swapchain@ that are valid handles of non-ignored
--     parameters /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /must/ be externally synchronized
--
-- -   Host access to @semaphore@ /must/ be externally synchronized
--
-- -   Host access to @fence@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Handles.Fence', 'Vulkan.Core10.Handles.Semaphore',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR', 'acquireNextImage2KHR'
data AcquireNextImageInfoKHR = AcquireNextImageInfoKHR
  { -- | @swapchain@ is a non-retired swapchain from which an image is acquired.
    AcquireNextImageInfoKHR -> SwapchainKHR
swapchain :: SwapchainKHR
  , -- | @timeout@ specifies how long the function waits, in nanoseconds, if no
    -- image is available.
    AcquireNextImageInfoKHR -> Word64
timeout :: Word64
  , -- | @semaphore@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a semaphore
    -- to signal.
    AcquireNextImageInfoKHR -> Semaphore
semaphore :: Semaphore
  , -- | @fence@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a fence to
    -- signal.
    AcquireNextImageInfoKHR -> Fence
fence :: Fence
  , -- | @deviceMask@ is a mask of physical devices for which the swapchain image
    -- will be ready to use when the semaphore or fence is signaled.
    AcquireNextImageInfoKHR -> Flags
deviceMask :: Word32
  }
  deriving (Typeable, AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> Bool
$c/= :: AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> Bool
== :: AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> Bool
$c== :: AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AcquireNextImageInfoKHR)
#endif
deriving instance Show AcquireNextImageInfoKHR

instance ToCStruct AcquireNextImageInfoKHR where
  withCStruct :: forall b.
AcquireNextImageInfoKHR
-> (Ptr AcquireNextImageInfoKHR -> IO b) -> IO b
withCStruct AcquireNextImageInfoKHR
x Ptr AcquireNextImageInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr AcquireNextImageInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AcquireNextImageInfoKHR
p AcquireNextImageInfoKHR
x (Ptr AcquireNextImageInfoKHR -> IO b
f Ptr AcquireNextImageInfoKHR
p)
  pokeCStruct :: forall b.
Ptr AcquireNextImageInfoKHR
-> AcquireNextImageInfoKHR -> IO b -> IO b
pokeCStruct Ptr AcquireNextImageInfoKHR
p AcquireNextImageInfoKHR{Flags
Word64
Semaphore
Fence
SwapchainKHR
deviceMask :: Flags
fence :: Fence
semaphore :: Semaphore
timeout :: Word64
swapchain :: SwapchainKHR
$sel:deviceMask:AcquireNextImageInfoKHR :: AcquireNextImageInfoKHR -> Flags
$sel:fence:AcquireNextImageInfoKHR :: AcquireNextImageInfoKHR -> Fence
$sel:semaphore:AcquireNextImageInfoKHR :: AcquireNextImageInfoKHR -> Semaphore
$sel:timeout:AcquireNextImageInfoKHR :: AcquireNextImageInfoKHR -> Word64
$sel:swapchain:AcquireNextImageInfoKHR :: AcquireNextImageInfoKHR -> SwapchainKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (SwapchainKHR
swapchain)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (Word64
timeout)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Semaphore)) (Semaphore
semaphore)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Fence)) (Fence
fence)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Flags
deviceMask)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr AcquireNextImageInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr AcquireNextImageInfoKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AcquireNextImageInfoKHR where
  peekCStruct :: Ptr AcquireNextImageInfoKHR -> IO AcquireNextImageInfoKHR
peekCStruct Ptr AcquireNextImageInfoKHR
p = do
    SwapchainKHR
swapchain <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR))
    Word64
timeout <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64))
    Semaphore
semaphore <- forall a. Storable a => Ptr a -> IO a
peek @Semaphore ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Semaphore))
    Fence
fence <- forall a. Storable a => Ptr a -> IO a
peek @Fence ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Fence))
    Flags
deviceMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AcquireNextImageInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SwapchainKHR
-> Word64 -> Semaphore -> Fence -> Flags -> AcquireNextImageInfoKHR
AcquireNextImageInfoKHR
             SwapchainKHR
swapchain Word64
timeout Semaphore
semaphore Fence
fence Flags
deviceMask

instance Storable AcquireNextImageInfoKHR where
  sizeOf :: AcquireNextImageInfoKHR -> Int
sizeOf ~AcquireNextImageInfoKHR
_ = Int
56
  alignment :: AcquireNextImageInfoKHR -> Int
alignment ~AcquireNextImageInfoKHR
_ = Int
8
  peek :: Ptr AcquireNextImageInfoKHR -> IO AcquireNextImageInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr AcquireNextImageInfoKHR -> AcquireNextImageInfoKHR -> IO ()
poke Ptr AcquireNextImageInfoKHR
ptr AcquireNextImageInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AcquireNextImageInfoKHR
ptr AcquireNextImageInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero AcquireNextImageInfoKHR where
  zero :: AcquireNextImageInfoKHR
zero = SwapchainKHR
-> Word64 -> Semaphore -> Fence -> Flags -> AcquireNextImageInfoKHR
AcquireNextImageInfoKHR
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | 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
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-swapchainCount-01297#
--     @swapchainCount@ /must/ equal @0@ or
--     'PresentInfoKHR'::@swapchainCount@
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-01298# If @mode@ is
--     'DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR', then each element of
--     @pDeviceMasks@ /must/ have exactly one bit set, and the
--     corresponding element of
--     'DeviceGroupPresentCapabilitiesKHR'::@presentMask@ /must/ be
--     non-zero
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-01299# If @mode@ is
--     'DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR', then 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@
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-01300# If @mode@ is
--     'DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR', then each element of
--     @pDeviceMasks@ /must/ have a value for which all set bits are set in
--     one of the elements of
--     'DeviceGroupPresentCapabilitiesKHR'::@presentMask@
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-01301# If @mode@ is
--     'DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR', then for
--     each bit set in each element of @pDeviceMasks@, the corresponding
--     element of 'DeviceGroupPresentCapabilitiesKHR'::@presentMask@ /must/
--     be non-zero
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-01302# The value of
--     each element of @pDeviceMasks@ /must/ be equal to the device mask
--     passed in 'AcquireNextImageInfoKHR'::@deviceMask@ when the image
--     index was last acquired
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-01303# @mode@ /must/ have
--     exactly one bit set, and that bit /must/ have been included in
--     'DeviceGroupSwapchainCreateInfoKHR'::@modes@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR'
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter# If
--     @swapchainCount@ is not @0@, @pDeviceMasks@ /must/ be a valid
--     pointer to an array of @swapchainCount@ @uint32_t@ values
--
-- -   #VUID-VkDeviceGroupPresentInfoKHR-mode-parameter# @mode@ /must/ be a
--     valid 'DeviceGroupPresentModeFlagBitsKHR' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'DeviceGroupPresentModeFlagBitsKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DeviceGroupPresentInfoKHR = DeviceGroupPresentInfoKHR
  { -- | @pDeviceMasks@ is a pointer to an array of device masks, one for each
    -- element of 'PresentInfoKHR'::@pSwapchains@.
    DeviceGroupPresentInfoKHR -> Vector Flags
deviceMasks :: Vector Word32
  , -- | @mode@ is a 'DeviceGroupPresentModeFlagBitsKHR' value specifying the
    -- device group present mode that will be used for this present.
    DeviceGroupPresentInfoKHR -> DeviceGroupPresentModeFlagBitsKHR
mode :: DeviceGroupPresentModeFlagBitsKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupPresentInfoKHR)
#endif
deriving instance Show DeviceGroupPresentInfoKHR

instance ToCStruct DeviceGroupPresentInfoKHR where
  withCStruct :: forall b.
DeviceGroupPresentInfoKHR
-> (Ptr DeviceGroupPresentInfoKHR -> IO b) -> IO b
withCStruct DeviceGroupPresentInfoKHR
x Ptr DeviceGroupPresentInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr DeviceGroupPresentInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupPresentInfoKHR
p DeviceGroupPresentInfoKHR
x (Ptr DeviceGroupPresentInfoKHR -> IO b
f Ptr DeviceGroupPresentInfoKHR
p)
  pokeCStruct :: forall b.
Ptr DeviceGroupPresentInfoKHR
-> DeviceGroupPresentInfoKHR -> IO b -> IO b
pokeCStruct Ptr DeviceGroupPresentInfoKHR
p DeviceGroupPresentInfoKHR{Vector Flags
DeviceGroupPresentModeFlagBitsKHR
mode :: DeviceGroupPresentModeFlagBitsKHR
deviceMasks :: Vector Flags
$sel:mode:DeviceGroupPresentInfoKHR :: DeviceGroupPresentInfoKHR -> DeviceGroupPresentModeFlagBitsKHR
$sel:deviceMasks:DeviceGroupPresentInfoKHR :: DeviceGroupPresentInfoKHR -> Vector Flags
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Flags
deviceMasks)) :: Word32))
    "pSwapchainImageCount" ::: Ptr Flags
pPDeviceMasks' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector Flags
deviceMasks)) forall a. Num a => a -> a -> a
* Int
4)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Flags
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pSwapchainImageCount" ::: Ptr Flags
pPDeviceMasks' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Flags
e)) (Vector Flags
deviceMasks)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32))) ("pSwapchainImageCount" ::: Ptr Flags
pPDeviceMasks')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceGroupPresentModeFlagBitsKHR)) (DeviceGroupPresentModeFlagBitsKHR
mode)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr DeviceGroupPresentInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr DeviceGroupPresentInfoKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceGroupPresentModeFlagBitsKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DeviceGroupPresentInfoKHR where
  peekCStruct :: Ptr DeviceGroupPresentInfoKHR -> IO DeviceGroupPresentInfoKHR
peekCStruct Ptr DeviceGroupPresentInfoKHR
p = do
    Flags
swapchainCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    "pSwapchainImageCount" ::: Ptr Flags
pDeviceMasks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32)))
    Vector Flags
pDeviceMasks' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
swapchainCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pSwapchainImageCount" ::: Ptr Flags
pDeviceMasks forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    DeviceGroupPresentModeFlagBitsKHR
mode <- forall a. Storable a => Ptr a -> IO a
peek @DeviceGroupPresentModeFlagBitsKHR ((Ptr DeviceGroupPresentInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceGroupPresentModeFlagBitsKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector Flags
-> DeviceGroupPresentModeFlagBitsKHR -> DeviceGroupPresentInfoKHR
DeviceGroupPresentInfoKHR
             Vector Flags
pDeviceMasks' DeviceGroupPresentModeFlagBitsKHR
mode

instance Zero DeviceGroupPresentInfoKHR where
  zero :: DeviceGroupPresentInfoKHR
zero = Vector Flags
-> DeviceGroupPresentModeFlagBitsKHR -> DeviceGroupPresentInfoKHR
DeviceGroupPresentInfoKHR
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero


-- | 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
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'DeviceGroupPresentModeFlagsKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DeviceGroupSwapchainCreateInfoKHR = DeviceGroupSwapchainCreateInfoKHR
  { -- | @modes@ is a bitfield of modes that the swapchain /can/ be used with.
    --
    -- #VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter# @modes@
    -- /must/ be a valid combination of 'DeviceGroupPresentModeFlagBitsKHR'
    -- values
    --
    -- #VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask# @modes@
    -- /must/ not be @0@
    DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupPresentModeFlagBitsKHR
modes :: DeviceGroupPresentModeFlagsKHR }
  deriving (Typeable, DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> Bool
$c/= :: DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> Bool
== :: DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> Bool
$c== :: DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupSwapchainCreateInfoKHR)
#endif
deriving instance Show DeviceGroupSwapchainCreateInfoKHR

instance ToCStruct DeviceGroupSwapchainCreateInfoKHR where
  withCStruct :: forall b.
DeviceGroupSwapchainCreateInfoKHR
-> (Ptr DeviceGroupSwapchainCreateInfoKHR -> IO b) -> IO b
withCStruct DeviceGroupSwapchainCreateInfoKHR
x Ptr DeviceGroupSwapchainCreateInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DeviceGroupSwapchainCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupSwapchainCreateInfoKHR
p DeviceGroupSwapchainCreateInfoKHR
x (Ptr DeviceGroupSwapchainCreateInfoKHR -> IO b
f Ptr DeviceGroupSwapchainCreateInfoKHR
p)
  pokeCStruct :: forall b.
Ptr DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> IO b -> IO b
pokeCStruct Ptr DeviceGroupSwapchainCreateInfoKHR
p DeviceGroupSwapchainCreateInfoKHR{DeviceGroupPresentModeFlagBitsKHR
modes :: DeviceGroupPresentModeFlagBitsKHR
$sel:modes:DeviceGroupSwapchainCreateInfoKHR :: DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupPresentModeFlagBitsKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceGroupPresentModeFlagsKHR)) (DeviceGroupPresentModeFlagBitsKHR
modes)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr DeviceGroupSwapchainCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr DeviceGroupSwapchainCreateInfoKHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceGroupPresentModeFlagsKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DeviceGroupSwapchainCreateInfoKHR where
  peekCStruct :: Ptr DeviceGroupSwapchainCreateInfoKHR
-> IO DeviceGroupSwapchainCreateInfoKHR
peekCStruct Ptr DeviceGroupSwapchainCreateInfoKHR
p = do
    DeviceGroupPresentModeFlagBitsKHR
modes <- forall a. Storable a => Ptr a -> IO a
peek @DeviceGroupPresentModeFlagsKHR ((Ptr DeviceGroupSwapchainCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceGroupPresentModeFlagsKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupSwapchainCreateInfoKHR
DeviceGroupSwapchainCreateInfoKHR
             DeviceGroupPresentModeFlagBitsKHR
modes

instance Storable DeviceGroupSwapchainCreateInfoKHR where
  sizeOf :: DeviceGroupSwapchainCreateInfoKHR -> Int
sizeOf ~DeviceGroupSwapchainCreateInfoKHR
_ = Int
24
  alignment :: DeviceGroupSwapchainCreateInfoKHR -> Int
alignment ~DeviceGroupSwapchainCreateInfoKHR
_ = Int
8
  peek :: Ptr DeviceGroupSwapchainCreateInfoKHR
-> IO DeviceGroupSwapchainCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr DeviceGroupSwapchainCreateInfoKHR
-> DeviceGroupSwapchainCreateInfoKHR -> IO ()
poke Ptr DeviceGroupSwapchainCreateInfoKHR
ptr DeviceGroupSwapchainCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupSwapchainCreateInfoKHR
ptr DeviceGroupSwapchainCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DeviceGroupSwapchainCreateInfoKHR where
  zero :: DeviceGroupSwapchainCreateInfoKHR
zero = DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupSwapchainCreateInfoKHR
DeviceGroupSwapchainCreateInfoKHR
           forall a. Zero a => a
zero


type DeviceGroupPresentModeFlagsKHR = DeviceGroupPresentModeFlagBitsKHR

-- | VkDeviceGroupPresentModeFlagBitsKHR - Bitmask specifying supported
-- device group present modes
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'DeviceGroupPresentInfoKHR', 'DeviceGroupPresentModeFlagsKHR'
newtype DeviceGroupPresentModeFlagBitsKHR = DeviceGroupPresentModeFlagBitsKHR Flags
  deriving newtype (DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c/= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
== :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c== :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
Eq, Eq DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Ordering
DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$cmin :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
max :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$cmax :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
>= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c>= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
> :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c> :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
<= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c<= :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
< :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
$c< :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Bool
compare :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Ordering
$ccompare :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR -> Ordering
Ord, ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO DeviceGroupPresentModeFlagBitsKHR
("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> IO DeviceGroupPresentModeFlagBitsKHR
("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> DeviceGroupPresentModeFlagBitsKHR -> IO ()
DeviceGroupPresentModeFlagBitsKHR -> Int
forall b. Ptr b -> Int -> IO DeviceGroupPresentModeFlagBitsKHR
forall b.
Ptr b -> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> DeviceGroupPresentModeFlagBitsKHR -> IO ()
$cpoke :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> DeviceGroupPresentModeFlagBitsKHR -> IO ()
peek :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO DeviceGroupPresentModeFlagBitsKHR
$cpeek :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> IO DeviceGroupPresentModeFlagBitsKHR
pokeByteOff :: forall b.
Ptr b -> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DeviceGroupPresentModeFlagBitsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DeviceGroupPresentModeFlagBitsKHR
pokeElemOff :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
$cpokeElemOff :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> DeviceGroupPresentModeFlagBitsKHR -> IO ()
peekElemOff :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> IO DeviceGroupPresentModeFlagBitsKHR
$cpeekElemOff :: ("pModes" ::: Ptr DeviceGroupPresentModeFlagBitsKHR)
-> Int -> IO DeviceGroupPresentModeFlagBitsKHR
alignment :: DeviceGroupPresentModeFlagBitsKHR -> Int
$calignment :: DeviceGroupPresentModeFlagBitsKHR -> Int
sizeOf :: DeviceGroupPresentModeFlagBitsKHR -> Int
$csizeOf :: DeviceGroupPresentModeFlagBitsKHR -> Int
Storable, DeviceGroupPresentModeFlagBitsKHR
forall a. a -> Zero a
zero :: DeviceGroupPresentModeFlagBitsKHR
$czero :: DeviceGroupPresentModeFlagBitsKHR
Zero, Eq DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR
Int -> DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR -> Bool
DeviceGroupPresentModeFlagBitsKHR -> Int
DeviceGroupPresentModeFlagBitsKHR -> Maybe Int
DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR -> Int -> Bool
DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: DeviceGroupPresentModeFlagBitsKHR -> Int
$cpopCount :: DeviceGroupPresentModeFlagBitsKHR -> Int
rotateR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$crotateR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
rotateL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$crotateL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
unsafeShiftR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cunsafeShiftR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
shiftR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cshiftR :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
unsafeShiftL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cunsafeShiftL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
shiftL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cshiftL :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
isSigned :: DeviceGroupPresentModeFlagBitsKHR -> Bool
$cisSigned :: DeviceGroupPresentModeFlagBitsKHR -> Bool
bitSize :: DeviceGroupPresentModeFlagBitsKHR -> Int
$cbitSize :: DeviceGroupPresentModeFlagBitsKHR -> Int
bitSizeMaybe :: DeviceGroupPresentModeFlagBitsKHR -> Maybe Int
$cbitSizeMaybe :: DeviceGroupPresentModeFlagBitsKHR -> Maybe Int
testBit :: DeviceGroupPresentModeFlagBitsKHR -> Int -> Bool
$ctestBit :: DeviceGroupPresentModeFlagBitsKHR -> Int -> Bool
complementBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$ccomplementBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
clearBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cclearBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
setBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$csetBit :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
bit :: Int -> DeviceGroupPresentModeFlagBitsKHR
$cbit :: Int -> DeviceGroupPresentModeFlagBitsKHR
zeroBits :: DeviceGroupPresentModeFlagBitsKHR
$czeroBits :: DeviceGroupPresentModeFlagBitsKHR
rotate :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$crotate :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
shift :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
$cshift :: DeviceGroupPresentModeFlagBitsKHR
-> Int -> DeviceGroupPresentModeFlagBitsKHR
complement :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$ccomplement :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
xor :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$cxor :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
.|. :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$c.|. :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
.&. :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
$c.&. :: DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
-> DeviceGroupPresentModeFlagBitsKHR
Bits, Bits DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: DeviceGroupPresentModeFlagBitsKHR -> Int
$ccountTrailingZeros :: DeviceGroupPresentModeFlagBitsKHR -> Int
countLeadingZeros :: DeviceGroupPresentModeFlagBitsKHR -> Int
$ccountLeadingZeros :: DeviceGroupPresentModeFlagBitsKHR -> Int
finiteBitSize :: DeviceGroupPresentModeFlagBitsKHR -> Int
$cfiniteBitSize :: DeviceGroupPresentModeFlagBitsKHR -> Int
FiniteBits)

-- | 'DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR' specifies that any physical
-- device with a presentation engine /can/ present its own swapchain
-- images.
pattern $bDEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
$mDEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR :: forall {r}.
DeviceGroupPresentModeFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = DeviceGroupPresentModeFlagBitsKHR 0x00000001

-- | 'DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR' specifies that any physical
-- device with a presentation engine /can/ present swapchain images from
-- any physical device in its @presentMask@.
pattern $bDEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
$mDEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR :: forall {r}.
DeviceGroupPresentModeFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = DeviceGroupPresentModeFlagBitsKHR 0x00000002

-- | 'DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR' specifies that any physical
-- device with a presentation engine /can/ present the sum of swapchain
-- images from any physical devices in its @presentMask@.
pattern $bDEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
$mDEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR :: forall {r}.
DeviceGroupPresentModeFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = DeviceGroupPresentModeFlagBitsKHR 0x00000004

-- | 'DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR' specifies that
-- multiple physical devices with a presentation engine /can/ each present
-- their own swapchain images.
pattern $bDEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR :: DeviceGroupPresentModeFlagBitsKHR
$mDEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR :: forall {r}.
DeviceGroupPresentModeFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = DeviceGroupPresentModeFlagBitsKHR 0x00000008

conNameDeviceGroupPresentModeFlagBitsKHR :: String
conNameDeviceGroupPresentModeFlagBitsKHR :: String
conNameDeviceGroupPresentModeFlagBitsKHR = String
"DeviceGroupPresentModeFlagBitsKHR"

enumPrefixDeviceGroupPresentModeFlagBitsKHR :: String
enumPrefixDeviceGroupPresentModeFlagBitsKHR :: String
enumPrefixDeviceGroupPresentModeFlagBitsKHR = String
"DEVICE_GROUP_PRESENT_MODE_"

showTableDeviceGroupPresentModeFlagBitsKHR :: [(DeviceGroupPresentModeFlagBitsKHR, String)]
showTableDeviceGroupPresentModeFlagBitsKHR :: [(DeviceGroupPresentModeFlagBitsKHR, String)]
showTableDeviceGroupPresentModeFlagBitsKHR =
  [
    ( DeviceGroupPresentModeFlagBitsKHR
DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR
    , String
"LOCAL_BIT_KHR"
    )
  ,
    ( DeviceGroupPresentModeFlagBitsKHR
DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR
    , String
"REMOTE_BIT_KHR"
    )
  ,
    ( DeviceGroupPresentModeFlagBitsKHR
DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR
    , String
"SUM_BIT_KHR"
    )
  ,
    ( DeviceGroupPresentModeFlagBitsKHR
DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR
    , String
"LOCAL_MULTI_DEVICE_BIT_KHR"
    )
  ]

instance Show DeviceGroupPresentModeFlagBitsKHR where
  showsPrec :: Int -> DeviceGroupPresentModeFlagBitsKHR -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixDeviceGroupPresentModeFlagBitsKHR
      [(DeviceGroupPresentModeFlagBitsKHR, String)]
showTableDeviceGroupPresentModeFlagBitsKHR
      String
conNameDeviceGroupPresentModeFlagBitsKHR
      (\(DeviceGroupPresentModeFlagBitsKHR Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read DeviceGroupPresentModeFlagBitsKHR where
  readPrec :: ReadPrec DeviceGroupPresentModeFlagBitsKHR
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixDeviceGroupPresentModeFlagBitsKHR
      [(DeviceGroupPresentModeFlagBitsKHR, String)]
showTableDeviceGroupPresentModeFlagBitsKHR
      String
conNameDeviceGroupPresentModeFlagBitsKHR
      Flags -> DeviceGroupPresentModeFlagBitsKHR
DeviceGroupPresentModeFlagBitsKHR

type SwapchainCreateFlagsKHR = SwapchainCreateFlagBitsKHR

-- | VkSwapchainCreateFlagBitsKHR - Bitmask controlling swapchain creation
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>,
-- 'SwapchainCreateFlagsKHR'
newtype SwapchainCreateFlagBitsKHR = SwapchainCreateFlagBitsKHR Flags
  deriving newtype (SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c/= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
== :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c== :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
Eq, Eq SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> Ordering
SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$cmin :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
max :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$cmax :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
>= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c>= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
> :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c> :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
<= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c<= :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
< :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
$c< :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR -> Bool
compare :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> Ordering
$ccompare :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> Ordering
Ord, Ptr SwapchainCreateFlagBitsKHR -> IO SwapchainCreateFlagBitsKHR
Ptr SwapchainCreateFlagBitsKHR
-> Int -> IO SwapchainCreateFlagBitsKHR
Ptr SwapchainCreateFlagBitsKHR
-> Int -> SwapchainCreateFlagBitsKHR -> IO ()
Ptr SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> IO ()
SwapchainCreateFlagBitsKHR -> Int
forall b. Ptr b -> Int -> IO SwapchainCreateFlagBitsKHR
forall b. Ptr b -> Int -> SwapchainCreateFlagBitsKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> IO ()
$cpoke :: Ptr SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> IO ()
peek :: Ptr SwapchainCreateFlagBitsKHR -> IO SwapchainCreateFlagBitsKHR
$cpeek :: Ptr SwapchainCreateFlagBitsKHR -> IO SwapchainCreateFlagBitsKHR
pokeByteOff :: forall b. Ptr b -> Int -> SwapchainCreateFlagBitsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> SwapchainCreateFlagBitsKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO SwapchainCreateFlagBitsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SwapchainCreateFlagBitsKHR
pokeElemOff :: Ptr SwapchainCreateFlagBitsKHR
-> Int -> SwapchainCreateFlagBitsKHR -> IO ()
$cpokeElemOff :: Ptr SwapchainCreateFlagBitsKHR
-> Int -> SwapchainCreateFlagBitsKHR -> IO ()
peekElemOff :: Ptr SwapchainCreateFlagBitsKHR
-> Int -> IO SwapchainCreateFlagBitsKHR
$cpeekElemOff :: Ptr SwapchainCreateFlagBitsKHR
-> Int -> IO SwapchainCreateFlagBitsKHR
alignment :: SwapchainCreateFlagBitsKHR -> Int
$calignment :: SwapchainCreateFlagBitsKHR -> Int
sizeOf :: SwapchainCreateFlagBitsKHR -> Int
$csizeOf :: SwapchainCreateFlagBitsKHR -> Int
Storable, SwapchainCreateFlagBitsKHR
forall a. a -> Zero a
zero :: SwapchainCreateFlagBitsKHR
$czero :: SwapchainCreateFlagBitsKHR
Zero, Eq SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR
Int -> SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR -> Bool
SwapchainCreateFlagBitsKHR -> Int
SwapchainCreateFlagBitsKHR -> Maybe Int
SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR -> Int -> Bool
SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: SwapchainCreateFlagBitsKHR -> Int
$cpopCount :: SwapchainCreateFlagBitsKHR -> Int
rotateR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$crotateR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
rotateL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$crotateL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
unsafeShiftR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cunsafeShiftR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
shiftR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cshiftR :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
unsafeShiftL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cunsafeShiftL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
shiftL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cshiftL :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
isSigned :: SwapchainCreateFlagBitsKHR -> Bool
$cisSigned :: SwapchainCreateFlagBitsKHR -> Bool
bitSize :: SwapchainCreateFlagBitsKHR -> Int
$cbitSize :: SwapchainCreateFlagBitsKHR -> Int
bitSizeMaybe :: SwapchainCreateFlagBitsKHR -> Maybe Int
$cbitSizeMaybe :: SwapchainCreateFlagBitsKHR -> Maybe Int
testBit :: SwapchainCreateFlagBitsKHR -> Int -> Bool
$ctestBit :: SwapchainCreateFlagBitsKHR -> Int -> Bool
complementBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$ccomplementBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
clearBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cclearBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
setBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$csetBit :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
bit :: Int -> SwapchainCreateFlagBitsKHR
$cbit :: Int -> SwapchainCreateFlagBitsKHR
zeroBits :: SwapchainCreateFlagBitsKHR
$czeroBits :: SwapchainCreateFlagBitsKHR
rotate :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$crotate :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
shift :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
$cshift :: SwapchainCreateFlagBitsKHR -> Int -> SwapchainCreateFlagBitsKHR
complement :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$ccomplement :: SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
xor :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$cxor :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
.|. :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$c.|. :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
.&. :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
$c.&. :: SwapchainCreateFlagBitsKHR
-> SwapchainCreateFlagBitsKHR -> SwapchainCreateFlagBitsKHR
Bits, Bits SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: SwapchainCreateFlagBitsKHR -> Int
$ccountTrailingZeros :: SwapchainCreateFlagBitsKHR -> Int
countLeadingZeros :: SwapchainCreateFlagBitsKHR -> Int
$ccountLeadingZeros :: SwapchainCreateFlagBitsKHR -> Int
finiteBitSize :: SwapchainCreateFlagBitsKHR -> Int
$cfiniteBitSize :: SwapchainCreateFlagBitsKHR -> Int
FiniteBits)

-- | 'SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT' specifies that the
-- implementation /may/ defer allocation of memory associated with each
-- swapchain image until its index is to be returned from
-- 'acquireNextImageKHR' or 'acquireNextImage2KHR' for the first time.
pattern $bSWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT :: SwapchainCreateFlagBitsKHR
$mSWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT :: forall {r}.
SwapchainCreateFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = SwapchainCreateFlagBitsKHR 0x00000008

-- | 'SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR' specifies that the images of
-- the swapchain /can/ be used to create a
-- 'Vulkan.Core10.Handles.ImageView' with a different format than what the
-- swapchain was created with. The list of allowed image view formats is
-- specified by adding a
-- 'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo'
-- structure to the @pNext@ chain of 'SwapchainCreateInfoKHR'. 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.
pattern $bSWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR :: SwapchainCreateFlagBitsKHR
$mSWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR :: forall {r}.
SwapchainCreateFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = SwapchainCreateFlagBitsKHR 0x00000004

-- | 'SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR' specifies that
-- images created from the swapchain (i.e. with the @swapchain@ member of
-- 'ImageSwapchainCreateInfoKHR' set to this swapchain’s handle) /must/ use
-- 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT'.
pattern $bSWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR :: SwapchainCreateFlagBitsKHR
$mSWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR :: forall {r}.
SwapchainCreateFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = SwapchainCreateFlagBitsKHR 0x00000001

-- | 'SWAPCHAIN_CREATE_PROTECTED_BIT_KHR' specifies that images created from
-- the swapchain are protected images.
pattern $bSWAPCHAIN_CREATE_PROTECTED_BIT_KHR :: SwapchainCreateFlagBitsKHR
$mSWAPCHAIN_CREATE_PROTECTED_BIT_KHR :: forall {r}.
SwapchainCreateFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = SwapchainCreateFlagBitsKHR 0x00000002

conNameSwapchainCreateFlagBitsKHR :: String
conNameSwapchainCreateFlagBitsKHR :: String
conNameSwapchainCreateFlagBitsKHR = String
"SwapchainCreateFlagBitsKHR"

enumPrefixSwapchainCreateFlagBitsKHR :: String
enumPrefixSwapchainCreateFlagBitsKHR :: String
enumPrefixSwapchainCreateFlagBitsKHR = String
"SWAPCHAIN_CREATE_"

showTableSwapchainCreateFlagBitsKHR :: [(SwapchainCreateFlagBitsKHR, String)]
showTableSwapchainCreateFlagBitsKHR :: [(SwapchainCreateFlagBitsKHR, String)]
showTableSwapchainCreateFlagBitsKHR =
  [
    ( SwapchainCreateFlagBitsKHR
SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT
    , String
"DEFERRED_MEMORY_ALLOCATION_BIT_EXT"
    )
  ,
    ( SwapchainCreateFlagBitsKHR
SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR
    , String
"MUTABLE_FORMAT_BIT_KHR"
    )
  ,
    ( SwapchainCreateFlagBitsKHR
SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR
    , String
"SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR"
    )
  ,
    ( SwapchainCreateFlagBitsKHR
SWAPCHAIN_CREATE_PROTECTED_BIT_KHR
    , String
"PROTECTED_BIT_KHR"
    )
  ]

instance Show SwapchainCreateFlagBitsKHR where
  showsPrec :: Int -> SwapchainCreateFlagBitsKHR -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixSwapchainCreateFlagBitsKHR
      [(SwapchainCreateFlagBitsKHR, String)]
showTableSwapchainCreateFlagBitsKHR
      String
conNameSwapchainCreateFlagBitsKHR
      (\(SwapchainCreateFlagBitsKHR Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read SwapchainCreateFlagBitsKHR where
  readPrec :: ReadPrec SwapchainCreateFlagBitsKHR
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixSwapchainCreateFlagBitsKHR
      [(SwapchainCreateFlagBitsKHR, String)]
showTableSwapchainCreateFlagBitsKHR
      String
conNameSwapchainCreateFlagBitsKHR
      Flags -> SwapchainCreateFlagBitsKHR
SwapchainCreateFlagBitsKHR

type KHR_SWAPCHAIN_SPEC_VERSION = 70

-- No documentation found for TopLevel "VK_KHR_SWAPCHAIN_SPEC_VERSION"
pattern KHR_SWAPCHAIN_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_SWAPCHAIN_SPEC_VERSION :: forall a. Integral a => a
$mKHR_SWAPCHAIN_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_SWAPCHAIN_SPEC_VERSION = 70


type KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain"

-- No documentation found for TopLevel "VK_KHR_SWAPCHAIN_EXTENSION_NAME"
pattern KHR_SWAPCHAIN_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_SWAPCHAIN_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_SWAPCHAIN_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain"