{-# language CPP #-}
-- | = Name
--
-- VK_EXT_present_timing - device extension
--
-- = VK_EXT_present_timing
--
-- [__Name String__]
--     @VK_EXT_present_timing@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     209
--
-- [__Revision__]
--     3
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_present_id2 VK_KHR_present_id2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_surface_capabilities2 VK_KHR_get_surface_capabilities2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_calibrated_timestamps VK_KHR_calibrated_timestamps>
--
-- [__Contact__]
--
--     -   Lionel Duc
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_present_timing] @nvlduc%0A*Here describe the issue or question you have about the VK_EXT_present_timing extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_EXT_present_timing.adoc VK_EXT_present_timing>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2024-10-09
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Ian Elliott, Google
--
--     -   James Jones, NVIDIA
--
--     -   Jeff Juliano, NVIDIA
--
--     -   Daniel Rakos, AMD
--
--     -   Daniel Stone, Collabora
--
--     -   Daniel Vetter, Intel
--
--     -   Aric Cyr, AMD
--
--     -   Faith Ekstrand, Intel
--
--     -   Nicolai Hähnle, AMD
--
--     -   Alon Or-Bach, Samsung
--
--     -   Niklas Smedberg, Unity Technologies
--
--     -   Tobias Hector, AMD
--
--     -   Lionel Duc, NVIDIA
--
--     -   Lina Versace, Google
--
--     -   Sebastian Wick, Red Hat
--
--     -   Jakob Bornecrantz, Collabora
--
--     -   David Kvasnica, NVIDIA
--
-- == Description
--
-- This device extension allows an application that uses the
-- @VK_KHR_swapchain@ extension to obtain information about the
-- presentation engine’s display, to obtain timing information about each
-- present, and to schedule a present to happen no earlier than a desired
-- time. An application can use this to minimize various visual anomalies
-- (e.g. stuttering).
--
-- Traditional game and real-time animation applications need to correctly
-- position their geometry for when the presentable image will be presented
-- to the user. To accomplish this, applications need various timing
-- information about the presentation engine’s display. They need to know
-- when presentable images were actually presented, and when they could
-- have been presented. Applications also need to tell the presentation
-- engine to display an image no sooner than a given time. This allows the
-- application to avoid stuttering, so the animation looks smooth to the
-- user.
--
-- == New Commands
--
-- -   'getPastPresentationTimingEXT'
--
-- -   'getSwapchainTimeDomainPropertiesEXT'
--
-- -   'getSwapchainTimingPropertiesEXT'
--
-- -   'setSwapchainPresentTimingQueueSizeEXT'
--
-- == New Structures
--
-- -   'PastPresentationTimingEXT'
--
-- -   'PastPresentationTimingInfoEXT'
--
-- -   'PastPresentationTimingPropertiesEXT'
--
-- -   'PresentStageTimeEXT'
--
-- -   'PresentTimingInfoEXT'
--
-- -   'SwapchainTimeDomainPropertiesEXT'
--
-- -   'SwapchainTimingPropertiesEXT'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_calibrated_timestamps.CalibratedTimestampInfoKHR':
--
--     -   'SwapchainCalibratedTimestampInfoEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDevicePresentTimingFeaturesEXT'
--
-- -   Extending 'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR':
--
--     -   'PresentTimingsInfoEXT'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR':
--
--     -   'PresentTimingSurfaceCapabilitiesEXT'
--
-- == New Enums
--
-- -   'PastPresentationTimingFlagBitsEXT'
--
-- -   'PresentStageFlagBitsEXT'
--
-- -   'PresentTimingInfoFlagBitsEXT'
--
-- == New Bitmasks
--
-- -   'PastPresentationTimingFlagsEXT'
--
-- -   'PresentStageFlagsEXT'
--
-- -   'PresentTimingInfoFlagsEXT'
--
-- == New Enum Constants
--
-- -   'EXT_PRESENT_TIMING_EXTENSION_NAME'
--
-- -   'EXT_PRESENT_TIMING_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_PRESENT_TIMING_QUEUE_FULL_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateFlagBitsKHR':
--
--     -   'Vulkan.Extensions.VK_KHR_swapchain.SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT'
--
-- -   Extending 'TimeDomainKHR':
--
--     -   'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT'
--
--     -   'TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT'
--
-- == Issues
--
-- 1) How does the application determine refresh duration, quanta for
-- change, whether FRR vs. VRR, etc.
--
-- The query returns two values: 1) a refresh-cycle duration
-- (@refreshDuration@), and 2) an indication whether the timing is
-- currently fixed (FRR) or variable (VRR). If @refreshDuration@ is zero,
-- the platform cannot supply these values until after at least one
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' has been done, from
-- this time (e.g. if 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR'
-- has been previously called for this swapchain, at least one additional
-- call must be made). After calling
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR', the query can be
-- repeated until @refreshDuration@ is non-zero, at which point the FRR vs.
-- VRR indication will also be valid.
--
-- If the presentation engine’s @refreshDuration@ is a fixed value, the
-- application’s image present duration (IPD) should be a multiple of
-- @refreshDuration@. That is, the quanta for changing the IPD is
-- @refreshDuration@. For example, if @refreshDuration@ is 16.67ms, the IPD
-- can be 16.67ms, 33.33ms, 50.0ms, etc.
--
-- If the presentation engine’s @refreshDuration@ is variable,
-- @refreshDuration@ is the minimum value of the application’s IPD, and the
-- IPD can be larger by any quanta that is meaningful to the application.
-- For example, if the @refreshDuration@ is 10ms (i.e. the maximum refresh
-- rate is 100Hz), the application can choose an IPD of 11ms, 13.33ms,
-- 13.5ms, or 66.0ms; any value greater than or equal to 10ms is valid.
-- There may be negative consequences for choosing an IPD that is too high,
-- as the presentation engine may actually have a practical maximum
-- @refreshDuration@, where it needs to display the previous image again,
-- and during this time the presentation engine might delay displaying a
-- newly-presented image.
--
-- FRR displays on at least one platform (Wayland) are not necessarily
-- fixed; but can change over time. For example, if a full-screen video
-- player application is visible, the display may operate at a 24Hz refresh
-- cycle; and then later switch to 60Hz when multiple windows are visible.
--
-- VRR displays on some platforms can also be seen as having different
-- characteristics over time. For example, if an application’s window is
-- full-screen-exclusive (i.e. no other window or window system component
-- is visible), the display can look like a VRR display (however that is
-- defined). If the application’s window is not full-screen-exclusive (e.g.
-- a normal multi-window case), the display can look like an FRR display
-- (i.e. because the compositor is trying to treat all windows in a
-- consistent manner). A different issue will deal with how the timing
-- characteristics can change over time.
--
-- 2) Do we return min\/max values for refresh duration for VRR?
--
-- Return only the minimum value of refreshDuration for a VRR.
--
-- VRR displays have a minimum and maximum refresh rate, and therefore a
-- minimum and maximum refreshDuration. It has been asserted that the
-- display effectively does not have a minimum refresh rate. That is
-- because if an application does not present soon enough, the display
-- hardware will automatically re-display the previous image. However, when
-- the display does that, an application cannot present a new image for a
-- certain period of time. It is unclear about whether that period is large
-- enough to cause visual artifacts.
--
-- 3) How to deal with changes in timing properties?
--
-- __RESOLVED__: The 'PastPresentationTimingPropertiesEXT' structure that
-- is returned by 'getPastPresentationTimingEXT' contains
-- @timeDomainsCounter@, which is incremented if the time domain enabled
-- for the swapchain is not currently available.
--
-- An example of why display timing properties can change is if a surface
-- changes from being a window that’s a subset of the display size, to
-- becoming full-screen-exclusive. While the surface was a subset of the
-- display, a compositor might enforce fixed timings on the surface (e.g.
-- FRR of 60Hz), where the presentation engine might be free to allow VRR
-- behavior of a full-screen-exclusive surface.
--
-- It is possible that a full-screen-exclusive window can become
-- temporarily obscured (e.g. when a short-term dialog pops up). In this
-- case, the surface might use FRR timings while the dialog is visible and
-- VRR otherwise.
--
-- 4) One Query for all Timing info vs. an initial query to determine FRR
-- vs. VRR, and then FRR-specific vs VRR-specific queries?
--
-- __RESOLVED__: Have one query, as described in issue 1, that can be
-- called whenever the application needs to obtain the timing properties of
-- the surface.
--
-- 5) Query to determine time domain?
--
-- __RESOLVED__: Have a query to determine the time domain. This extension
-- defines a basic swapchain-local time domain. Other extensions can add
-- other platform-specific time domains.
--
-- 6) What time to use for targetPresentTime for early images?
--
-- __RESOLVED__: Have no query for determining the current time in the PE’s
-- time domain; and do allow the special value of zero for
-- targetPresentTime, meaning that there is no target.
--
-- On some platforms, there is no way to determine the current time, nor to
-- determine surface timing properties until after at least one image has
-- been presented.
--
-- In such cases, the special value of zero allows the application to
-- indicate that timing feedback is desired, but that no targetPresentTime
-- is requested. Later, once the application has obtained feedback, it can
-- specify targetPresentTime by using the result’s actualPresentTime.
--
-- 7) How long before an application’s request for new image duration is
-- honored?
--
-- Apparently, changes to some vendors\' display hardware settings do not
-- take effect immediately. It is not clear what settings, and therefore,
-- it is not clear how to address this issue.
--
-- 8) Do we have a query for the anticipated latency from present to
-- feedback?
--
-- __RESOLVED__: Do not provide a query for the feedback latency.
--
-- There is some amount of latency from when an application calls
-- vkQueuePresentKHR to when the image is displayed to the user, to when
-- feedback is available to the application on when the image was actually
-- displayed to the user. The first time (from the call till the image is
-- presented) generally doesn’t matter, because the application will likely
-- be providing a targetPresentTime (i.e. the application may have some
-- indication for how long this will be). However, the latency between
-- targetPresentTime until feedback is available may be much longer. For
-- example, on Android on the 1st-generation Pixel phone (60Hz FRR
-- display), the latency was approximately 5 refresh cycles (83.33ms). For
-- higher-frequency displays, the latency may have a larger number of
-- refresh cycles.
--
-- 9) Do we have a query(s) about the number of VkPastPresentationTimingEXT
-- structs to keep?
--
-- __RESOLVED__: Do not provide a query for the number of results the
-- swapchain is allowed to store before querying them with
-- vkGetPastPresentationTimingEXT. Let the application specify that value
-- with a dedicated API.
--
-- 10) How is the SWAPCHAIN_LOCAL and STAGE_LOCAL time domain used with the
-- calibrated timestamps extension?
--
-- __RESOLVED__: Define a struct to chain into
-- VkCalibratedTimestampInfoEXT::pNext that specifies a swapchain and
-- present stage.
--
-- 11) Should VK_PRESENT_MODE_FIFO_LATEST_READY_EXT be part of this
-- extension, or split out into its own extension?
--
-- __RESOLVED__: It is only tangentially related. Split it out into its own
-- extension and define the interaction here.
--
-- == Version History
--
-- -   Revision 1, 2018-05-11 (Ian Elliott)
--
--     -   Internal revisions.
--
-- -   Revision 2, 2022-11-30 (Lionel Duc)
--
--     -   Rebase for public discussions.
--
-- -   Revision 3, 2024-10-09 (Lionel Duc)
--
--     -   Public revisions.
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_EXT_present_timing Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_present_timing  ( setSwapchainPresentTimingQueueSizeEXT
                                                , getSwapchainTimingPropertiesEXT
                                                , getSwapchainTimeDomainPropertiesEXT
                                                , getPastPresentationTimingEXT
                                                , PhysicalDevicePresentTimingFeaturesEXT(..)
                                                , PresentTimingSurfaceCapabilitiesEXT(..)
                                                , SwapchainTimingPropertiesEXT(..)
                                                , SwapchainTimeDomainPropertiesEXT(..)
                                                , PresentStageTimeEXT(..)
                                                , PastPresentationTimingInfoEXT(..)
                                                , PastPresentationTimingPropertiesEXT(..)
                                                , PastPresentationTimingEXT(..)
                                                , PresentTimingsInfoEXT(..)
                                                , PresentTimingInfoEXT(..)
                                                , SwapchainCalibratedTimestampInfoEXT(..)
                                                , TimeDomainKHR( TIME_DOMAIN_DEVICE_KHR
                                                               , TIME_DOMAIN_CLOCK_MONOTONIC_KHR
                                                               , TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR
                                                               , TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR
                                                               , TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT
                                                               , TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT
                                                               , ..
                                                               )
                                                , PresentStageFlagsEXT
                                                , PresentStageFlagBitsEXT( PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT
                                                                         , PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT
                                                                         , PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT
                                                                         , PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT
                                                                         , ..
                                                                         )
                                                , PastPresentationTimingFlagsEXT
                                                , PastPresentationTimingFlagBitsEXT( PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT
                                                                                   , PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT
                                                                                   , ..
                                                                                   )
                                                , PresentTimingInfoFlagsEXT
                                                , PresentTimingInfoFlagBitsEXT( PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT
                                                                              , PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT
                                                                              , ..
                                                                              )
                                                , EXT_PRESENT_TIMING_SPEC_VERSION
                                                , pattern EXT_PRESENT_TIMING_SPEC_VERSION
                                                , EXT_PRESENT_TIMING_EXTENSION_NAME
                                                , pattern EXT_PRESENT_TIMING_EXTENSION_NAME
                                                , SwapchainKHR(..)
                                                , SwapchainCreateFlagBitsKHR(..)
                                                , SwapchainCreateFlagsKHR
                                                ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
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 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 (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import GHC.Show (showsPrec)
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 qualified Data.Vector (null)
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.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 Data.Int (Int32)
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.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetPastPresentationTimingEXT))
import Vulkan.Dynamic (DeviceCmds(pVkGetSwapchainTimeDomainPropertiesEXT))
import Vulkan.Dynamic (DeviceCmds(pVkGetSwapchainTimingPropertiesEXT))
import Vulkan.Dynamic (DeviceCmds(pVkSetSwapchainPresentTimingQueueSizeEXT))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (SwapchainKHR)
import Vulkan.Extensions.Handles (SwapchainKHR(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_KHR_swapchain (SwapchainCreateFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_swapchain (SwapchainCreateFlagsKHR)
import Vulkan.Extensions.Handles (SwapchainKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkSetSwapchainPresentTimingQueueSizeEXT
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result) -> Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result

-- | vkSetSwapchainPresentTimingQueueSizeEXT - Allocate memory for the
-- swapchain-internal timing results queue
--
-- = Description
--
-- If this function is called multiple times, the internal queue is
-- reallocated to fit the new @size@. If the new @size@ is less than the
-- current number of outstanding results,
-- 'Vulkan.Core10.Enums.Result.NOT_READY' is returned and no allocation is
-- performed.
--
-- == Valid Usage
--
-- -   #VUID-vkSetSwapchainPresentTimingQueueSizeEXT-swapchain-12229#
--     @swapchain@ /must/ have been created with
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR'::@flags@
--     containing
--     'Vulkan.Extensions.VK_KHR_swapchain.SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkSetSwapchainPresentTimingQueueSizeEXT-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkSetSwapchainPresentTimingQueueSizeEXT-swapchain-parameter#
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkSetSwapchainPresentTimingQueueSizeEXT-swapchain-parent#
--     @swapchain@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /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.NOT_READY'
--
--     -   '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_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.SwapchainKHR'
setSwapchainPresentTimingQueueSizeEXT :: forall io
                                       . (MonadIO io)
                                      => -- | @device@ is the device associated with @swapchain@.
                                         Device
                                      -> -- | @swapchain@ is the swapchain to allocate a results queue for.
                                         SwapchainKHR
                                      -> -- | @size@ is the requested number of slots in the internal results queue.
                                         ("size" ::: Word32)
                                      -> io (Result)
setSwapchainPresentTimingQueueSizeEXT :: forall (io :: * -> *).
MonadIO io =>
Device -> SwapchainKHR -> Word32 -> io Result
setSwapchainPresentTimingQueueSizeEXT Device
device SwapchainKHR
swapchain Word32
size = IO Result -> io Result
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result) -> IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
  let vkSetSwapchainPresentTimingQueueSizeEXTPtr :: FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
vkSetSwapchainPresentTimingQueueSizeEXTPtr = DeviceCmds
-> FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
pVkSetSwapchainPresentTimingQueueSizeEXT (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
vkSetSwapchainPresentTimingQueueSizeEXTPtr FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
-> FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkSetSwapchainPresentTimingQueueSizeEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkSetSwapchainPresentTimingQueueSizeEXT' :: Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result
vkSetSwapchainPresentTimingQueueSizeEXT' = FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
-> Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result
mkVkSetSwapchainPresentTimingQueueSizeEXT FunPtr (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result)
vkSetSwapchainPresentTimingQueueSizeEXTPtr
  r <- String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkSetSwapchainPresentTimingQueueSizeEXT" (Ptr Device_T -> SwapchainKHR -> Word32 -> IO Result
vkSetSwapchainPresentTimingQueueSizeEXT'
                                                                     (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                     (SwapchainKHR
swapchain)
                                                                     (Word32
size))
  when (r < SUCCESS) (throwIO (VulkanException r))
  pure $ (r)


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

-- | vkGetSwapchainTimingPropertiesEXT - Obtain the display timing properties
-- of the PE’s display
--
-- = Description
--
-- If 'getSwapchainTimingPropertiesEXT' returns
-- 'Vulkan.Core10.Enums.Result.NOT_READY', the implementation was not able
-- to determine the current refresh cycle duration. Some platforms /may/
-- not provide timing properties until after at least one image has been
-- presented to the @swapchain@. If timing properties change for the
-- @swapchain@, these platforms /may/ not provide updated results until
-- after at least one additional image has been presented to the
-- @swapchain@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetSwapchainTimingPropertiesEXT-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetSwapchainTimingPropertiesEXT-swapchain-parameter#
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkGetSwapchainTimingPropertiesEXT-pSwapchainTimingProperties-parameter#
--     @pSwapchainTimingProperties@ /must/ be a valid pointer to a
--     'SwapchainTimingPropertiesEXT' structure
--
-- -   #VUID-vkGetSwapchainTimingPropertiesEXT-pSwapchainTimingPropertiesCounter-parameter#
--     If @pSwapchainTimingPropertiesCounter@ is not @NULL@,
--     @pSwapchainTimingPropertiesCounter@ /must/ be a valid pointer to a
--     @uint64_t@ value
--
-- -   #VUID-vkGetSwapchainTimingPropertiesEXT-swapchain-parent#
--     @swapchain@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /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.NOT_READY'
--
--     -   '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_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.SwapchainKHR', 'SwapchainTimingPropertiesEXT'
getSwapchainTimingPropertiesEXT :: forall io
                                 . (MonadIO io)
                                => -- | @device@ is the device associated with @swapchain@.
                                   Device
                                -> -- | @swapchain@ is the swapchain to obtain timing properties for.
                                   SwapchainKHR
                                -> io (Result, SwapchainTimingPropertiesEXT, ("swapchainTimingPropertiesCounter" ::: Word64))
getSwapchainTimingPropertiesEXT :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> io
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
getSwapchainTimingPropertiesEXT Device
device SwapchainKHR
swapchain = IO
  (Result, SwapchainTimingPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO
   (Result, SwapchainTimingPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
 -> io
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> (ContT
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
      IO
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
    -> IO
         (Result, SwapchainTimingPropertiesEXT,
          "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, SwapchainTimingPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
  IO
  (Result, SwapchainTimingPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
-> IO
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, SwapchainTimingPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
   IO
   (Result, SwapchainTimingPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
 -> io
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetSwapchainTimingPropertiesEXTPtr :: FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimingPropertiesEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> Ptr SwapchainTimingPropertiesEXT
      -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
      -> IO Result)
pVkGetSwapchainTimingPropertiesEXT (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO ()
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     ()
forall (m :: * -> *) a.
Monad m =>
m a
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     m
     a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
      IO
      ())
-> IO ()
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimingPropertiesEXTPtr FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> Ptr SwapchainTimingPropertiesEXT
      -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetSwapchainTimingPropertiesEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetSwapchainTimingPropertiesEXT' :: Ptr Device_T
-> SwapchainKHR
-> Ptr SwapchainTimingPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> IO Result
vkGetSwapchainTimingPropertiesEXT' = FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Ptr SwapchainTimingPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> IO Result
mkVkGetSwapchainTimingPropertiesEXT FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimingPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimingPropertiesEXTPtr
  pPSwapchainTimingProperties <- ((Ptr SwapchainTimingPropertiesEXT
  -> IO
       (Result, SwapchainTimingPropertiesEXT,
        "swapchainTimingPropertiesCounter" ::: Word64))
 -> IO
      (Result, SwapchainTimingPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimingPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Ptr SwapchainTimingPropertiesEXT)
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 @SwapchainTimingPropertiesEXT)
  pPSwapchainTimingPropertiesCounter <- ContT $ bracket (callocBytes @Word64 8) free
  r <- lift $ traceAroundEvent "vkGetSwapchainTimingPropertiesEXT" (vkGetSwapchainTimingPropertiesEXT'
                                                                      (deviceHandle (device))
                                                                      (swapchain)
                                                                      (pPSwapchainTimingProperties)
                                                                      (pPSwapchainTimingPropertiesCounter))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pSwapchainTimingProperties <- lift $ peekCStruct @SwapchainTimingPropertiesEXT pPSwapchainTimingProperties
  pSwapchainTimingPropertiesCounter <- lift $ peek @Word64 pPSwapchainTimingPropertiesCounter
  pure $ (r, pSwapchainTimingProperties, pSwapchainTimingPropertiesCounter)


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

-- | vkGetSwapchainTimeDomainPropertiesEXT - Obtain the time domains
-- supported by the PE for the swapchain
--
-- = Description
--
-- If upon return 'SwapchainTimeDomainPropertiesEXT'::@timeDomainCount@ is
-- smaller than the number of time domains supported for the given
-- @swapchain@, 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned
-- instead of 'Vulkan.Core10.Enums.Result.SUCCESS' to indicate that not all
-- the available values were returned.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetSwapchainTimeDomainPropertiesEXT-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetSwapchainTimeDomainPropertiesEXT-swapchain-parameter#
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-vkGetSwapchainTimeDomainPropertiesEXT-pSwapchainTimeDomainProperties-parameter#
--     @pSwapchainTimeDomainProperties@ /must/ be a valid pointer to a
--     'SwapchainTimeDomainPropertiesEXT' structure
--
-- -   #VUID-vkGetSwapchainTimeDomainPropertiesEXT-pTimeDomainsCounter-parameter#
--     If @pTimeDomainsCounter@ is not @NULL@, @pTimeDomainsCounter@ /must/
--     be a valid pointer to a @uint64_t@ value
--
-- -   #VUID-vkGetSwapchainTimeDomainPropertiesEXT-swapchain-parent#
--     @swapchain@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @swapchain@ /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.INCOMPLETE'
--
--     -   '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_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.SwapchainKHR',
-- 'SwapchainTimeDomainPropertiesEXT'
getSwapchainTimeDomainPropertiesEXT :: forall io
                                     . (MonadIO io)
                                    => -- | @device@ is the device associated with @swapchain@.
                                       Device
                                    -> -- | @swapchain@ is the swapchain to obtain time domain properties for.
                                       SwapchainKHR
                                    -> io (Result, SwapchainTimeDomainPropertiesEXT, ("timeDomainsCounter" ::: Word64))
getSwapchainTimeDomainPropertiesEXT :: forall (io :: * -> *).
MonadIO io =>
Device
-> SwapchainKHR
-> io
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
getSwapchainTimeDomainPropertiesEXT Device
device SwapchainKHR
swapchain = IO
  (Result, SwapchainTimeDomainPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO
   (Result, SwapchainTimeDomainPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
 -> io
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> (ContT
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
      IO
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
    -> IO
         (Result, SwapchainTimeDomainPropertiesEXT,
          "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, SwapchainTimeDomainPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
  IO
  (Result, SwapchainTimeDomainPropertiesEXT,
   "swapchainTimingPropertiesCounter" ::: Word64)
-> IO
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, SwapchainTimeDomainPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
   IO
   (Result, SwapchainTimeDomainPropertiesEXT,
    "swapchainTimingPropertiesCounter" ::: Word64)
 -> io
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
-> io
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetSwapchainTimeDomainPropertiesEXTPtr :: FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimeDomainPropertiesEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> Ptr SwapchainTimeDomainPropertiesEXT
      -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
      -> IO Result)
pVkGetSwapchainTimeDomainPropertiesEXT (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO ()
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     ()
forall (m :: * -> *) a.
Monad m =>
m a
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     m
     a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64)
      IO
      ())
-> IO ()
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimeDomainPropertiesEXTPtr FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> SwapchainKHR
      -> Ptr SwapchainTimeDomainPropertiesEXT
      -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetSwapchainTimeDomainPropertiesEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetSwapchainTimeDomainPropertiesEXT' :: Ptr Device_T
-> SwapchainKHR
-> Ptr SwapchainTimeDomainPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> IO Result
vkGetSwapchainTimeDomainPropertiesEXT' = FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
-> Ptr Device_T
-> SwapchainKHR
-> Ptr SwapchainTimeDomainPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> IO Result
mkVkGetSwapchainTimeDomainPropertiesEXT FunPtr
  (Ptr Device_T
   -> SwapchainKHR
   -> Ptr SwapchainTimeDomainPropertiesEXT
   -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
   -> IO Result)
vkGetSwapchainTimeDomainPropertiesEXTPtr
  pPSwapchainTimeDomainProperties <- ((Ptr SwapchainTimeDomainPropertiesEXT
  -> IO
       (Result, SwapchainTimeDomainPropertiesEXT,
        "swapchainTimingPropertiesCounter" ::: Word64))
 -> IO
      (Result, SwapchainTimeDomainPropertiesEXT,
       "swapchainTimingPropertiesCounter" ::: Word64))
-> ContT
     (Result, SwapchainTimeDomainPropertiesEXT,
      "swapchainTimingPropertiesCounter" ::: Word64)
     IO
     (Ptr SwapchainTimeDomainPropertiesEXT)
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 @SwapchainTimeDomainPropertiesEXT)
  pPTimeDomainsCounter <- ContT $ bracket (callocBytes @Word64 8) free
  r <- lift $ traceAroundEvent "vkGetSwapchainTimeDomainPropertiesEXT" (vkGetSwapchainTimeDomainPropertiesEXT'
                                                                          (deviceHandle (device))
                                                                          (swapchain)
                                                                          (pPSwapchainTimeDomainProperties)
                                                                          (pPTimeDomainsCounter))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pSwapchainTimeDomainProperties <- lift $ peekCStruct @SwapchainTimeDomainPropertiesEXT pPSwapchainTimeDomainProperties
  pTimeDomainsCounter <- lift $ peek @Word64 pPTimeDomainsCounter
  pure $ (r, pSwapchainTimeDomainProperties, pTimeDomainsCounter)


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

-- | vkGetPastPresentationTimingEXT - Obtain timing of previously-presented
-- images
--
-- = Description
--
-- If upon return the value of
-- 'PastPresentationTimingPropertiesEXT'::@presentationTimingCount@ is less
-- than the number of available timing records for the given
-- 'PastPresentationTimingInfoEXT'::@swapchain@,
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' is returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS' to indicate that not all the
-- available values were returned.
--
-- Upon return, zero or more slots of the @swapchain@ internal timing
-- results queue, equal to the number of entries written to
-- 'PastPresentationTimingPropertiesEXT'::@pPresentationTimings@ for which
-- @reportComplete@ is 'Vulkan.Core10.FundamentalTypes.TRUE', are made
-- available for future
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' calls. Elements of
-- @pPresentationTimings@ are arranged in ascending order of present ids.
--
-- Timing information /may/ become available out of order with regards to
-- their associated 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR'
-- order. 'PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT'
-- /can/ be set in 'PastPresentationTimingInfoEXT'::@flags@ to allow
-- 'getPastPresentationTimingEXT' to return results in that same order.
-- Otherwise, results are returned in the order of their associated
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' calls.
--
-- There is no requirement for any precise timing relationship between the
-- completion of a present stage and the availability of any associated
-- timing information. However, results /must/ be made available in finite
-- time.
--
-- As an exception to the normal rules for objects which are externally
-- synchronized, @swapchain@ /may/ be simultaneously used by other threads
-- in calls to functions other than
-- 'Vulkan.Extensions.VK_KHR_swapchain.destroySwapchainKHR' and
-- 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR' with @swapchain@
-- used as an @oldSwapchain@. Access to the swapchain timing information
-- /must/ be atomic within the implementation.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPastPresentationTimingEXT-flags-12230# If
--     'PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT' is set
--     in 'PastPresentationTimingInfoEXT'::@flags@, the @presentStageCount@
--     value of each element of
--     'PastPresentationTimingPropertiesEXT'::@pPresentationTimings@ /must/
--     be at least the maximum number of present stages set in
--     'PresentTimingInfoEXT'::@presentStageQueries@ among all
--     'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' calls, with a
--     non-zero @presentStageQueries@, for which complete results have not
--     been returned yet by a previous call
--
-- -   #VUID-vkGetPastPresentationTimingEXT-flags-12231# If
--     'PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT' is not
--     set in 'PastPresentationTimingInfoEXT'::@flags@, the
--     @presentStageCount@ value of each element of
--     'PastPresentationTimingPropertiesEXT'::@pPresentationTimings@ /must/
--     be at least the number of present stages set in
--     'PresentTimingInfoEXT'::@presentStageQueries@ for the earliest call
--     to 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR', with a
--     non-zero @presentStageQueries@, that corresponds to that element’s
--     index and for which complete results have not been returned yet by a
--     previous call
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPastPresentationTimingEXT-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetPastPresentationTimingEXT-pPastPresentationTimingInfo-parameter#
--     @pPastPresentationTimingInfo@ /must/ be a valid pointer to a valid
--     'PastPresentationTimingInfoEXT' structure
--
-- -   #VUID-vkGetPastPresentationTimingEXT-pPastPresentationTimingProperties-parameter#
--     @pPastPresentationTimingProperties@ /must/ be a valid pointer to a
--     'PastPresentationTimingPropertiesEXT' structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
--     -   '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_DEVICE_LOST'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Handles.Device', 'PastPresentationTimingInfoEXT',
-- 'PastPresentationTimingPropertiesEXT'
getPastPresentationTimingEXT :: forall io
                              . (MonadIO io)
                             => -- | @device@ is the device associated with @swapchain@.
                                Device
                             -> -- | @pPastPresentationTimingInfo@ is a pointer to an instance of the
                                -- 'PastPresentationTimingInfoEXT' structure.
                                PastPresentationTimingInfoEXT
                             -> io (Result, PastPresentationTimingPropertiesEXT)
getPastPresentationTimingEXT :: forall (io :: * -> *).
MonadIO io =>
Device
-> PastPresentationTimingInfoEXT
-> io (Result, PastPresentationTimingPropertiesEXT)
getPastPresentationTimingEXT Device
device
                               PastPresentationTimingInfoEXT
pastPresentationTimingInfo = IO (Result, PastPresentationTimingPropertiesEXT)
-> io (Result, PastPresentationTimingPropertiesEXT)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, PastPresentationTimingPropertiesEXT)
 -> io (Result, PastPresentationTimingPropertiesEXT))
-> (ContT
      (Result, PastPresentationTimingPropertiesEXT)
      IO
      (Result, PastPresentationTimingPropertiesEXT)
    -> IO (Result, PastPresentationTimingPropertiesEXT))
-> ContT
     (Result, PastPresentationTimingPropertiesEXT)
     IO
     (Result, PastPresentationTimingPropertiesEXT)
-> io (Result, PastPresentationTimingPropertiesEXT)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, PastPresentationTimingPropertiesEXT)
  IO
  (Result, PastPresentationTimingPropertiesEXT)
-> IO (Result, PastPresentationTimingPropertiesEXT)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, PastPresentationTimingPropertiesEXT)
   IO
   (Result, PastPresentationTimingPropertiesEXT)
 -> io (Result, PastPresentationTimingPropertiesEXT))
-> ContT
     (Result, PastPresentationTimingPropertiesEXT)
     IO
     (Result, PastPresentationTimingPropertiesEXT)
-> io (Result, PastPresentationTimingPropertiesEXT)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPastPresentationTimingEXTPtr :: FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
vkGetPastPresentationTimingEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr PastPresentationTimingInfoEXT
      -> Ptr PastPresentationTimingPropertiesEXT
      -> IO Result)
pVkGetPastPresentationTimingEXT (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT (Result, PastPresentationTimingPropertiesEXT) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (Result, PastPresentationTimingPropertiesEXT) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT (Result, PastPresentationTimingPropertiesEXT) IO ())
-> IO ()
-> ContT (Result, PastPresentationTimingPropertiesEXT) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
vkGetPastPresentationTimingEXTPtr FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr PastPresentationTimingInfoEXT
      -> Ptr PastPresentationTimingPropertiesEXT
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPastPresentationTimingEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPastPresentationTimingEXT' :: Ptr Device_T
-> Ptr PastPresentationTimingInfoEXT
-> Ptr PastPresentationTimingPropertiesEXT
-> IO Result
vkGetPastPresentationTimingEXT' = FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
-> Ptr Device_T
-> Ptr PastPresentationTimingInfoEXT
-> Ptr PastPresentationTimingPropertiesEXT
-> IO Result
mkVkGetPastPresentationTimingEXT FunPtr
  (Ptr Device_T
   -> Ptr PastPresentationTimingInfoEXT
   -> Ptr PastPresentationTimingPropertiesEXT
   -> IO Result)
vkGetPastPresentationTimingEXTPtr
  pPastPresentationTimingInfo <- ((Ptr PastPresentationTimingInfoEXT
  -> IO (Result, PastPresentationTimingPropertiesEXT))
 -> IO (Result, PastPresentationTimingPropertiesEXT))
-> ContT
     (Result, PastPresentationTimingPropertiesEXT)
     IO
     (Ptr PastPresentationTimingInfoEXT)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PastPresentationTimingInfoEXT
   -> IO (Result, PastPresentationTimingPropertiesEXT))
  -> IO (Result, PastPresentationTimingPropertiesEXT))
 -> ContT
      (Result, PastPresentationTimingPropertiesEXT)
      IO
      (Ptr PastPresentationTimingInfoEXT))
-> ((Ptr PastPresentationTimingInfoEXT
     -> IO (Result, PastPresentationTimingPropertiesEXT))
    -> IO (Result, PastPresentationTimingPropertiesEXT))
-> ContT
     (Result, PastPresentationTimingPropertiesEXT)
     IO
     (Ptr PastPresentationTimingInfoEXT)
forall a b. (a -> b) -> a -> b
$ PastPresentationTimingInfoEXT
-> (Ptr PastPresentationTimingInfoEXT
    -> IO (Result, PastPresentationTimingPropertiesEXT))
-> IO (Result, PastPresentationTimingPropertiesEXT)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PastPresentationTimingInfoEXT
-> (Ptr PastPresentationTimingInfoEXT -> IO b) -> IO b
withCStruct (PastPresentationTimingInfoEXT
pastPresentationTimingInfo)
  pPPastPresentationTimingProperties <- ContT (withZeroCStruct @PastPresentationTimingPropertiesEXT)
  r <- lift $ traceAroundEvent "vkGetPastPresentationTimingEXT" (vkGetPastPresentationTimingEXT'
                                                                   (deviceHandle (device))
                                                                   pPastPresentationTimingInfo
                                                                   (pPPastPresentationTimingProperties))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pPastPresentationTimingProperties <- lift $ peekCStruct @PastPresentationTimingPropertiesEXT pPPastPresentationTimingProperties
  pure $ (r, pPastPresentationTimingProperties)


-- | VkPhysicalDevicePresentTimingFeaturesEXT - Structure indicating support
-- for present timing
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDevicePresentTimingFeaturesEXT' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDevicePresentTimingFeaturesEXT', it /must/ add an instance of
-- the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePresentTimingFeaturesEXT = PhysicalDevicePresentTimingFeaturesEXT
  { -- | #features-presentTiming# @presentTiming@ indicates that the
    -- implementation supports 'getPastPresentationTimingEXT'.
    PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentTiming :: Bool
  , -- | #features-presentAtAbsoluteTime# @presentAtAbsoluteTime@ indicates that
    -- the implementation supports specifying absolute target present times.
    PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentAtAbsoluteTime :: Bool
  , -- | #features-presentAtRelativeTime# @presentAtRelativeTime@ indicates that
    -- the implementation supports specifying relative target present times.
    PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentAtRelativeTime :: Bool
  }
  deriving (Typeable, PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> Bool
(PhysicalDevicePresentTimingFeaturesEXT
 -> PhysicalDevicePresentTimingFeaturesEXT -> Bool)
-> (PhysicalDevicePresentTimingFeaturesEXT
    -> PhysicalDevicePresentTimingFeaturesEXT -> Bool)
-> Eq PhysicalDevicePresentTimingFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> Bool
== :: PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> Bool
$c/= :: PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> Bool
/= :: PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePresentTimingFeaturesEXT)
#endif
deriving instance Show PhysicalDevicePresentTimingFeaturesEXT

instance ToCStruct PhysicalDevicePresentTimingFeaturesEXT where
  withCStruct :: forall b.
PhysicalDevicePresentTimingFeaturesEXT
-> (Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b) -> IO b
withCStruct PhysicalDevicePresentTimingFeaturesEXT
x Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b
f = Int -> (Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePresentTimingFeaturesEXT
p -> Ptr PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> IO b -> IO b
forall b.
Ptr PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentTimingFeaturesEXT
p PhysicalDevicePresentTimingFeaturesEXT
x (Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b
f Ptr PhysicalDevicePresentTimingFeaturesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDevicePresentTimingFeaturesEXT
-> PhysicalDevicePresentTimingFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentTimingFeaturesEXT
p PhysicalDevicePresentTimingFeaturesEXT{Bool
presentTiming :: PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentAtAbsoluteTime :: PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentAtRelativeTime :: PhysicalDevicePresentTimingFeaturesEXT -> Bool
presentTiming :: Bool
presentAtAbsoluteTime :: Bool
presentAtRelativeTime :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentTiming))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentAtAbsoluteTime))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentAtRelativeTime))
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePresentTimingFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePresentTimingFeaturesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDevicePresentTimingFeaturesEXT where
  peekCStruct :: Ptr PhysicalDevicePresentTimingFeaturesEXT
-> IO PhysicalDevicePresentTimingFeaturesEXT
peekCStruct Ptr PhysicalDevicePresentTimingFeaturesEXT
p = do
    presentTiming <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePresentTimingFeaturesEXT
p Ptr PhysicalDevicePresentTimingFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    presentAtAbsoluteTime <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    presentAtRelativeTime <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    pure $ PhysicalDevicePresentTimingFeaturesEXT
             (bool32ToBool presentTiming)
             (bool32ToBool presentAtAbsoluteTime)
             (bool32ToBool presentAtRelativeTime)

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

instance Zero PhysicalDevicePresentTimingFeaturesEXT where
  zero :: PhysicalDevicePresentTimingFeaturesEXT
zero = Bool -> Bool -> Bool -> PhysicalDevicePresentTimingFeaturesEXT
PhysicalDevicePresentTimingFeaturesEXT
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPresentTimingSurfaceCapabilitiesEXT - Structure describing present
-- timing capabilities of a surface
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32', 'PresentStageFlagsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PresentTimingSurfaceCapabilitiesEXT = PresentTimingSurfaceCapabilitiesEXT
  { -- | @presentTimingSupported@ indicates whether querying presentation
    -- timestamps is supported for a swapchain created from
    -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'::@surface@.
    PresentTimingSurfaceCapabilitiesEXT -> Bool
presentTimingSupported :: Bool
  , -- | @presentAtAbsoluteTimeSupported@ indicates whether a swapchain created
    -- from
    -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'::@surface@
    -- supports presenting images with absolute times.
    PresentTimingSurfaceCapabilitiesEXT -> Bool
presentAtAbsoluteTimeSupported :: Bool
  , -- | @presentAtRelativeTimeSupported@ indicates whether a swapchain created
    -- from
    -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'::@surface@
    -- supports presenting images with relative times.
    PresentTimingSurfaceCapabilitiesEXT -> Bool
presentAtRelativeTimeSupported :: Bool
  , -- | @presentStageQueries@ is a bitmask of 'PresentStageFlagBitsEXT'
    -- indicating which present stages a swapchain created from
    -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'::@surface@
    -- is able to provide timing information for.
    PresentTimingSurfaceCapabilitiesEXT -> PresentStageFlagsEXT
presentStageQueries :: PresentStageFlagsEXT
  }
  deriving (Typeable, PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> Bool
(PresentTimingSurfaceCapabilitiesEXT
 -> PresentTimingSurfaceCapabilitiesEXT -> Bool)
-> (PresentTimingSurfaceCapabilitiesEXT
    -> PresentTimingSurfaceCapabilitiesEXT -> Bool)
-> Eq PresentTimingSurfaceCapabilitiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> Bool
== :: PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> Bool
$c/= :: PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> Bool
/= :: PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentTimingSurfaceCapabilitiesEXT)
#endif
deriving instance Show PresentTimingSurfaceCapabilitiesEXT

instance ToCStruct PresentTimingSurfaceCapabilitiesEXT where
  withCStruct :: forall b.
PresentTimingSurfaceCapabilitiesEXT
-> (Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b) -> IO b
withCStruct PresentTimingSurfaceCapabilitiesEXT
x Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b
f = Int -> (Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b) -> IO b)
-> (Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PresentTimingSurfaceCapabilitiesEXT
p -> Ptr PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> IO b -> IO b
forall b.
Ptr PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentTimingSurfaceCapabilitiesEXT
p PresentTimingSurfaceCapabilitiesEXT
x (Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b
f Ptr PresentTimingSurfaceCapabilitiesEXT
p)
  pokeCStruct :: forall b.
Ptr PresentTimingSurfaceCapabilitiesEXT
-> PresentTimingSurfaceCapabilitiesEXT -> IO b -> IO b
pokeCStruct Ptr PresentTimingSurfaceCapabilitiesEXT
p PresentTimingSurfaceCapabilitiesEXT{Bool
PresentStageFlagsEXT
presentTimingSupported :: PresentTimingSurfaceCapabilitiesEXT -> Bool
presentAtAbsoluteTimeSupported :: PresentTimingSurfaceCapabilitiesEXT -> Bool
presentAtRelativeTimeSupported :: PresentTimingSurfaceCapabilitiesEXT -> Bool
presentStageQueries :: PresentTimingSurfaceCapabilitiesEXT -> PresentStageFlagsEXT
presentTimingSupported :: Bool
presentAtAbsoluteTimeSupported :: Bool
presentAtRelativeTimeSupported :: Bool
presentStageQueries :: PresentStageFlagsEXT
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentTimingSupported))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentAtAbsoluteTimeSupported))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentAtRelativeTimeSupported))
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT
-> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
presentStageQueries)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PresentTimingSurfaceCapabilitiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PresentTimingSurfaceCapabilitiesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT
-> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PresentTimingSurfaceCapabilitiesEXT where
  peekCStruct :: Ptr PresentTimingSurfaceCapabilitiesEXT
-> IO PresentTimingSurfaceCapabilitiesEXT
peekCStruct Ptr PresentTimingSurfaceCapabilitiesEXT
p = do
    presentTimingSupported <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PresentTimingSurfaceCapabilitiesEXT
p Ptr PresentTimingSurfaceCapabilitiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    presentAtAbsoluteTimeSupported <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    presentAtRelativeTimeSupported <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    presentStageQueries <- peek @PresentStageFlagsEXT ((p `plusPtr` 28 :: Ptr PresentStageFlagsEXT))
    pure $ PresentTimingSurfaceCapabilitiesEXT
             (bool32ToBool presentTimingSupported)
             (bool32ToBool presentAtAbsoluteTimeSupported)
             (bool32ToBool presentAtRelativeTimeSupported)
             presentStageQueries

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

instance Zero PresentTimingSurfaceCapabilitiesEXT where
  zero :: PresentTimingSurfaceCapabilitiesEXT
zero = Bool
-> Bool
-> Bool
-> PresentStageFlagsEXT
-> PresentTimingSurfaceCapabilitiesEXT
PresentTimingSurfaceCapabilitiesEXT
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           PresentStageFlagsEXT
forall a. Zero a => a
zero


-- | VkSwapchainTimingPropertiesEXT - Structure containing the RC duration of
-- a display
--
-- = Description
--
-- If @refreshDuration@ is zero, the presentation engine is not able to
-- determine the duration of the refresh cycle. Similarly, if
-- @refreshInterval@ is zero, the presentation engine is not able to
-- determine whether it is operating in VRR mode.
--
-- Otherwise, if @refreshInterval@ is the same as @refreshDuration@, the
-- presentation engine is operating in FRR mode. In this case,
-- @refreshDuration@ is the number of nanoseconds from the start of one
-- refresh cycle to the start of the next refresh cycle.
--
-- If @refreshInterval@ is @UINT64_MAX@, the presentation engine is
-- operating in VRR mode, and @refreshDuration@ is the minimum number of
-- nanoseconds from the start of one refresh cycle to the start of the next
-- refresh cycle.
--
-- If @refreshDuration@ and @refreshInterval@ are not zero,
-- @refreshInterval@ is a factor of @refreshDuration@.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getSwapchainTimingPropertiesEXT'
data SwapchainTimingPropertiesEXT = SwapchainTimingPropertiesEXT
  { -- | @refreshDuration@ is zero or an indication of the duration of a refresh
    -- cycle.
    SwapchainTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
refreshDuration :: Word64
  , -- | @refreshInterval@ is zero or a duration in nanoseconds indicating the
    -- interval between refresh cycle durations.
    SwapchainTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
refreshInterval :: Word64
  }
  deriving (Typeable, SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> Bool
(SwapchainTimingPropertiesEXT
 -> SwapchainTimingPropertiesEXT -> Bool)
-> (SwapchainTimingPropertiesEXT
    -> SwapchainTimingPropertiesEXT -> Bool)
-> Eq SwapchainTimingPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> Bool
== :: SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> Bool
$c/= :: SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> Bool
/= :: SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainTimingPropertiesEXT)
#endif
deriving instance Show SwapchainTimingPropertiesEXT

instance ToCStruct SwapchainTimingPropertiesEXT where
  withCStruct :: forall b.
SwapchainTimingPropertiesEXT
-> (Ptr SwapchainTimingPropertiesEXT -> IO b) -> IO b
withCStruct SwapchainTimingPropertiesEXT
x Ptr SwapchainTimingPropertiesEXT -> IO b
f = Int -> (Ptr SwapchainTimingPropertiesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr SwapchainTimingPropertiesEXT -> IO b) -> IO b)
-> (Ptr SwapchainTimingPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SwapchainTimingPropertiesEXT
p -> Ptr SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> IO b -> IO b
forall b.
Ptr SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainTimingPropertiesEXT
p SwapchainTimingPropertiesEXT
x (Ptr SwapchainTimingPropertiesEXT -> IO b
f Ptr SwapchainTimingPropertiesEXT
p)
  pokeCStruct :: forall b.
Ptr SwapchainTimingPropertiesEXT
-> SwapchainTimingPropertiesEXT -> IO b -> IO b
pokeCStruct Ptr SwapchainTimingPropertiesEXT
p SwapchainTimingPropertiesEXT{"swapchainTimingPropertiesCounter" ::: Word64
refreshDuration :: SwapchainTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
refreshInterval :: SwapchainTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
refreshDuration :: "swapchainTimingPropertiesCounter" ::: Word64
refreshInterval :: "swapchainTimingPropertiesCounter" ::: Word64
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
refreshDuration)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
refreshInterval)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr SwapchainTimingPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr SwapchainTimingPropertiesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SwapchainTimingPropertiesEXT where
  peekCStruct :: Ptr SwapchainTimingPropertiesEXT -> IO SwapchainTimingPropertiesEXT
peekCStruct Ptr SwapchainTimingPropertiesEXT
p = do
    refreshDuration <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr SwapchainTimingPropertiesEXT
p Ptr SwapchainTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
    refreshInterval <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
    pure $ SwapchainTimingPropertiesEXT
             refreshDuration refreshInterval

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

instance Zero SwapchainTimingPropertiesEXT where
  zero :: SwapchainTimingPropertiesEXT
zero = ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> SwapchainTimingPropertiesEXT
SwapchainTimingPropertiesEXT
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero


-- | VkSwapchainTimeDomainPropertiesEXT - List of available time domains for
-- a swapchain
--
-- = Description
--
-- When calling 'getSwapchainTimeDomainPropertiesEXT', if @pTimeDomains@ is
-- @NULL@ and @pTimeDomainIds@ is @NULL@, then the number of time domains
-- supported for the given @swapchain@ is returned in @timeDomainCount@.
-- Otherwise, @timeDomainCount@ /must/ specify the number of elements in
-- @pTimeDomains@ and @pTimeDomainIds@, and on return is overwritten with
-- the number of values actually written to each array.
--
-- Due to the dynamic nature of their underlying
-- 'Vulkan.Extensions.Handles.SurfaceKHR' properties, swapchains may need
-- to expose multiple swapchain-local opaque time domains using the same
-- 'TimeDomainKHR' value over time, for example when a surface is moved
-- from one display hardware to another. Arbitrary identifiers, provided in
-- @timeDomainIds@, are used by the implementation to differentiate opaque
-- time domains of identical scopes.
--
-- == Valid Usage
--
-- -   #VUID-VkSwapchainTimeDomainPropertiesEXT-pTimeDomains-12370#
--     @pTimeDomains@ and @pTimeDomainIds@ /must/ both be @NULL@ or both
--     not be @NULL@
--
-- -   #VUID-VkSwapchainTimeDomainPropertiesEXT-pTimeDomains-12371# If
--     @pTimeDomains@ and @pTimeDomainIds@ are not @NULL@, then
--     @timeDomainCount@ /must/ not be zero
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSwapchainTimeDomainPropertiesEXT-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT'
--
-- -   #VUID-VkSwapchainTimeDomainPropertiesEXT-pNext-pNext# @pNext@ /must/
--     be @NULL@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'TimeDomainKHR',
-- 'getSwapchainTimeDomainPropertiesEXT'
data SwapchainTimeDomainPropertiesEXT = SwapchainTimeDomainPropertiesEXT
  { -- | @timeDomainCount@ is an integer related to the number of time domains
    -- available or queried, as described below.
    SwapchainTimeDomainPropertiesEXT -> Word32
timeDomainCount :: Word32
  , -- | @pTimeDomains@ is a pointer to an array of 'TimeDomainKHR' values
    -- representing time domains that are available for the swapchain.
    SwapchainTimeDomainPropertiesEXT -> Ptr TimeDomainKHR
timeDomains :: Ptr TimeDomainKHR
  , -- | @pTimeDomainIds@ is a pointer to an array of unique identifiers for each
    -- time domain.
    SwapchainTimeDomainPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
timeDomainIds :: Ptr Word64
  }
  deriving (Typeable, SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> Bool
(SwapchainTimeDomainPropertiesEXT
 -> SwapchainTimeDomainPropertiesEXT -> Bool)
-> (SwapchainTimeDomainPropertiesEXT
    -> SwapchainTimeDomainPropertiesEXT -> Bool)
-> Eq SwapchainTimeDomainPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> Bool
== :: SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> Bool
$c/= :: SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> Bool
/= :: SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainTimeDomainPropertiesEXT)
#endif
deriving instance Show SwapchainTimeDomainPropertiesEXT

instance ToCStruct SwapchainTimeDomainPropertiesEXT where
  withCStruct :: forall b.
SwapchainTimeDomainPropertiesEXT
-> (Ptr SwapchainTimeDomainPropertiesEXT -> IO b) -> IO b
withCStruct SwapchainTimeDomainPropertiesEXT
x Ptr SwapchainTimeDomainPropertiesEXT -> IO b
f = Int -> (Ptr SwapchainTimeDomainPropertiesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr SwapchainTimeDomainPropertiesEXT -> IO b) -> IO b)
-> (Ptr SwapchainTimeDomainPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SwapchainTimeDomainPropertiesEXT
p -> Ptr SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> IO b -> IO b
forall b.
Ptr SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainTimeDomainPropertiesEXT
p SwapchainTimeDomainPropertiesEXT
x (Ptr SwapchainTimeDomainPropertiesEXT -> IO b
f Ptr SwapchainTimeDomainPropertiesEXT
p)
  pokeCStruct :: forall b.
Ptr SwapchainTimeDomainPropertiesEXT
-> SwapchainTimeDomainPropertiesEXT -> IO b -> IO b
pokeCStruct Ptr SwapchainTimeDomainPropertiesEXT
p SwapchainTimeDomainPropertiesEXT{Word32
Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
Ptr TimeDomainKHR
timeDomainCount :: SwapchainTimeDomainPropertiesEXT -> Word32
timeDomains :: SwapchainTimeDomainPropertiesEXT -> Ptr TimeDomainKHR
timeDomainIds :: SwapchainTimeDomainPropertiesEXT
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
timeDomainCount :: Word32
timeDomains :: Ptr TimeDomainKHR
timeDomainIds :: Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
timeDomainCount)
    Ptr (Ptr TimeDomainKHR) -> Ptr TimeDomainKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT
-> Int -> Ptr (Ptr TimeDomainKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr TimeDomainKHR))) (Ptr TimeDomainKHR
timeDomains)
    Ptr (Ptr ("swapchainTimingPropertiesCounter" ::: Word64))
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT
-> Int -> Ptr (Ptr ("swapchainTimingPropertiesCounter" ::: Word64))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Word64))) (Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
timeDomainIds)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr SwapchainTimeDomainPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr SwapchainTimeDomainPropertiesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SwapchainTimeDomainPropertiesEXT where
  peekCStruct :: Ptr SwapchainTimeDomainPropertiesEXT
-> IO SwapchainTimeDomainPropertiesEXT
peekCStruct Ptr SwapchainTimeDomainPropertiesEXT
p = do
    timeDomainCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SwapchainTimeDomainPropertiesEXT
p Ptr SwapchainTimeDomainPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    pTimeDomains <- peek @(Ptr TimeDomainKHR) ((p `plusPtr` 24 :: Ptr (Ptr TimeDomainKHR)))
    pTimeDomainIds <- peek @(Ptr Word64) ((p `plusPtr` 32 :: Ptr (Ptr Word64)))
    pure $ SwapchainTimeDomainPropertiesEXT
             timeDomainCount pTimeDomains pTimeDomainIds

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

instance Zero SwapchainTimeDomainPropertiesEXT where
  zero :: SwapchainTimeDomainPropertiesEXT
zero = Word32
-> Ptr TimeDomainKHR
-> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> SwapchainTimeDomainPropertiesEXT
SwapchainTimeDomainPropertiesEXT
           Word32
forall a. Zero a => a
zero
           Ptr TimeDomainKHR
forall a. Zero a => a
zero
           Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a. Zero a => a
zero


-- | VkPresentStageTimeEXT - Associate a present stage with a timestamp
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PastPresentationTimingEXT', 'PresentStageFlagsEXT'
data PresentStageTimeEXT = PresentStageTimeEXT
  { -- | @stage@ is a 'PresentStageFlagsEXT' value specifying a present stage.
    PresentStageTimeEXT -> PresentStageFlagsEXT
stage :: PresentStageFlagsEXT
  , -- | @time@ is a time in nanoseconds associated with the @stage@.
    PresentStageTimeEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
time :: Word64
  }
  deriving (Typeable, PresentStageTimeEXT -> PresentStageTimeEXT -> Bool
(PresentStageTimeEXT -> PresentStageTimeEXT -> Bool)
-> (PresentStageTimeEXT -> PresentStageTimeEXT -> Bool)
-> Eq PresentStageTimeEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentStageTimeEXT -> PresentStageTimeEXT -> Bool
== :: PresentStageTimeEXT -> PresentStageTimeEXT -> Bool
$c/= :: PresentStageTimeEXT -> PresentStageTimeEXT -> Bool
/= :: PresentStageTimeEXT -> PresentStageTimeEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentStageTimeEXT)
#endif
deriving instance Show PresentStageTimeEXT

instance ToCStruct PresentStageTimeEXT where
  withCStruct :: forall b.
PresentStageTimeEXT -> (Ptr PresentStageTimeEXT -> IO b) -> IO b
withCStruct PresentStageTimeEXT
x Ptr PresentStageTimeEXT -> IO b
f = Int -> (Ptr PresentStageTimeEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr PresentStageTimeEXT -> IO b) -> IO b)
-> (Ptr PresentStageTimeEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PresentStageTimeEXT
p -> Ptr PresentStageTimeEXT -> PresentStageTimeEXT -> IO b -> IO b
forall b.
Ptr PresentStageTimeEXT -> PresentStageTimeEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentStageTimeEXT
p PresentStageTimeEXT
x (Ptr PresentStageTimeEXT -> IO b
f Ptr PresentStageTimeEXT
p)
  pokeCStruct :: forall b.
Ptr PresentStageTimeEXT -> PresentStageTimeEXT -> IO b -> IO b
pokeCStruct Ptr PresentStageTimeEXT
p PresentStageTimeEXT{"swapchainTimingPropertiesCounter" ::: Word64
PresentStageFlagsEXT
stage :: PresentStageTimeEXT -> PresentStageFlagsEXT
time :: PresentStageTimeEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
stage :: PresentStageFlagsEXT
time :: "swapchainTimingPropertiesCounter" ::: Word64
..} IO b
f = do
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentStageTimeEXT
p Ptr PresentStageTimeEXT -> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
stage)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentStageTimeEXT
p Ptr PresentStageTimeEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
time)
    IO b
f
  cStructSize :: Int
cStructSize = Int
16
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PresentStageTimeEXT -> IO b -> IO b
pokeZeroCStruct Ptr PresentStageTimeEXT
p IO b
f = do
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentStageTimeEXT
p Ptr PresentStageTimeEXT -> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentStageTimeEXT
p Ptr PresentStageTimeEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PresentStageTimeEXT where
  peekCStruct :: Ptr PresentStageTimeEXT -> IO PresentStageTimeEXT
peekCStruct Ptr PresentStageTimeEXT
p = do
    stage <- forall a. Storable a => Ptr a -> IO a
peek @PresentStageFlagsEXT ((Ptr PresentStageTimeEXT
p Ptr PresentStageTimeEXT -> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PresentStageFlagsEXT))
    time <- peek @Word64 ((p `plusPtr` 8 :: Ptr Word64))
    pure $ PresentStageTimeEXT
             stage time

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

instance Zero PresentStageTimeEXT where
  zero :: PresentStageTimeEXT
zero = PresentStageFlagsEXT
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> PresentStageTimeEXT
PresentStageTimeEXT
           PresentStageFlagsEXT
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero


-- | VkPastPresentationTimingInfoEXT - Structure specifying swapchain present
-- timing query parameters
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPastPresentationTimingInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXT'
--
-- -   #VUID-VkPastPresentationTimingInfoEXT-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkPastPresentationTimingInfoEXT-flags-parameter# @flags@
--     /must/ be a valid combination of 'PastPresentationTimingFlagBitsEXT'
--     values
--
-- -   #VUID-VkPastPresentationTimingInfoEXT-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_EXT_present_timing VK_EXT_present_timing>,
-- 'PastPresentationTimingFlagsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR', 'getPastPresentationTimingEXT'
data PastPresentationTimingInfoEXT = PastPresentationTimingInfoEXT
  { -- | @flags@ is a bitmask of 'PastPresentationTimingFlagBitsEXT' specifying
    -- options for queries of past presentation timing information.
    PastPresentationTimingInfoEXT -> PastPresentationTimingFlagsEXT
flags :: PastPresentationTimingFlagsEXT
  , -- | @swapchain@ is the swapchain to obtain presentation timing information
    -- for.
    PastPresentationTimingInfoEXT -> SwapchainKHR
swapchain :: SwapchainKHR
  }
  deriving (Typeable, PastPresentationTimingInfoEXT
-> PastPresentationTimingInfoEXT -> Bool
(PastPresentationTimingInfoEXT
 -> PastPresentationTimingInfoEXT -> Bool)
-> (PastPresentationTimingInfoEXT
    -> PastPresentationTimingInfoEXT -> Bool)
-> Eq PastPresentationTimingInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PastPresentationTimingInfoEXT
-> PastPresentationTimingInfoEXT -> Bool
== :: PastPresentationTimingInfoEXT
-> PastPresentationTimingInfoEXT -> Bool
$c/= :: PastPresentationTimingInfoEXT
-> PastPresentationTimingInfoEXT -> Bool
/= :: PastPresentationTimingInfoEXT
-> PastPresentationTimingInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PastPresentationTimingInfoEXT)
#endif
deriving instance Show PastPresentationTimingInfoEXT

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

instance FromCStruct PastPresentationTimingInfoEXT where
  peekCStruct :: Ptr PastPresentationTimingInfoEXT
-> IO PastPresentationTimingInfoEXT
peekCStruct Ptr PastPresentationTimingInfoEXT
p = do
    flags <- forall a. Storable a => Ptr a -> IO a
peek @PastPresentationTimingFlagsEXT ((Ptr PastPresentationTimingInfoEXT
p Ptr PastPresentationTimingInfoEXT
-> Int -> Ptr PastPresentationTimingFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PastPresentationTimingFlagsEXT))
    swapchain <- peek @SwapchainKHR ((p `plusPtr` 24 :: Ptr SwapchainKHR))
    pure $ PastPresentationTimingInfoEXT
             flags swapchain

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

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


-- | VkPastPresentationTimingPropertiesEXT - Structure containing details
-- about a swapchain past presentation activity
--
-- = Description
--
-- When calling 'getPastPresentationTimingEXT', if @pPresentationTimings@
-- is @NULL@, then the number of available timing records for the given
-- @swapchain@ is returned in @presentationTimingCount@. Otherwise,
-- @presentationTimingCount@ /must/ specify the number of elements in the
-- @pPresentationTimings@ array, and on return is overwritten with the
-- number of structures actually written to @pPresentationTimings@.
--
-- if 'PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT' is specified
-- in 'PastPresentationTimingInfoEXT'::@flags@,
-- 'getPastPresentationTimingEXT' /may/ return incomplete results,
-- containing only information for a subset of the requested present
-- stages. Further calls to 'getPastPresentationTimingEXT' will keep
-- providing all available results for a previously incomplete entry until
-- it is complete.
--
-- The implementation /must/ return a 'PastPresentationTimingEXT' for every
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' referencing
-- @swapchain@ where a non-zero
-- 'PresentTimingInfoEXT'::@presentStageQueries@ was specified and at least
-- one present stage has available results.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PastPresentationTimingEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPastPresentationTimingEXT'
data PastPresentationTimingPropertiesEXT = PastPresentationTimingPropertiesEXT
  { -- | @timingPropertiesCounter@ is a 64-bit unsigned integer set by the
    -- implementation to the current value of the swapchain’s internal timing
    -- properties counter.
    PastPresentationTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timingPropertiesCounter :: Word64
  , -- | @timeDomainsCounter@ is a 64-bit unsigned integer set by the
    -- implementation to the current value of the swapchain’s internal time
    -- domains list counter.
    PastPresentationTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainsCounter :: Word64
  , -- | @presentationTimingCount@ is an integer related to the number of
    -- 'PastPresentationTimingEXT' structures available or queried, as
    -- described below.
    PastPresentationTimingPropertiesEXT -> Word32
presentationTimingCount :: Word32
  , -- | @pPresentationTimings@ is @NULL@ or a pointer to an array of
    -- 'PastPresentationTimingEXT' structures.
    PastPresentationTimingPropertiesEXT
-> Ptr PastPresentationTimingEXT
presentationTimings :: Ptr PastPresentationTimingEXT
  }
  deriving (Typeable, PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> Bool
(PastPresentationTimingPropertiesEXT
 -> PastPresentationTimingPropertiesEXT -> Bool)
-> (PastPresentationTimingPropertiesEXT
    -> PastPresentationTimingPropertiesEXT -> Bool)
-> Eq PastPresentationTimingPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> Bool
== :: PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> Bool
$c/= :: PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> Bool
/= :: PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PastPresentationTimingPropertiesEXT)
#endif
deriving instance Show PastPresentationTimingPropertiesEXT

instance ToCStruct PastPresentationTimingPropertiesEXT where
  withCStruct :: forall b.
PastPresentationTimingPropertiesEXT
-> (Ptr PastPresentationTimingPropertiesEXT -> IO b) -> IO b
withCStruct PastPresentationTimingPropertiesEXT
x Ptr PastPresentationTimingPropertiesEXT -> IO b
f = Int -> (Ptr PastPresentationTimingPropertiesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr PastPresentationTimingPropertiesEXT -> IO b) -> IO b)
-> (Ptr PastPresentationTimingPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PastPresentationTimingPropertiesEXT
p -> Ptr PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> IO b -> IO b
forall b.
Ptr PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PastPresentationTimingPropertiesEXT
p PastPresentationTimingPropertiesEXT
x (Ptr PastPresentationTimingPropertiesEXT -> IO b
f Ptr PastPresentationTimingPropertiesEXT
p)
  pokeCStruct :: forall b.
Ptr PastPresentationTimingPropertiesEXT
-> PastPresentationTimingPropertiesEXT -> IO b -> IO b
pokeCStruct Ptr PastPresentationTimingPropertiesEXT
p PastPresentationTimingPropertiesEXT{Word32
"swapchainTimingPropertiesCounter" ::: Word64
Ptr PastPresentationTimingEXT
timingPropertiesCounter :: PastPresentationTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainsCounter :: PastPresentationTimingPropertiesEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
presentationTimingCount :: PastPresentationTimingPropertiesEXT -> Word32
presentationTimings :: PastPresentationTimingPropertiesEXT
-> Ptr PastPresentationTimingEXT
timingPropertiesCounter :: "swapchainTimingPropertiesCounter" ::: Word64
timeDomainsCounter :: "swapchainTimingPropertiesCounter" ::: Word64
presentationTimingCount :: Word32
presentationTimings :: Ptr PastPresentationTimingEXT
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
timingPropertiesCounter)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
timeDomainsCounter)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
presentationTimingCount)
    Ptr (Ptr PastPresentationTimingEXT)
-> Ptr PastPresentationTimingEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr (Ptr PastPresentationTimingEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PastPresentationTimingEXT))) (Ptr PastPresentationTimingEXT
presentationTimings)
    IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PastPresentationTimingPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PastPresentationTimingPropertiesEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr (Ptr PastPresentationTimingEXT)
-> Ptr PastPresentationTimingEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr (Ptr PastPresentationTimingEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PastPresentationTimingEXT))) (Ptr PastPresentationTimingEXT
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PastPresentationTimingPropertiesEXT where
  peekCStruct :: Ptr PastPresentationTimingPropertiesEXT
-> IO PastPresentationTimingPropertiesEXT
peekCStruct Ptr PastPresentationTimingPropertiesEXT
p = do
    timingPropertiesCounter <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PastPresentationTimingPropertiesEXT
p Ptr PastPresentationTimingPropertiesEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
    timeDomainsCounter <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
    presentationTimingCount <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    pPresentationTimings <- peek @(Ptr PastPresentationTimingEXT) ((p `plusPtr` 40 :: Ptr (Ptr PastPresentationTimingEXT)))
    pure $ PastPresentationTimingPropertiesEXT
             timingPropertiesCounter
             timeDomainsCounter
             presentationTimingCount
             pPresentationTimings

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

instance Zero PastPresentationTimingPropertiesEXT where
  zero :: PastPresentationTimingPropertiesEXT
zero = ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> Word32
-> Ptr PastPresentationTimingEXT
-> PastPresentationTimingPropertiesEXT
PastPresentationTimingPropertiesEXT
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Ptr PastPresentationTimingEXT
forall a. Zero a => a
zero


-- | VkPastPresentationTimingEXT - Structure containing timing information
-- about a previously-presented image
--
-- = Description
--
-- When calling 'getPastPresentationTimingEXT', the implementation sets
-- @presentStageCount@ to the number of present stages it has written
-- results for. If 'PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT'
-- was specified in 'PastPresentationTimingInfoEXT'::@flags@, the
-- implementation /may/ return an incomplete report containing fewer
-- present stage results than were queried by the associated presentation
-- request. Otherwise, results for all the present stages queried by the
-- presentation request are written by the implementation.
--
-- Timing information for some present stages /may/ have a time value of 0,
-- indicating that results for that present stage are not available.
--
-- For systems with multiple entities operating within the presentation
-- engine, such as multiple displays, @pPresentStages@ will return timing
-- results for one entity which has been affected by the presentation.
--
-- @timeDomainId@ /may/ be different than the time domain that was
-- specified in 'PresentTimingInfoEXT'::@timeDomainId@ if the requirements
-- for using this time domain could not be met at the time the presentation
-- engine processed the presentation request. In such a case, the
-- presentation engine /may/ pick a time domain to fall back to, if one is
-- available, and report results in that domain. Applications /can/
-- continue to use this fallback time domain in future
-- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' calls, or they
-- /can/ call 'getSwapchainTimeDomainPropertiesEXT' to choose from the
-- currently supported time domains.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'PastPresentationTimingPropertiesEXT', 'PresentStageTimeEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'TimeDomainKHR'
data PastPresentationTimingEXT = PastPresentationTimingEXT
  { -- | @presentId@ is zero or a value that was given to a previous
    -- 'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' command via
    -- 'Vulkan.Extensions.VK_KHR_present_id2.PresentId2KHR'::@pPresentIds@.
    PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
presentId :: Word64
  , -- | @targetTime@ is the application-provided target absolute time or
    -- duration of the associated presentation request in
    -- 'PresentTimingInfoEXT'::@targetTime@.
    PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
targetTime :: Word64
  , -- | @presentStageCount@ is a count of items contained in @pPresentStages@.
    PastPresentationTimingEXT -> Word32
presentStageCount :: Word32
  , -- | @pPresentStages@ a pointer to an array of 'PresentStageTimeEXT'
    -- providing timing information for the presentation request associated
    -- with @presentId@.
    PastPresentationTimingEXT -> Ptr PresentStageTimeEXT
presentStages :: Ptr PresentStageTimeEXT
  , -- | @timeDomain@ is the time domain used by the presentation engine to
    -- report times in @pPresentStages@.
    PastPresentationTimingEXT -> TimeDomainKHR
timeDomain :: TimeDomainKHR
  , -- | @timeDomainId@ is the id associated with @timeDomain@.
    PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainId :: Word64
  , -- | @reportComplete@ is 'Vulkan.Core10.FundamentalTypes.TRUE' if the
    -- presentation engine has reported all the requested results in
    -- @pPresentStages@.
    PastPresentationTimingEXT -> Bool
reportComplete :: Bool
  }
  deriving (Typeable, PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool
(PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool)
-> (PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool)
-> Eq PastPresentationTimingEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool
== :: PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool
$c/= :: PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool
/= :: PastPresentationTimingEXT -> PastPresentationTimingEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PastPresentationTimingEXT)
#endif
deriving instance Show PastPresentationTimingEXT

instance ToCStruct PastPresentationTimingEXT where
  withCStruct :: forall b.
PastPresentationTimingEXT
-> (Ptr PastPresentationTimingEXT -> IO b) -> IO b
withCStruct PastPresentationTimingEXT
x Ptr PastPresentationTimingEXT -> IO b
f = Int -> (Ptr PastPresentationTimingEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
72 ((Ptr PastPresentationTimingEXT -> IO b) -> IO b)
-> (Ptr PastPresentationTimingEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PastPresentationTimingEXT
p -> Ptr PastPresentationTimingEXT
-> PastPresentationTimingEXT -> IO b -> IO b
forall b.
Ptr PastPresentationTimingEXT
-> PastPresentationTimingEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PastPresentationTimingEXT
p PastPresentationTimingEXT
x (Ptr PastPresentationTimingEXT -> IO b
f Ptr PastPresentationTimingEXT
p)
  pokeCStruct :: forall b.
Ptr PastPresentationTimingEXT
-> PastPresentationTimingEXT -> IO b -> IO b
pokeCStruct Ptr PastPresentationTimingEXT
p PastPresentationTimingEXT{Bool
Word32
"swapchainTimingPropertiesCounter" ::: Word64
Ptr PresentStageTimeEXT
TimeDomainKHR
presentId :: PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
targetTime :: PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
presentStageCount :: PastPresentationTimingEXT -> Word32
presentStages :: PastPresentationTimingEXT -> Ptr PresentStageTimeEXT
timeDomain :: PastPresentationTimingEXT -> TimeDomainKHR
timeDomainId :: PastPresentationTimingEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
reportComplete :: PastPresentationTimingEXT -> Bool
presentId :: "swapchainTimingPropertiesCounter" ::: Word64
targetTime :: "swapchainTimingPropertiesCounter" ::: Word64
presentStageCount :: Word32
presentStages :: Ptr PresentStageTimeEXT
timeDomain :: TimeDomainKHR
timeDomainId :: "swapchainTimingPropertiesCounter" ::: Word64
reportComplete :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
presentId)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
targetTime)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
presentStageCount)
    Ptr (Ptr PresentStageTimeEXT) -> Ptr PresentStageTimeEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr (Ptr PresentStageTimeEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PresentStageTimeEXT))) (Ptr PresentStageTimeEXT
presentStages)
    Ptr TimeDomainKHR -> TimeDomainKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr TimeDomainKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr TimeDomainKHR)) (TimeDomainKHR
timeDomain)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
timeDomainId)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
reportComplete))
    IO b
f
  cStructSize :: Int
cStructSize = Int
72
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PastPresentationTimingEXT -> IO b -> IO b
pokeZeroCStruct Ptr PastPresentationTimingEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr (Ptr PresentStageTimeEXT) -> Ptr PresentStageTimeEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr (Ptr PresentStageTimeEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PresentStageTimeEXT))) (Ptr PresentStageTimeEXT
forall a. Zero a => a
zero)
    Ptr TimeDomainKHR -> TimeDomainKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr TimeDomainKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr TimeDomainKHR)) (TimeDomainKHR
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PastPresentationTimingEXT where
  peekCStruct :: Ptr PastPresentationTimingEXT -> IO PastPresentationTimingEXT
peekCStruct Ptr PastPresentationTimingEXT
p = do
    presentId <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PastPresentationTimingEXT
p Ptr PastPresentationTimingEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
    targetTime <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
    presentStageCount <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    pPresentStages <- peek @(Ptr PresentStageTimeEXT) ((p `plusPtr` 40 :: Ptr (Ptr PresentStageTimeEXT)))
    timeDomain <- peek @TimeDomainKHR ((p `plusPtr` 48 :: Ptr TimeDomainKHR))
    timeDomainId <- peek @Word64 ((p `plusPtr` 56 :: Ptr Word64))
    reportComplete <- peek @Bool32 ((p `plusPtr` 64 :: Ptr Bool32))
    pure $ PastPresentationTimingEXT
             presentId
             targetTime
             presentStageCount
             pPresentStages
             timeDomain
             timeDomainId
             (bool32ToBool reportComplete)

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

instance Zero PastPresentationTimingEXT where
  zero :: PastPresentationTimingEXT
zero = ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> Word32
-> Ptr PresentStageTimeEXT
-> TimeDomainKHR
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> Bool
-> PastPresentationTimingEXT
PastPresentationTimingEXT
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Ptr PresentStageTimeEXT
forall a. Zero a => a
zero
           TimeDomainKHR
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPresentTimingsInfoEXT - Array of VkPresentTimingInfoEXT to chain with
-- VkPresentInfoKHR
--
-- == Valid Usage
--
-- -   #VUID-VkPresentTimingsInfoEXT-swapchainCount-12233# @swapchainCount@
--     /must/ be equal to
--     'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR'::@swapchainCount@
--
-- -   #VUID-VkPresentTimingsInfoEXT-pSwapchains-12234# All swapchains in
--     'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR'::@pSwapchains@
--     /must/ have been created with the
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR'::@flags@
--     field containing
--     'Vulkan.Extensions.VK_KHR_swapchain.SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT'
--
-- -   #VUID-VkPresentTimingsInfoEXT-pSwapchains-12235# For each member of
--     'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR'::@pSwapchains@,
--     if the associated 'PresentTimingInfoEXT'::@targetTime@ is not zero,
--     the swapchain’s current present mode /must/ be
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_FIFO_LATEST_READY_KHR',
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_FIFO_KHR' or
--     'Vulkan.Extensions.VK_KHR_surface.PRESENT_MODE_FIFO_RELAXED_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPresentTimingsInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT'
--
-- -   #VUID-VkPresentTimingsInfoEXT-pTimingInfos-parameter# If
--     @pTimingInfos@ is not @NULL@, @pTimingInfos@ /must/ be a valid
--     pointer to an array of @swapchainCount@ valid 'PresentTimingInfoEXT'
--     structures
--
-- -   #VUID-VkPresentTimingsInfoEXT-swapchainCount-arraylength#
--     @swapchainCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PresentTimingInfoEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PresentTimingsInfoEXT = PresentTimingsInfoEXT
  { -- | @swapchainCount@ is the number of swapchains being presented to by this
    -- command.
    PresentTimingsInfoEXT -> Word32
swapchainCount :: Word32
  , -- | @pTimingInfos@ is @NULL@ or a pointer to an array of
    -- 'PresentTimingInfoEXT' elements with @swapchainCount@ entries. If not
    -- @NULL@, each element of @pTimingInfos@ contains timing information for
    -- the presentation of the image corresponding to the entry in the
    -- 'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR'::@pImageIndices@
    -- array.
    PresentTimingsInfoEXT -> Vector PresentTimingInfoEXT
timingInfos :: Vector PresentTimingInfoEXT
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentTimingsInfoEXT)
#endif
deriving instance Show PresentTimingsInfoEXT

instance ToCStruct PresentTimingsInfoEXT where
  withCStruct :: forall b.
PresentTimingsInfoEXT
-> (Ptr PresentTimingsInfoEXT -> IO b) -> IO b
withCStruct PresentTimingsInfoEXT
x Ptr PresentTimingsInfoEXT -> IO b
f = Int -> (Ptr PresentTimingsInfoEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PresentTimingsInfoEXT -> IO b) -> IO b)
-> (Ptr PresentTimingsInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PresentTimingsInfoEXT
p -> Ptr PresentTimingsInfoEXT -> PresentTimingsInfoEXT -> IO b -> IO b
forall b.
Ptr PresentTimingsInfoEXT -> PresentTimingsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentTimingsInfoEXT
p PresentTimingsInfoEXT
x (Ptr PresentTimingsInfoEXT -> IO b
f Ptr PresentTimingsInfoEXT
p)
  pokeCStruct :: forall b.
Ptr PresentTimingsInfoEXT -> PresentTimingsInfoEXT -> IO b -> IO b
pokeCStruct Ptr PresentTimingsInfoEXT
p PresentTimingsInfoEXT{Word32
Vector PresentTimingInfoEXT
swapchainCount :: PresentTimingsInfoEXT -> Word32
timingInfos :: PresentTimingsInfoEXT -> Vector PresentTimingInfoEXT
swapchainCount :: Word32
timingInfos :: Vector PresentTimingInfoEXT
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingsInfoEXT
p Ptr PresentTimingsInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingsInfoEXT
p Ptr PresentTimingsInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    let pTimingInfosLength :: Int
pTimingInfosLength = Vector PresentTimingInfoEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PresentTimingInfoEXT -> Int)
-> Vector PresentTimingInfoEXT -> Int
forall a b. (a -> b) -> a -> b
$ (Vector PresentTimingInfoEXT
timingInfos)
    swapchainCount'' <- IO Word32 -> ContT b IO Word32
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32 -> ContT b IO Word32) -> IO Word32 -> ContT b IO Word32
forall a b. (a -> b) -> a -> b
$ if (Word32
swapchainCount) Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
0
      then Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32 -> IO Word32) -> Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pTimingInfosLength
      else do
        Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pTimingInfosLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
swapchainCount) Bool -> Bool -> Bool
|| Int
pTimingInfosLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pTimingInfos must be empty or have 'swapchainCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
        Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32
swapchainCount)
    lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) (swapchainCount'')
    pTimingInfos'' <- if Data.Vector.null (timingInfos)
      then pure nullPtr
      else do
        pPTimingInfos <- ContT $ allocaBytes @PresentTimingInfoEXT (((Data.Vector.length (timingInfos))) * 48)
        lift $ Data.Vector.imapM_ (\Int
i PresentTimingInfoEXT
e -> Ptr PresentTimingInfoEXT -> PresentTimingInfoEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PresentTimingInfoEXT
pPTimingInfos Ptr PresentTimingInfoEXT -> Int -> Ptr PresentTimingInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentTimingInfoEXT) (PresentTimingInfoEXT
e)) ((timingInfos))
        pure $ pPTimingInfos
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr PresentTimingInfoEXT))) pTimingInfos''
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PresentTimingsInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr PresentTimingsInfoEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingsInfoEXT
p Ptr PresentTimingsInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingsInfoEXT
p Ptr PresentTimingsInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct PresentTimingsInfoEXT where
  peekCStruct :: Ptr PresentTimingsInfoEXT -> IO PresentTimingsInfoEXT
peekCStruct Ptr PresentTimingsInfoEXT
p = do
    swapchainCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PresentTimingsInfoEXT
p Ptr PresentTimingsInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    pTimingInfos <- peek @(Ptr PresentTimingInfoEXT) ((p `plusPtr` 24 :: Ptr (Ptr PresentTimingInfoEXT)))
    let pTimingInfosLength = if Ptr PresentTimingInfoEXT
pTimingInfos Ptr PresentTimingInfoEXT -> Ptr PresentTimingInfoEXT -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr PresentTimingInfoEXT
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
swapchainCount)
    pTimingInfos' <- generateM pTimingInfosLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PresentTimingInfoEXT ((Ptr PresentTimingInfoEXT
pTimingInfos Ptr PresentTimingInfoEXT -> Int -> Ptr PresentTimingInfoEXT
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentTimingInfoEXT)))
    pure $ PresentTimingsInfoEXT
             swapchainCount pTimingInfos'

instance Zero PresentTimingsInfoEXT where
  zero :: PresentTimingsInfoEXT
zero = Word32 -> Vector PresentTimingInfoEXT -> PresentTimingsInfoEXT
PresentTimingsInfoEXT
           Word32
forall a. Zero a => a
zero
           Vector PresentTimingInfoEXT
forall a. Monoid a => a
mempty


-- | VkPresentTimingInfoEXT - Specifies per-present timing information
--
-- = Description
--
-- If @targetTime@ is not zero, the implementation attempts to align the
-- 'PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT' present stage of that
-- presentation request with the time specified in @targetTime@ according
-- to the time domain used. If
-- 'PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT' is not
-- set in @flags@, it indicates that the application would strictly prefer
-- the image to not be visible before @targetTime@ has lapsed.
--
-- If @targetTime@ is not zero and @timeDomainId@ is associated with a
-- 'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT' time domain,
-- @targetTimeDomainPresentStage@ is used to specify which present stage’s
-- time domain @targetTime@ is specified for. Otherwise,
-- @targetTimeDomainPresentStage@ is ignored.
--
-- Some platforms, due to hardware or system limitations, /may/ not be able
-- to accurately time @targetTime@ with the actual physical event of the
-- image becoming visible on the display. However, those timing
-- capabilities /may/ still be useful and result in improved animation
-- quality.
--
-- As such, the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-presentAtAbsoluteTime presentAtAbsoluteTime>
-- and
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-presentAtRelativeTime presentAtRelativeTime>
-- features do not provide a strict guarantee regarding the completion of
-- the 'PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT' present stage
-- relative to the @targetTime@, and implementations /must/ strive to make
-- it as consistent and accurate as possible.
--
-- Applications that specify an absolute present time /should/ regularly
-- rebase their calculations for their next target time on the feedback
-- from 'getPastPresentationTimingEXT' to compensate for accumulated
-- precision errors or potential clock drift. It is recommended that when
-- targeting the time of a vertical blanking period, applications set
-- 'PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT' to allow
-- the implementation to compensate for small precision errors that may
-- cause an image to be displayed one refresh cycle later than intended.
--
-- == Valid Usage
--
-- -   #VUID-VkPresentTimingInfoEXT-targetTime-12236# If @targetTime@ is
--     not zero and @flags@ does not contain
--     'PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT', the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-presentAtAbsoluteTime presentAtAbsoluteTime>
--     feature /must/ be enabled and the @presentAtAbsoluteTimeSupported@
--     member of the 'PresentTimingSurfaceCapabilitiesEXT' returned by
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR'
--     for the surface associated with the swapchain /must/ be
--     'Vulkan.Core10.FundamentalTypes.TRUE'
--
-- -   #VUID-VkPresentTimingInfoEXT-targetTime-12237# If @targetTime@ is
--     not zero and @flags@ contains
--     'PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT', the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-presentAtRelativeTime presentAtRelativeTime>
--     feature /must/ be enabled and the @presentAtRelativeTimeSupported@
--     member of the 'PresentTimingSurfaceCapabilitiesEXT' returned by
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR'
--     for the surface associated with the swapchain /must/ be
--     'Vulkan.Core10.FundamentalTypes.TRUE'
--
-- -   #VUID-VkPresentTimingInfoEXT-timeDomainId-12238# If @timeDomainId@
--     is associated with a 'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT' time
--     domain, and @targetTime@ is not zero, @targetTimeDomainPresentStage@
--     /must/ be a single 'PresentStageFlagsEXT' value
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPresentTimingInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT'
--
-- -   #VUID-VkPresentTimingInfoEXT-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkPresentTimingInfoEXT-flags-parameter# @flags@ /must/ be a
--     valid combination of 'PresentTimingInfoFlagBitsEXT' values
--
-- -   #VUID-VkPresentTimingInfoEXT-presentStageQueries-parameter#
--     @presentStageQueries@ /must/ be a valid combination of
--     'PresentStageFlagBitsEXT' values
--
-- -   #VUID-VkPresentTimingInfoEXT-targetTimeDomainPresentStage-parameter#
--     @targetTimeDomainPresentStage@ /must/ be a valid combination of
--     'PresentStageFlagBitsEXT' values
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PresentStageFlagsEXT', 'PresentTimingInfoFlagsEXT',
-- 'PresentTimingsInfoEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PresentTimingInfoEXT = PresentTimingInfoEXT
  { -- | @flags@ is a bitmask of 'PresentTimingInfoFlagBitsEXT' specifying
    -- options for how to interpret the timing information.
    PresentTimingInfoEXT -> PresentTimingInfoFlagsEXT
flags :: PresentTimingInfoFlagsEXT
  , -- | @targetTime@ is zero or a value specifying the target present time or
    -- duration, in nanoseconds, of the presentation request.
    PresentTimingInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
targetTime :: Word64
  , -- | @timeDomainId@ is the id of the time domain used to specify the absolute
    -- target present time and the timing results obtained in a subsequent
    -- 'getPastPresentationTimingEXT' call for the current presentation
    -- request.
    PresentTimingInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainId :: Word64
  , -- | @presentStageQueries@ is a valid 'PresentStageFlagsEXT' value indicating
    -- which present stages the presentation engine will collect timing
    -- information for.
    PresentTimingInfoEXT -> PresentStageFlagsEXT
presentStageQueries :: PresentStageFlagsEXT
  , -- | @targetTimeDomainPresentStage@ is a valid 'PresentStageFlagsEXT'
    -- specifying a single present stage used to interpret @targetTime@.
    PresentTimingInfoEXT -> PresentStageFlagsEXT
targetTimeDomainPresentStage :: PresentStageFlagsEXT
  }
  deriving (Typeable, PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool
(PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool)
-> (PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool)
-> Eq PresentTimingInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool
== :: PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool
$c/= :: PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool
/= :: PresentTimingInfoEXT -> PresentTimingInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentTimingInfoEXT)
#endif
deriving instance Show PresentTimingInfoEXT

instance ToCStruct PresentTimingInfoEXT where
  withCStruct :: forall b.
PresentTimingInfoEXT -> (Ptr PresentTimingInfoEXT -> IO b) -> IO b
withCStruct PresentTimingInfoEXT
x Ptr PresentTimingInfoEXT -> IO b
f = Int -> (Ptr PresentTimingInfoEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr PresentTimingInfoEXT -> IO b) -> IO b)
-> (Ptr PresentTimingInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PresentTimingInfoEXT
p -> Ptr PresentTimingInfoEXT -> PresentTimingInfoEXT -> IO b -> IO b
forall b.
Ptr PresentTimingInfoEXT -> PresentTimingInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentTimingInfoEXT
p PresentTimingInfoEXT
x (Ptr PresentTimingInfoEXT -> IO b
f Ptr PresentTimingInfoEXT
p)
  pokeCStruct :: forall b.
Ptr PresentTimingInfoEXT -> PresentTimingInfoEXT -> IO b -> IO b
pokeCStruct Ptr PresentTimingInfoEXT
p PresentTimingInfoEXT{"swapchainTimingPropertiesCounter" ::: Word64
PresentTimingInfoFlagsEXT
PresentStageFlagsEXT
flags :: PresentTimingInfoEXT -> PresentTimingInfoFlagsEXT
targetTime :: PresentTimingInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainId :: PresentTimingInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
presentStageQueries :: PresentTimingInfoEXT -> PresentStageFlagsEXT
targetTimeDomainPresentStage :: PresentTimingInfoEXT -> PresentStageFlagsEXT
flags :: PresentTimingInfoFlagsEXT
targetTime :: "swapchainTimingPropertiesCounter" ::: Word64
timeDomainId :: "swapchainTimingPropertiesCounter" ::: Word64
presentStageQueries :: PresentStageFlagsEXT
targetTimeDomainPresentStage :: PresentStageFlagsEXT
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr PresentTimingInfoFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PresentTimingInfoFlagsEXT)) (PresentTimingInfoFlagsEXT
flags)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
targetTime)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
timeDomainId)
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
presentStageQueries)
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
targetTimeDomainPresentStage)
    IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PresentTimingInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr PresentTimingInfoEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PresentTimingInfoEXT where
  peekCStruct :: Ptr PresentTimingInfoEXT -> IO PresentTimingInfoEXT
peekCStruct Ptr PresentTimingInfoEXT
p = do
    flags <- forall a. Storable a => Ptr a -> IO a
peek @PresentTimingInfoFlagsEXT ((Ptr PresentTimingInfoEXT
p Ptr PresentTimingInfoEXT -> Int -> Ptr PresentTimingInfoFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PresentTimingInfoFlagsEXT))
    targetTime <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
    timeDomainId <- peek @Word64 ((p `plusPtr` 32 :: Ptr Word64))
    presentStageQueries <- peek @PresentStageFlagsEXT ((p `plusPtr` 40 :: Ptr PresentStageFlagsEXT))
    targetTimeDomainPresentStage <- peek @PresentStageFlagsEXT ((p `plusPtr` 44 :: Ptr PresentStageFlagsEXT))
    pure $ PresentTimingInfoEXT
             flags
             targetTime
             timeDomainId
             presentStageQueries
             targetTimeDomainPresentStage

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

instance Zero PresentTimingInfoEXT where
  zero :: PresentTimingInfoEXT
zero = PresentTimingInfoFlagsEXT
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> PresentStageFlagsEXT
-> PresentStageFlagsEXT
-> PresentTimingInfoEXT
PresentTimingInfoEXT
           PresentTimingInfoFlagsEXT
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero
           PresentStageFlagsEXT
forall a. Zero a => a
zero
           PresentStageFlagsEXT
forall a. Zero a => a
zero


-- | VkSwapchainCalibratedTimestampInfoEXT - Structure specifying the
-- swapchain to calibrate a swapchain-local timestamp query
--
-- = Description
--
-- @timeDomainId@ /must/ be an id previously reported by
-- 'getSwapchainTimeDomainPropertiesEXT' for @swapchain@. If the
-- @timeDomainId@ is no longer supported by the @swapchain@,
-- implementations /may/ report zero as the calibrated timestamp value.
--
-- == Valid Usage
--
-- -   #VUID-VkSwapchainCalibratedTimestampInfoEXT-timeDomain-12228# If the
--     @timeDomain@ member of the
--     'Vulkan.Extensions.VK_KHR_calibrated_timestamps.CalibratedTimestampInfoKHR'
--     structure in this structure’s @pNext@ chain is
--     'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT', @presentStage@ /must/ specify
--     one and only one present stage
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSwapchainCalibratedTimestampInfoEXT-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT'
--
-- -   #VUID-VkSwapchainCalibratedTimestampInfoEXT-swapchain-parameter#
--     @swapchain@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SwapchainKHR' handle
--
-- -   #VUID-VkSwapchainCalibratedTimestampInfoEXT-presentStage-parameter#
--     @presentStage@ /must/ be a valid combination of
--     'PresentStageFlagBitsEXT' values
--
-- -   #VUID-VkSwapchainCalibratedTimestampInfoEXT-presentStage-requiredbitmask#
--     @presentStage@ /must/ not be @0@
--
-- == 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_EXT_present_timing VK_EXT_present_timing>,
-- 'PresentStageFlagsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.SwapchainKHR'
data SwapchainCalibratedTimestampInfoEXT = SwapchainCalibratedTimestampInfoEXT
  { -- | @swapchain@ is the swapchain to retrieve the swapchain-local timestamp
    -- from.
    SwapchainCalibratedTimestampInfoEXT -> SwapchainKHR
swapchain :: SwapchainKHR
  , -- | @presentStage@ is zero or a 'PresentStageFlagsEXT' value used to
    -- identify a single present stage when calibrating a timestamp in the
    -- 'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT' time domain.
    SwapchainCalibratedTimestampInfoEXT -> PresentStageFlagsEXT
presentStage :: PresentStageFlagsEXT
  , -- | @timeDomainId@ is the id for the opaque time domain being calibrated.
    SwapchainCalibratedTimestampInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
timeDomainId :: Word64
  }
  deriving (Typeable, SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> Bool
(SwapchainCalibratedTimestampInfoEXT
 -> SwapchainCalibratedTimestampInfoEXT -> Bool)
-> (SwapchainCalibratedTimestampInfoEXT
    -> SwapchainCalibratedTimestampInfoEXT -> Bool)
-> Eq SwapchainCalibratedTimestampInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> Bool
== :: SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> Bool
$c/= :: SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> Bool
/= :: SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainCalibratedTimestampInfoEXT)
#endif
deriving instance Show SwapchainCalibratedTimestampInfoEXT

instance ToCStruct SwapchainCalibratedTimestampInfoEXT where
  withCStruct :: forall b.
SwapchainCalibratedTimestampInfoEXT
-> (Ptr SwapchainCalibratedTimestampInfoEXT -> IO b) -> IO b
withCStruct SwapchainCalibratedTimestampInfoEXT
x Ptr SwapchainCalibratedTimestampInfoEXT -> IO b
f = Int -> (Ptr SwapchainCalibratedTimestampInfoEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr SwapchainCalibratedTimestampInfoEXT -> IO b) -> IO b)
-> (Ptr SwapchainCalibratedTimestampInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SwapchainCalibratedTimestampInfoEXT
p -> Ptr SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> IO b -> IO b
forall b.
Ptr SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainCalibratedTimestampInfoEXT
p SwapchainCalibratedTimestampInfoEXT
x (Ptr SwapchainCalibratedTimestampInfoEXT -> IO b
f Ptr SwapchainCalibratedTimestampInfoEXT
p)
  pokeCStruct :: forall b.
Ptr SwapchainCalibratedTimestampInfoEXT
-> SwapchainCalibratedTimestampInfoEXT -> IO b -> IO b
pokeCStruct Ptr SwapchainCalibratedTimestampInfoEXT
p SwapchainCalibratedTimestampInfoEXT{"swapchainTimingPropertiesCounter" ::: Word64
SwapchainKHR
PresentStageFlagsEXT
swapchain :: SwapchainCalibratedTimestampInfoEXT -> SwapchainKHR
presentStage :: SwapchainCalibratedTimestampInfoEXT -> PresentStageFlagsEXT
timeDomainId :: SwapchainCalibratedTimestampInfoEXT
-> "swapchainTimingPropertiesCounter" ::: Word64
swapchain :: SwapchainKHR
presentStage :: PresentStageFlagsEXT
timeDomainId :: "swapchainTimingPropertiesCounter" ::: Word64
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr SwapchainKHR -> SwapchainKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr SwapchainKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (SwapchainKHR
swapchain)
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT
-> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
presentStage)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
timeDomainId)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr SwapchainCalibratedTimestampInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr SwapchainCalibratedTimestampInfoEXT
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr SwapchainKHR -> SwapchainKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr SwapchainKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR)) (SwapchainKHR
forall a. Zero a => a
zero)
    Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT
-> Int -> Ptr PresentStageFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PresentStageFlagsEXT)) (PresentStageFlagsEXT
forall a. Zero a => a
zero)
    Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
-> ("swapchainTimingPropertiesCounter" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT
-> Int -> Ptr ("swapchainTimingPropertiesCounter" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) ("swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SwapchainCalibratedTimestampInfoEXT where
  peekCStruct :: Ptr SwapchainCalibratedTimestampInfoEXT
-> IO SwapchainCalibratedTimestampInfoEXT
peekCStruct Ptr SwapchainCalibratedTimestampInfoEXT
p = do
    swapchain <- forall a. Storable a => Ptr a -> IO a
peek @SwapchainKHR ((Ptr SwapchainCalibratedTimestampInfoEXT
p Ptr SwapchainCalibratedTimestampInfoEXT -> Int -> Ptr SwapchainKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SwapchainKHR))
    presentStage <- peek @PresentStageFlagsEXT ((p `plusPtr` 24 :: Ptr PresentStageFlagsEXT))
    timeDomainId <- peek @Word64 ((p `plusPtr` 32 :: Ptr Word64))
    pure $ SwapchainCalibratedTimestampInfoEXT
             swapchain presentStage timeDomainId

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

instance Zero SwapchainCalibratedTimestampInfoEXT where
  zero :: SwapchainCalibratedTimestampInfoEXT
zero = SwapchainKHR
-> PresentStageFlagsEXT
-> ("swapchainTimingPropertiesCounter" ::: Word64)
-> SwapchainCalibratedTimestampInfoEXT
SwapchainCalibratedTimestampInfoEXT
           SwapchainKHR
forall a. Zero a => a
zero
           PresentStageFlagsEXT
forall a. Zero a => a
zero
           "swapchainTimingPropertiesCounter" ::: Word64
forall a. Zero a => a
zero


-- | VkTimeDomainKHR - Supported time domains
--
-- = Description
--
-- -   'TIME_DOMAIN_DEVICE_KHR' specifies the device time domain. Timestamp
--     values in this time domain use the same units and are comparable
--     with device timestamp values captured using
--     'Vulkan.Core10.CommandBufferBuilding.cmdWriteTimestamp' or
--     'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.cmdWriteTimestamp2'
--     and are defined to be incrementing according to the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-timestampPeriod timestampPeriod>
--     of the device.
--
-- -   'TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT' specifies a time domain unique
--     to a particular swapchain and a specific present stage. Timestamp
--     values in this time domain are in units of nanosecond and are
--     comparable only with other values from the same swapchain and
--     present stage.
--
-- -   'TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT' specifies a time domain unique to
--     a particular swapchain. Timestamp values in this time domain are in
--     units of nanosecond and are comparable only with other values from
--     the same swapchain.
--
-- -   'TIME_DOMAIN_CLOCK_MONOTONIC_KHR' specifies the CLOCK_MONOTONIC time
--     domain available on POSIX platforms. Timestamp values in this time
--     domain are in units of nanoseconds and are comparable with platform
--     timestamp values captured using the POSIX clock_gettime API as
--     computed by this example:
--
-- An implementation supporting @VK_KHR_calibrated_timestamps@ or
-- @VK_EXT_calibrated_timestamps@ will use the same time domain for all its
-- 'Vulkan.Core10.Handles.Queue' so that timestamp values reported for
-- 'TIME_DOMAIN_DEVICE_KHR' can be matched to any timestamp captured
-- through 'Vulkan.Core10.CommandBufferBuilding.cmdWriteTimestamp' or
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.cmdWriteTimestamp2'
-- .
--
-- > struct timespec tv;
-- > clock_gettime(CLOCK_MONOTONIC, &tv);
-- > return tv.tv_nsec + tv.tv_sec*1000000000ull;
--
-- -   'TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR' specifies the
--     CLOCK_MONOTONIC_RAW time domain available on POSIX platforms.
--     Timestamp values in this time domain are in units of nanoseconds and
--     are comparable with platform timestamp values captured using the
--     POSIX clock_gettime API as computed by this example:
--
-- > struct timespec tv;
-- > clock_gettime(CLOCK_MONOTONIC_RAW, &tv);
-- > return tv.tv_nsec + tv.tv_sec*1000000000ull;
--
-- -   'TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR' specifies the
--     performance counter (QPC) time domain available on Windows.
--     Timestamp values in this time domain are in the same units as those
--     provided by the Windows QueryPerformanceCounter API and are
--     comparable with platform timestamp values captured using that API as
--     computed by this example:
--
-- > LARGE_INTEGER counter;
-- > QueryPerformanceCounter(&counter);
-- > return counter.QuadPart;
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_calibrated_timestamps VK_EXT_calibrated_timestamps>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_calibrated_timestamps VK_KHR_calibrated_timestamps>,
-- 'Vulkan.Extensions.VK_KHR_calibrated_timestamps.CalibratedTimestampInfoKHR',
-- 'PastPresentationTimingEXT', 'SwapchainTimeDomainPropertiesEXT',
-- 'Vulkan.Extensions.VK_KHR_calibrated_timestamps.getPhysicalDeviceCalibrateableTimeDomainsKHR',
-- 'Vulkan.Extensions.VK_KHR_calibrated_timestamps.getPhysicalDeviceCalibrateableTimeDomainsKHR'
newtype TimeDomainKHR = TimeDomainKHR Int32
  deriving newtype (TimeDomainKHR -> TimeDomainKHR -> Bool
(TimeDomainKHR -> TimeDomainKHR -> Bool)
-> (TimeDomainKHR -> TimeDomainKHR -> Bool) -> Eq TimeDomainKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimeDomainKHR -> TimeDomainKHR -> Bool
== :: TimeDomainKHR -> TimeDomainKHR -> Bool
$c/= :: TimeDomainKHR -> TimeDomainKHR -> Bool
/= :: TimeDomainKHR -> TimeDomainKHR -> Bool
Eq, Eq TimeDomainKHR
Eq TimeDomainKHR =>
(TimeDomainKHR -> TimeDomainKHR -> Ordering)
-> (TimeDomainKHR -> TimeDomainKHR -> Bool)
-> (TimeDomainKHR -> TimeDomainKHR -> Bool)
-> (TimeDomainKHR -> TimeDomainKHR -> Bool)
-> (TimeDomainKHR -> TimeDomainKHR -> Bool)
-> (TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR)
-> (TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR)
-> Ord TimeDomainKHR
TimeDomainKHR -> TimeDomainKHR -> Bool
TimeDomainKHR -> TimeDomainKHR -> Ordering
TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR
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
$ccompare :: TimeDomainKHR -> TimeDomainKHR -> Ordering
compare :: TimeDomainKHR -> TimeDomainKHR -> Ordering
$c< :: TimeDomainKHR -> TimeDomainKHR -> Bool
< :: TimeDomainKHR -> TimeDomainKHR -> Bool
$c<= :: TimeDomainKHR -> TimeDomainKHR -> Bool
<= :: TimeDomainKHR -> TimeDomainKHR -> Bool
$c> :: TimeDomainKHR -> TimeDomainKHR -> Bool
> :: TimeDomainKHR -> TimeDomainKHR -> Bool
$c>= :: TimeDomainKHR -> TimeDomainKHR -> Bool
>= :: TimeDomainKHR -> TimeDomainKHR -> Bool
$cmax :: TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR
max :: TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR
$cmin :: TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR
min :: TimeDomainKHR -> TimeDomainKHR -> TimeDomainKHR
Ord, Ptr TimeDomainKHR -> IO TimeDomainKHR
Ptr TimeDomainKHR -> Int -> IO TimeDomainKHR
Ptr TimeDomainKHR -> Int -> TimeDomainKHR -> IO ()
Ptr TimeDomainKHR -> TimeDomainKHR -> IO ()
TimeDomainKHR -> Int
(TimeDomainKHR -> Int)
-> (TimeDomainKHR -> Int)
-> (Ptr TimeDomainKHR -> Int -> IO TimeDomainKHR)
-> (Ptr TimeDomainKHR -> Int -> TimeDomainKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO TimeDomainKHR)
-> (forall b. Ptr b -> Int -> TimeDomainKHR -> IO ())
-> (Ptr TimeDomainKHR -> IO TimeDomainKHR)
-> (Ptr TimeDomainKHR -> TimeDomainKHR -> IO ())
-> Storable TimeDomainKHR
forall b. Ptr b -> Int -> IO TimeDomainKHR
forall b. Ptr b -> Int -> TimeDomainKHR -> 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
$csizeOf :: TimeDomainKHR -> Int
sizeOf :: TimeDomainKHR -> Int
$calignment :: TimeDomainKHR -> Int
alignment :: TimeDomainKHR -> Int
$cpeekElemOff :: Ptr TimeDomainKHR -> Int -> IO TimeDomainKHR
peekElemOff :: Ptr TimeDomainKHR -> Int -> IO TimeDomainKHR
$cpokeElemOff :: Ptr TimeDomainKHR -> Int -> TimeDomainKHR -> IO ()
pokeElemOff :: Ptr TimeDomainKHR -> Int -> TimeDomainKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO TimeDomainKHR
peekByteOff :: forall b. Ptr b -> Int -> IO TimeDomainKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> TimeDomainKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> TimeDomainKHR -> IO ()
$cpeek :: Ptr TimeDomainKHR -> IO TimeDomainKHR
peek :: Ptr TimeDomainKHR -> IO TimeDomainKHR
$cpoke :: Ptr TimeDomainKHR -> TimeDomainKHR -> IO ()
poke :: Ptr TimeDomainKHR -> TimeDomainKHR -> IO ()
Storable, TimeDomainKHR
TimeDomainKHR -> Zero TimeDomainKHR
forall a. a -> Zero a
$czero :: TimeDomainKHR
zero :: TimeDomainKHR
Zero)

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_DEVICE_KHR"
pattern $mTIME_DOMAIN_DEVICE_KHR :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_DEVICE_KHR :: TimeDomainKHR
TIME_DOMAIN_DEVICE_KHR = TimeDomainKHR 0

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR"
pattern $mTIME_DOMAIN_CLOCK_MONOTONIC_KHR :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_CLOCK_MONOTONIC_KHR :: TimeDomainKHR
TIME_DOMAIN_CLOCK_MONOTONIC_KHR = TimeDomainKHR 1

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR"
pattern $mTIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR :: TimeDomainKHR
TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR = TimeDomainKHR 2

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR"
pattern $mTIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR :: TimeDomainKHR
TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR = TimeDomainKHR 3

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT"
pattern $mTIME_DOMAIN_SWAPCHAIN_LOCAL_EXT :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_SWAPCHAIN_LOCAL_EXT :: TimeDomainKHR
TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT = TimeDomainKHR 1000208001

-- No documentation found for Nested "VkTimeDomainKHR" "VK_TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT"
pattern $mTIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT :: forall {r}. TimeDomainKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bTIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT :: TimeDomainKHR
TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT = TimeDomainKHR 1000208000

{-# COMPLETE
  TIME_DOMAIN_DEVICE_KHR
  , TIME_DOMAIN_CLOCK_MONOTONIC_KHR
  , TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR
  , TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR
  , TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT
  , TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT ::
    TimeDomainKHR
  #-}

conNameTimeDomainKHR :: String
conNameTimeDomainKHR :: String
conNameTimeDomainKHR = String
"TimeDomainKHR"

enumPrefixTimeDomainKHR :: String
enumPrefixTimeDomainKHR :: String
enumPrefixTimeDomainKHR = String
"TIME_DOMAIN_"

showTableTimeDomainKHR :: [(TimeDomainKHR, String)]
showTableTimeDomainKHR :: [(TimeDomainKHR, String)]
showTableTimeDomainKHR =
  [ (TimeDomainKHR
TIME_DOMAIN_DEVICE_KHR, String
"DEVICE_KHR")
  ,
    ( TimeDomainKHR
TIME_DOMAIN_CLOCK_MONOTONIC_KHR
    , String
"CLOCK_MONOTONIC_KHR"
    )
  ,
    ( TimeDomainKHR
TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR
    , String
"CLOCK_MONOTONIC_RAW_KHR"
    )
  ,
    ( TimeDomainKHR
TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR
    , String
"QUERY_PERFORMANCE_COUNTER_KHR"
    )
  ,
    ( TimeDomainKHR
TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT
    , String
"SWAPCHAIN_LOCAL_EXT"
    )
  ,
    ( TimeDomainKHR
TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT
    , String
"PRESENT_STAGE_LOCAL_EXT"
    )
  ]

instance Show TimeDomainKHR where
  showsPrec :: Int -> TimeDomainKHR -> ShowS
showsPrec =
    String
-> [(TimeDomainKHR, String)]
-> String
-> (TimeDomainKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> TimeDomainKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixTimeDomainKHR
      [(TimeDomainKHR, String)]
showTableTimeDomainKHR
      String
conNameTimeDomainKHR
      (\(TimeDomainKHR Int32
x) -> Int32
x)
      (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read TimeDomainKHR where
  readPrec :: ReadPrec TimeDomainKHR
readPrec =
    String
-> [(TimeDomainKHR, String)]
-> String
-> (Int32 -> TimeDomainKHR)
-> ReadPrec TimeDomainKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixTimeDomainKHR
      [(TimeDomainKHR, String)]
showTableTimeDomainKHR
      String
conNameTimeDomainKHR
      Int32 -> TimeDomainKHR
TimeDomainKHR

type PresentStageFlagsEXT = PresentStageFlagBitsEXT

-- | VkPresentStageFlagBitsEXT - Bitmask specifying stages of the image
-- presentation process
--
-- = Description
--
-- -   'PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT' marks the end of the
--     set of queue operations enqueued by
--     'Vulkan.Extensions.VK_KHR_swapchain.queuePresentKHR' on the provided
--     'Vulkan.Core10.Handles.Queue' for a presentation request.
--
-- -   'PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT' is the stage after which
--     the presentation request has been dequeued from the swapchain’s
--     internal presentation request queue, if any, as specified by the
--     present mode associated with that request.
--
-- -   'PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT' is the stage after
--     which data for the first pixel of the presentation request
--     associated with the image has left the presentation engine for a
--     display hardware.
--
-- -   'PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT' is the stage after
--     which a display hardware has made the first pixel visible for the
--     presentation request associated with the image to be presented.
--
-- The set of queue operations delimited by
-- 'PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT' includes the wait for the
-- semaphores specified in
-- 'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR'::@pWaitSemaphores@,
-- if any, and any work implicitly enqueued by the implementation.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PresentStageFlagsEXT'
newtype PresentStageFlagBitsEXT = PresentStageFlagBitsEXT Flags
  deriving newtype (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
(PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> Eq PresentStageFlagsEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
== :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
$c/= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
/= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
Eq, Eq PresentStageFlagsEXT
Eq PresentStageFlagsEXT =>
(PresentStageFlagsEXT -> PresentStageFlagsEXT -> Ordering)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT
    -> PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT
    -> PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> Ord PresentStageFlagsEXT
PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
PresentStageFlagsEXT -> PresentStageFlagsEXT -> Ordering
PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
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
$ccompare :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Ordering
compare :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Ordering
$c< :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
< :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
$c<= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
<= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
$c> :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
> :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
$c>= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
>= :: PresentStageFlagsEXT -> PresentStageFlagsEXT -> Bool
$cmax :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
max :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
$cmin :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
min :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
Ord, Ptr PresentStageFlagsEXT -> IO PresentStageFlagsEXT
Ptr PresentStageFlagsEXT -> Int -> IO PresentStageFlagsEXT
Ptr PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT -> IO ()
Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
PresentStageFlagsEXT -> Int
(PresentStageFlagsEXT -> Int)
-> (PresentStageFlagsEXT -> Int)
-> (Ptr PresentStageFlagsEXT -> Int -> IO PresentStageFlagsEXT)
-> (Ptr PresentStageFlagsEXT
    -> Int -> PresentStageFlagsEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO PresentStageFlagsEXT)
-> (forall b. Ptr b -> Int -> PresentStageFlagsEXT -> IO ())
-> (Ptr PresentStageFlagsEXT -> IO PresentStageFlagsEXT)
-> (Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ())
-> Storable PresentStageFlagsEXT
forall b. Ptr b -> Int -> IO PresentStageFlagsEXT
forall b. Ptr b -> Int -> PresentStageFlagsEXT -> 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
$csizeOf :: PresentStageFlagsEXT -> Int
sizeOf :: PresentStageFlagsEXT -> Int
$calignment :: PresentStageFlagsEXT -> Int
alignment :: PresentStageFlagsEXT -> Int
$cpeekElemOff :: Ptr PresentStageFlagsEXT -> Int -> IO PresentStageFlagsEXT
peekElemOff :: Ptr PresentStageFlagsEXT -> Int -> IO PresentStageFlagsEXT
$cpokeElemOff :: Ptr PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT -> IO ()
pokeElemOff :: Ptr PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PresentStageFlagsEXT
peekByteOff :: forall b. Ptr b -> Int -> IO PresentStageFlagsEXT
$cpokeByteOff :: forall b. Ptr b -> Int -> PresentStageFlagsEXT -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> PresentStageFlagsEXT -> IO ()
$cpeek :: Ptr PresentStageFlagsEXT -> IO PresentStageFlagsEXT
peek :: Ptr PresentStageFlagsEXT -> IO PresentStageFlagsEXT
$cpoke :: Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
poke :: Ptr PresentStageFlagsEXT -> PresentStageFlagsEXT -> IO ()
Storable, PresentStageFlagsEXT
PresentStageFlagsEXT -> Zero PresentStageFlagsEXT
forall a. a -> Zero a
$czero :: PresentStageFlagsEXT
zero :: PresentStageFlagsEXT
Zero, Eq PresentStageFlagsEXT
PresentStageFlagsEXT
Eq PresentStageFlagsEXT =>
(PresentStageFlagsEXT
 -> PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT
    -> PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT
    -> PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> PresentStageFlagsEXT
-> (Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> Bool)
-> (PresentStageFlagsEXT -> Maybe Int)
-> (PresentStageFlagsEXT -> Int)
-> (PresentStageFlagsEXT -> Bool)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT)
-> (PresentStageFlagsEXT -> Int)
-> Bits PresentStageFlagsEXT
Int -> PresentStageFlagsEXT
PresentStageFlagsEXT -> Bool
PresentStageFlagsEXT -> Int
PresentStageFlagsEXT -> Maybe Int
PresentStageFlagsEXT -> PresentStageFlagsEXT
PresentStageFlagsEXT -> Int -> Bool
PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
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
$c.&. :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
.&. :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
$c.|. :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
.|. :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
$cxor :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
xor :: PresentStageFlagsEXT
-> PresentStageFlagsEXT -> PresentStageFlagsEXT
$ccomplement :: PresentStageFlagsEXT -> PresentStageFlagsEXT
complement :: PresentStageFlagsEXT -> PresentStageFlagsEXT
$cshift :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
shift :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$crotate :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
rotate :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$czeroBits :: PresentStageFlagsEXT
zeroBits :: PresentStageFlagsEXT
$cbit :: Int -> PresentStageFlagsEXT
bit :: Int -> PresentStageFlagsEXT
$csetBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
setBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$cclearBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
clearBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$ccomplementBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
complementBit :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$ctestBit :: PresentStageFlagsEXT -> Int -> Bool
testBit :: PresentStageFlagsEXT -> Int -> Bool
$cbitSizeMaybe :: PresentStageFlagsEXT -> Maybe Int
bitSizeMaybe :: PresentStageFlagsEXT -> Maybe Int
$cbitSize :: PresentStageFlagsEXT -> Int
bitSize :: PresentStageFlagsEXT -> Int
$cisSigned :: PresentStageFlagsEXT -> Bool
isSigned :: PresentStageFlagsEXT -> Bool
$cshiftL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
shiftL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$cunsafeShiftL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
unsafeShiftL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$cshiftR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
shiftR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$cunsafeShiftR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
unsafeShiftR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$crotateL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
rotateL :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$crotateR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
rotateR :: PresentStageFlagsEXT -> Int -> PresentStageFlagsEXT
$cpopCount :: PresentStageFlagsEXT -> Int
popCount :: PresentStageFlagsEXT -> Int
Bits, Bits PresentStageFlagsEXT
Bits PresentStageFlagsEXT =>
(PresentStageFlagsEXT -> Int)
-> (PresentStageFlagsEXT -> Int)
-> (PresentStageFlagsEXT -> Int)
-> FiniteBits PresentStageFlagsEXT
PresentStageFlagsEXT -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: PresentStageFlagsEXT -> Int
finiteBitSize :: PresentStageFlagsEXT -> Int
$ccountLeadingZeros :: PresentStageFlagsEXT -> Int
countLeadingZeros :: PresentStageFlagsEXT -> Int
$ccountTrailingZeros :: PresentStageFlagsEXT -> Int
countTrailingZeros :: PresentStageFlagsEXT -> Int
FiniteBits)

-- No documentation found for Nested "VkPresentStageFlagBitsEXT" "VK_PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT"
pattern $mPRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT :: forall {r}.
PresentStageFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT :: PresentStageFlagsEXT
PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT = PresentStageFlagBitsEXT 0x00000001

-- No documentation found for Nested "VkPresentStageFlagBitsEXT" "VK_PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT"
pattern $mPRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT :: forall {r}.
PresentStageFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT :: PresentStageFlagsEXT
PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT = PresentStageFlagBitsEXT 0x00000002

-- No documentation found for Nested "VkPresentStageFlagBitsEXT" "VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT"
pattern $mPRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT :: forall {r}.
PresentStageFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT :: PresentStageFlagsEXT
PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT = PresentStageFlagBitsEXT 0x00000004

-- No documentation found for Nested "VkPresentStageFlagBitsEXT" "VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT"
pattern $mPRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT :: forall {r}.
PresentStageFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT :: PresentStageFlagsEXT
PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT = PresentStageFlagBitsEXT 0x00000008

conNamePresentStageFlagBitsEXT :: String
conNamePresentStageFlagBitsEXT :: String
conNamePresentStageFlagBitsEXT = String
"PresentStageFlagBitsEXT"

enumPrefixPresentStageFlagBitsEXT :: String
enumPrefixPresentStageFlagBitsEXT :: String
enumPrefixPresentStageFlagBitsEXT = String
"PRESENT_STAGE_"

showTablePresentStageFlagBitsEXT :: [(PresentStageFlagBitsEXT, String)]
showTablePresentStageFlagBitsEXT :: [(PresentStageFlagsEXT, String)]
showTablePresentStageFlagBitsEXT =
  [
    ( PresentStageFlagsEXT
PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT
    , String
"QUEUE_OPERATIONS_END_BIT_EXT"
    )
  ,
    ( PresentStageFlagsEXT
PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT
    , String
"REQUEST_DEQUEUED_BIT_EXT"
    )
  ,
    ( PresentStageFlagsEXT
PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT
    , String
"IMAGE_FIRST_PIXEL_OUT_BIT_EXT"
    )
  ,
    ( PresentStageFlagsEXT
PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT
    , String
"IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT"
    )
  ]

instance Show PresentStageFlagBitsEXT where
  showsPrec :: Int -> PresentStageFlagsEXT -> ShowS
showsPrec =
    String
-> [(PresentStageFlagsEXT, String)]
-> String
-> (PresentStageFlagsEXT -> Word32)
-> (Word32 -> ShowS)
-> Int
-> PresentStageFlagsEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixPresentStageFlagBitsEXT
      [(PresentStageFlagsEXT, String)]
showTablePresentStageFlagBitsEXT
      String
conNamePresentStageFlagBitsEXT
      (\(PresentStageFlagBitsEXT Word32
x) -> Word32
x)
      (\Word32
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word32
x)

instance Read PresentStageFlagBitsEXT where
  readPrec :: ReadPrec PresentStageFlagsEXT
readPrec =
    String
-> [(PresentStageFlagsEXT, String)]
-> String
-> (Word32 -> PresentStageFlagsEXT)
-> ReadPrec PresentStageFlagsEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixPresentStageFlagBitsEXT
      [(PresentStageFlagsEXT, String)]
showTablePresentStageFlagBitsEXT
      String
conNamePresentStageFlagBitsEXT
      Word32 -> PresentStageFlagsEXT
PresentStageFlagBitsEXT

type PastPresentationTimingFlagsEXT = PastPresentationTimingFlagBitsEXT

-- | VkPastPresentationTimingFlagBitsEXT - Bitmask specifying past
-- presentation timing query flags
--
-- = Description
--
-- -   'PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT' specifies
--     that 'getPastPresentationTimingEXT' /may/ return partial results for
--     presentation requests that have not completed all requested present
--     stages.
--
-- -   'PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT'
--     specifies that 'getPastPresentationTimingEXT' /may/ return results
--     out of order with respect to the presentation order.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PastPresentationTimingFlagsEXT'
newtype PastPresentationTimingFlagBitsEXT = PastPresentationTimingFlagBitsEXT Flags
  deriving newtype (PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
(PastPresentationTimingFlagsEXT
 -> PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> Bool)
-> Eq PastPresentationTimingFlagsEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
== :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
$c/= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
/= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
Eq, Eq PastPresentationTimingFlagsEXT
Eq PastPresentationTimingFlagsEXT =>
(PastPresentationTimingFlagsEXT
 -> PastPresentationTimingFlagsEXT -> Ordering)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT)
-> Ord PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Ordering
PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
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
$ccompare :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Ordering
compare :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Ordering
$c< :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
< :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
$c<= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
<= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
$c> :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
> :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
$c>= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
>= :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> Bool
$cmax :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
max :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
$cmin :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
min :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
Ord, Ptr PastPresentationTimingFlagsEXT
-> IO PastPresentationTimingFlagsEXT
Ptr PastPresentationTimingFlagsEXT
-> Int -> IO PastPresentationTimingFlagsEXT
Ptr PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT -> IO ()
Ptr PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> IO ()
PastPresentationTimingFlagsEXT -> Int
(PastPresentationTimingFlagsEXT -> Int)
-> (PastPresentationTimingFlagsEXT -> Int)
-> (Ptr PastPresentationTimingFlagsEXT
    -> Int -> IO PastPresentationTimingFlagsEXT)
-> (Ptr PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO PastPresentationTimingFlagsEXT)
-> (forall b.
    Ptr b -> Int -> PastPresentationTimingFlagsEXT -> IO ())
-> (Ptr PastPresentationTimingFlagsEXT
    -> IO PastPresentationTimingFlagsEXT)
-> (Ptr PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT -> IO ())
-> Storable PastPresentationTimingFlagsEXT
forall b. Ptr b -> Int -> IO PastPresentationTimingFlagsEXT
forall b. Ptr b -> Int -> PastPresentationTimingFlagsEXT -> 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
$csizeOf :: PastPresentationTimingFlagsEXT -> Int
sizeOf :: PastPresentationTimingFlagsEXT -> Int
$calignment :: PastPresentationTimingFlagsEXT -> Int
alignment :: PastPresentationTimingFlagsEXT -> Int
$cpeekElemOff :: Ptr PastPresentationTimingFlagsEXT
-> Int -> IO PastPresentationTimingFlagsEXT
peekElemOff :: Ptr PastPresentationTimingFlagsEXT
-> Int -> IO PastPresentationTimingFlagsEXT
$cpokeElemOff :: Ptr PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT -> IO ()
pokeElemOff :: Ptr PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PastPresentationTimingFlagsEXT
peekByteOff :: forall b. Ptr b -> Int -> IO PastPresentationTimingFlagsEXT
$cpokeByteOff :: forall b. Ptr b -> Int -> PastPresentationTimingFlagsEXT -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> PastPresentationTimingFlagsEXT -> IO ()
$cpeek :: Ptr PastPresentationTimingFlagsEXT
-> IO PastPresentationTimingFlagsEXT
peek :: Ptr PastPresentationTimingFlagsEXT
-> IO PastPresentationTimingFlagsEXT
$cpoke :: Ptr PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> IO ()
poke :: Ptr PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> IO ()
Storable, PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT
-> Zero PastPresentationTimingFlagsEXT
forall a. a -> Zero a
$czero :: PastPresentationTimingFlagsEXT
zero :: PastPresentationTimingFlagsEXT
Zero, Eq PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT
Eq PastPresentationTimingFlagsEXT =>
(PastPresentationTimingFlagsEXT
 -> PastPresentationTimingFlagsEXT
 -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> PastPresentationTimingFlagsEXT
-> (Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT -> Int -> Bool)
-> (PastPresentationTimingFlagsEXT -> Maybe Int)
-> (PastPresentationTimingFlagsEXT -> Int)
-> (PastPresentationTimingFlagsEXT -> Bool)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT
    -> Int -> PastPresentationTimingFlagsEXT)
-> (PastPresentationTimingFlagsEXT -> Int)
-> Bits PastPresentationTimingFlagsEXT
Int -> PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT -> Bool
PastPresentationTimingFlagsEXT -> Int
PastPresentationTimingFlagsEXT -> Maybe Int
PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT -> Int -> Bool
PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
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
$c.&. :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
.&. :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
$c.|. :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
.|. :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
$cxor :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
xor :: PastPresentationTimingFlagsEXT
-> PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
$ccomplement :: PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
complement :: PastPresentationTimingFlagsEXT -> PastPresentationTimingFlagsEXT
$cshift :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
shift :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$crotate :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
rotate :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$czeroBits :: PastPresentationTimingFlagsEXT
zeroBits :: PastPresentationTimingFlagsEXT
$cbit :: Int -> PastPresentationTimingFlagsEXT
bit :: Int -> PastPresentationTimingFlagsEXT
$csetBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
setBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$cclearBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
clearBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$ccomplementBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
complementBit :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$ctestBit :: PastPresentationTimingFlagsEXT -> Int -> Bool
testBit :: PastPresentationTimingFlagsEXT -> Int -> Bool
$cbitSizeMaybe :: PastPresentationTimingFlagsEXT -> Maybe Int
bitSizeMaybe :: PastPresentationTimingFlagsEXT -> Maybe Int
$cbitSize :: PastPresentationTimingFlagsEXT -> Int
bitSize :: PastPresentationTimingFlagsEXT -> Int
$cisSigned :: PastPresentationTimingFlagsEXT -> Bool
isSigned :: PastPresentationTimingFlagsEXT -> Bool
$cshiftL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
shiftL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$cunsafeShiftL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
unsafeShiftL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$cshiftR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
shiftR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$cunsafeShiftR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
unsafeShiftR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$crotateL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
rotateL :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$crotateR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
rotateR :: PastPresentationTimingFlagsEXT
-> Int -> PastPresentationTimingFlagsEXT
$cpopCount :: PastPresentationTimingFlagsEXT -> Int
popCount :: PastPresentationTimingFlagsEXT -> Int
Bits, Bits PastPresentationTimingFlagsEXT
Bits PastPresentationTimingFlagsEXT =>
(PastPresentationTimingFlagsEXT -> Int)
-> (PastPresentationTimingFlagsEXT -> Int)
-> (PastPresentationTimingFlagsEXT -> Int)
-> FiniteBits PastPresentationTimingFlagsEXT
PastPresentationTimingFlagsEXT -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: PastPresentationTimingFlagsEXT -> Int
finiteBitSize :: PastPresentationTimingFlagsEXT -> Int
$ccountLeadingZeros :: PastPresentationTimingFlagsEXT -> Int
countLeadingZeros :: PastPresentationTimingFlagsEXT -> Int
$ccountTrailingZeros :: PastPresentationTimingFlagsEXT -> Int
countTrailingZeros :: PastPresentationTimingFlagsEXT -> Int
FiniteBits)

-- No documentation found for Nested "VkPastPresentationTimingFlagBitsEXT" "VK_PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT"
pattern $mPAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT :: forall {r}.
PastPresentationTimingFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT :: PastPresentationTimingFlagsEXT
PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT = PastPresentationTimingFlagBitsEXT 0x00000001

-- No documentation found for Nested "VkPastPresentationTimingFlagBitsEXT" "VK_PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT"
pattern $mPAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT :: forall {r}.
PastPresentationTimingFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT :: PastPresentationTimingFlagsEXT
PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT = PastPresentationTimingFlagBitsEXT 0x00000002

conNamePastPresentationTimingFlagBitsEXT :: String
conNamePastPresentationTimingFlagBitsEXT :: String
conNamePastPresentationTimingFlagBitsEXT = String
"PastPresentationTimingFlagBitsEXT"

enumPrefixPastPresentationTimingFlagBitsEXT :: String
enumPrefixPastPresentationTimingFlagBitsEXT :: String
enumPrefixPastPresentationTimingFlagBitsEXT = String
"PAST_PRESENTATION_TIMING_ALLOW_"

showTablePastPresentationTimingFlagBitsEXT :: [(PastPresentationTimingFlagBitsEXT, String)]
showTablePastPresentationTimingFlagBitsEXT :: [(PastPresentationTimingFlagsEXT, String)]
showTablePastPresentationTimingFlagBitsEXT =
  [
    ( PastPresentationTimingFlagsEXT
PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT
    , String
"PARTIAL_RESULTS_BIT_EXT"
    )
  ,
    ( PastPresentationTimingFlagsEXT
PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT
    , String
"OUT_OF_ORDER_RESULTS_BIT_EXT"
    )
  ]

instance Show PastPresentationTimingFlagBitsEXT where
  showsPrec :: Int -> PastPresentationTimingFlagsEXT -> ShowS
showsPrec =
    String
-> [(PastPresentationTimingFlagsEXT, String)]
-> String
-> (PastPresentationTimingFlagsEXT -> Word32)
-> (Word32 -> ShowS)
-> Int
-> PastPresentationTimingFlagsEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixPastPresentationTimingFlagBitsEXT
      [(PastPresentationTimingFlagsEXT, String)]
showTablePastPresentationTimingFlagBitsEXT
      String
conNamePastPresentationTimingFlagBitsEXT
      (\(PastPresentationTimingFlagBitsEXT Word32
x) -> Word32
x)
      (\Word32
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word32
x)

instance Read PastPresentationTimingFlagBitsEXT where
  readPrec :: ReadPrec PastPresentationTimingFlagsEXT
readPrec =
    String
-> [(PastPresentationTimingFlagsEXT, String)]
-> String
-> (Word32 -> PastPresentationTimingFlagsEXT)
-> ReadPrec PastPresentationTimingFlagsEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixPastPresentationTimingFlagBitsEXT
      [(PastPresentationTimingFlagsEXT, String)]
showTablePastPresentationTimingFlagBitsEXT
      String
conNamePastPresentationTimingFlagBitsEXT
      Word32 -> PastPresentationTimingFlagsEXT
PastPresentationTimingFlagBitsEXT

type PresentTimingInfoFlagsEXT = PresentTimingInfoFlagBitsEXT

-- | VkPresentTimingInfoFlagBitsEXT - Bitmask specifying present timing info
-- flags
--
-- = Description
--
-- -   'PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT' specifies
--     that 'PresentTimingInfoEXT'::@targetTime@ is to be interpreted as a
--     relative time from the previous presentation’s
--     'PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT' stage. If the
--     @swapchain@ has never been used to present an image, the provided
--     @targetTime@ is ignored.
--
-- -   'PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT'
--     specifies that the application would prefer the image to be
--     presented earlier than the time specified in
--     'PresentTimingInfoEXT'::@targetTime@ if that time falls within the
--     first half of a refresh cycle. In that case, the presentation engine
--     /may/ choose to display the image at the start of that refresh
--     cycle.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_present_timing VK_EXT_present_timing>,
-- 'PresentTimingInfoFlagsEXT'
newtype PresentTimingInfoFlagBitsEXT = PresentTimingInfoFlagBitsEXT Flags
  deriving newtype (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
(PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> Eq PresentTimingInfoFlagsEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
== :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
$c/= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
/= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
Eq, Eq PresentTimingInfoFlagsEXT
Eq PresentTimingInfoFlagsEXT =>
(PresentTimingInfoFlagsEXT
 -> PresentTimingInfoFlagsEXT -> Ordering)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT
    -> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT
    -> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> Ord PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Ordering
PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
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
$ccompare :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Ordering
compare :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Ordering
$c< :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
< :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
$c<= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
<= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
$c> :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
> :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
$c>= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
>= :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> Bool
$cmax :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
max :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
$cmin :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
min :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
Ord, Ptr PresentTimingInfoFlagsEXT -> IO PresentTimingInfoFlagsEXT
Ptr PresentTimingInfoFlagsEXT
-> Int -> IO PresentTimingInfoFlagsEXT
Ptr PresentTimingInfoFlagsEXT
-> Int -> PresentTimingInfoFlagsEXT -> IO ()
Ptr PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> IO ()
PresentTimingInfoFlagsEXT -> Int
(PresentTimingInfoFlagsEXT -> Int)
-> (PresentTimingInfoFlagsEXT -> Int)
-> (Ptr PresentTimingInfoFlagsEXT
    -> Int -> IO PresentTimingInfoFlagsEXT)
-> (Ptr PresentTimingInfoFlagsEXT
    -> Int -> PresentTimingInfoFlagsEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO PresentTimingInfoFlagsEXT)
-> (forall b. Ptr b -> Int -> PresentTimingInfoFlagsEXT -> IO ())
-> (Ptr PresentTimingInfoFlagsEXT -> IO PresentTimingInfoFlagsEXT)
-> (Ptr PresentTimingInfoFlagsEXT
    -> PresentTimingInfoFlagsEXT -> IO ())
-> Storable PresentTimingInfoFlagsEXT
forall b. Ptr b -> Int -> IO PresentTimingInfoFlagsEXT
forall b. Ptr b -> Int -> PresentTimingInfoFlagsEXT -> 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
$csizeOf :: PresentTimingInfoFlagsEXT -> Int
sizeOf :: PresentTimingInfoFlagsEXT -> Int
$calignment :: PresentTimingInfoFlagsEXT -> Int
alignment :: PresentTimingInfoFlagsEXT -> Int
$cpeekElemOff :: Ptr PresentTimingInfoFlagsEXT
-> Int -> IO PresentTimingInfoFlagsEXT
peekElemOff :: Ptr PresentTimingInfoFlagsEXT
-> Int -> IO PresentTimingInfoFlagsEXT
$cpokeElemOff :: Ptr PresentTimingInfoFlagsEXT
-> Int -> PresentTimingInfoFlagsEXT -> IO ()
pokeElemOff :: Ptr PresentTimingInfoFlagsEXT
-> Int -> PresentTimingInfoFlagsEXT -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PresentTimingInfoFlagsEXT
peekByteOff :: forall b. Ptr b -> Int -> IO PresentTimingInfoFlagsEXT
$cpokeByteOff :: forall b. Ptr b -> Int -> PresentTimingInfoFlagsEXT -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> PresentTimingInfoFlagsEXT -> IO ()
$cpeek :: Ptr PresentTimingInfoFlagsEXT -> IO PresentTimingInfoFlagsEXT
peek :: Ptr PresentTimingInfoFlagsEXT -> IO PresentTimingInfoFlagsEXT
$cpoke :: Ptr PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> IO ()
poke :: Ptr PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT -> IO ()
Storable, PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT -> Zero PresentTimingInfoFlagsEXT
forall a. a -> Zero a
$czero :: PresentTimingInfoFlagsEXT
zero :: PresentTimingInfoFlagsEXT
Zero, Eq PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT
Eq PresentTimingInfoFlagsEXT =>
(PresentTimingInfoFlagsEXT
 -> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT
    -> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT
    -> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> PresentTimingInfoFlagsEXT
-> (Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> Bool)
-> (PresentTimingInfoFlagsEXT -> Maybe Int)
-> (PresentTimingInfoFlagsEXT -> Int)
-> (PresentTimingInfoFlagsEXT -> Bool)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT)
-> (PresentTimingInfoFlagsEXT -> Int)
-> Bits PresentTimingInfoFlagsEXT
Int -> PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT -> Bool
PresentTimingInfoFlagsEXT -> Int
PresentTimingInfoFlagsEXT -> Maybe Int
PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT -> Int -> Bool
PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
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
$c.&. :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
.&. :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
$c.|. :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
.|. :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
$cxor :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
xor :: PresentTimingInfoFlagsEXT
-> PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
$ccomplement :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
complement :: PresentTimingInfoFlagsEXT -> PresentTimingInfoFlagsEXT
$cshift :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
shift :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$crotate :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
rotate :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$czeroBits :: PresentTimingInfoFlagsEXT
zeroBits :: PresentTimingInfoFlagsEXT
$cbit :: Int -> PresentTimingInfoFlagsEXT
bit :: Int -> PresentTimingInfoFlagsEXT
$csetBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
setBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$cclearBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
clearBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$ccomplementBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
complementBit :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$ctestBit :: PresentTimingInfoFlagsEXT -> Int -> Bool
testBit :: PresentTimingInfoFlagsEXT -> Int -> Bool
$cbitSizeMaybe :: PresentTimingInfoFlagsEXT -> Maybe Int
bitSizeMaybe :: PresentTimingInfoFlagsEXT -> Maybe Int
$cbitSize :: PresentTimingInfoFlagsEXT -> Int
bitSize :: PresentTimingInfoFlagsEXT -> Int
$cisSigned :: PresentTimingInfoFlagsEXT -> Bool
isSigned :: PresentTimingInfoFlagsEXT -> Bool
$cshiftL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
shiftL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$cunsafeShiftL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
unsafeShiftL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$cshiftR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
shiftR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$cunsafeShiftR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
unsafeShiftR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$crotateL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
rotateL :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$crotateR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
rotateR :: PresentTimingInfoFlagsEXT -> Int -> PresentTimingInfoFlagsEXT
$cpopCount :: PresentTimingInfoFlagsEXT -> Int
popCount :: PresentTimingInfoFlagsEXT -> Int
Bits, Bits PresentTimingInfoFlagsEXT
Bits PresentTimingInfoFlagsEXT =>
(PresentTimingInfoFlagsEXT -> Int)
-> (PresentTimingInfoFlagsEXT -> Int)
-> (PresentTimingInfoFlagsEXT -> Int)
-> FiniteBits PresentTimingInfoFlagsEXT
PresentTimingInfoFlagsEXT -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: PresentTimingInfoFlagsEXT -> Int
finiteBitSize :: PresentTimingInfoFlagsEXT -> Int
$ccountLeadingZeros :: PresentTimingInfoFlagsEXT -> Int
countLeadingZeros :: PresentTimingInfoFlagsEXT -> Int
$ccountTrailingZeros :: PresentTimingInfoFlagsEXT -> Int
countTrailingZeros :: PresentTimingInfoFlagsEXT -> Int
FiniteBits)

-- No documentation found for Nested "VkPresentTimingInfoFlagBitsEXT" "VK_PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT"
pattern $mPRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT :: forall {r}.
PresentTimingInfoFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT :: PresentTimingInfoFlagsEXT
PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT = PresentTimingInfoFlagBitsEXT 0x00000001

-- No documentation found for Nested "VkPresentTimingInfoFlagBitsEXT" "VK_PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT"
pattern $mPRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT :: forall {r}.
PresentTimingInfoFlagsEXT -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT :: PresentTimingInfoFlagsEXT
PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT = PresentTimingInfoFlagBitsEXT 0x00000002

conNamePresentTimingInfoFlagBitsEXT :: String
conNamePresentTimingInfoFlagBitsEXT :: String
conNamePresentTimingInfoFlagBitsEXT = String
"PresentTimingInfoFlagBitsEXT"

enumPrefixPresentTimingInfoFlagBitsEXT :: String
enumPrefixPresentTimingInfoFlagBitsEXT :: String
enumPrefixPresentTimingInfoFlagBitsEXT = String
"PRESENT_TIMING_INFO_PRESENT_AT_"

showTablePresentTimingInfoFlagBitsEXT :: [(PresentTimingInfoFlagBitsEXT, String)]
showTablePresentTimingInfoFlagBitsEXT :: [(PresentTimingInfoFlagsEXT, String)]
showTablePresentTimingInfoFlagBitsEXT =
  [
    ( PresentTimingInfoFlagsEXT
PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT
    , String
"RELATIVE_TIME_BIT_EXT"
    )
  ,
    ( PresentTimingInfoFlagsEXT
PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT
    , String
"NEAREST_REFRESH_CYCLE_BIT_EXT"
    )
  ]

instance Show PresentTimingInfoFlagBitsEXT where
  showsPrec :: Int -> PresentTimingInfoFlagsEXT -> ShowS
showsPrec =
    String
-> [(PresentTimingInfoFlagsEXT, String)]
-> String
-> (PresentTimingInfoFlagsEXT -> Word32)
-> (Word32 -> ShowS)
-> Int
-> PresentTimingInfoFlagsEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixPresentTimingInfoFlagBitsEXT
      [(PresentTimingInfoFlagsEXT, String)]
showTablePresentTimingInfoFlagBitsEXT
      String
conNamePresentTimingInfoFlagBitsEXT
      (\(PresentTimingInfoFlagBitsEXT Word32
x) -> Word32
x)
      (\Word32
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word32
x)

instance Read PresentTimingInfoFlagBitsEXT where
  readPrec :: ReadPrec PresentTimingInfoFlagsEXT
readPrec =
    String
-> [(PresentTimingInfoFlagsEXT, String)]
-> String
-> (Word32 -> PresentTimingInfoFlagsEXT)
-> ReadPrec PresentTimingInfoFlagsEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixPresentTimingInfoFlagBitsEXT
      [(PresentTimingInfoFlagsEXT, String)]
showTablePresentTimingInfoFlagBitsEXT
      String
conNamePresentTimingInfoFlagBitsEXT
      Word32 -> PresentTimingInfoFlagsEXT
PresentTimingInfoFlagBitsEXT

type EXT_PRESENT_TIMING_SPEC_VERSION = 3

-- No documentation found for TopLevel "VK_EXT_PRESENT_TIMING_SPEC_VERSION"
pattern EXT_PRESENT_TIMING_SPEC_VERSION :: forall a . Integral a => a
pattern $mEXT_PRESENT_TIMING_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_PRESENT_TIMING_SPEC_VERSION :: forall a. Integral a => a
EXT_PRESENT_TIMING_SPEC_VERSION = 3


type EXT_PRESENT_TIMING_EXTENSION_NAME = "VK_EXT_present_timing"

-- No documentation found for TopLevel "VK_EXT_PRESENT_TIMING_EXTENSION_NAME"
pattern EXT_PRESENT_TIMING_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mEXT_PRESENT_TIMING_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_PRESENT_TIMING_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
EXT_PRESENT_TIMING_EXTENSION_NAME = "VK_EXT_present_timing"