{-# language CPP #-}
-- | = Name
--
-- VK_KHR_surface - instance extension
--
-- = VK_KHR_surface
--
-- [__Name String__]
--     @VK_KHR_surface@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     1
--
-- [__Revision__]
--     25
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     None
--
-- [__Contact__]
--
--     -   James Jones
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_surface] @cubanismo%0A*Here describe the issue or question you have about the VK_KHR_surface extension* >
--
--     -   Ian Elliott
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_surface] @ianelliottus%0A*Here describe the issue or question you have about the VK_KHR_surface extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2016-08-25
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Patrick Doane, Blizzard
--
--     -   Ian Elliott, LunarG
--
--     -   Jesse Hall, Google
--
--     -   James Jones, NVIDIA
--
--     -   David Mao, AMD
--
--     -   Norbert Nopper, Freescale
--
--     -   Alon Or-bach, Samsung
--
--     -   Daniel Rakos, AMD
--
--     -   Graham Sellers, AMD
--
--     -   Jeff Vigil, Qualcomm
--
--     -   Chia-I Wu, LunarG
--
--     -   Faith Ekstrand, Intel
--
-- == Description
--
-- The @VK_KHR_surface@ extension is an instance extension. It introduces
-- 'Vulkan.Extensions.Handles.SurfaceKHR' objects, which abstract native
-- platform surface or window objects for use with Vulkan. It also provides
-- a way to determine whether a queue family in a physical device supports
-- presenting to particular surface.
--
-- Separate extensions for each platform provide the mechanisms for
-- creating 'Vulkan.Extensions.Handles.SurfaceKHR' objects, but once
-- created they may be used in this and other platform-independent
-- extensions, in particular the @VK_KHR_swapchain@ extension.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.SurfaceKHR'
--
-- == New Commands
--
-- -   'destroySurfaceKHR'
--
-- -   'getPhysicalDeviceSurfaceCapabilitiesKHR'
--
-- -   'getPhysicalDeviceSurfaceFormatsKHR'
--
-- -   'getPhysicalDeviceSurfacePresentModesKHR'
--
-- -   'getPhysicalDeviceSurfaceSupportKHR'
--
-- == New Structures
--
-- -   'SurfaceCapabilitiesKHR'
--
-- -   'SurfaceFormatKHR'
--
-- == New Enums
--
-- -   'ColorSpaceKHR'
--
-- -   'CompositeAlphaFlagBitsKHR'
--
-- -   'PresentModeKHR'
--
-- -   'SurfaceTransformFlagBitsKHR'
--
-- == New Bitmasks
--
-- -   'CompositeAlphaFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_SURFACE_EXTENSION_NAME'
--
-- -   'KHR_SURFACE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_SURFACE_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
-- == Examples
--
-- The example code for the @VK_KHR_surface@ and @VK_KHR_swapchain@
-- extensions was removed from the appendix after revision 1.0.29. This WSI
-- example code was ported to the cube demo that is shipped with the
-- official Khronos SDK, and is being kept up-to-date in that location
-- (see:
-- <https://github.com/KhronosGroup/Vulkan-Tools/blob/main/cube/cube.c>).
--
-- == Issues
--
-- 1) Should this extension include a method to query whether a physical
-- device supports presenting to a specific window or native surface on a
-- given platform?
--
-- __RESOLVED__: Yes. Without this, applications would need to create a
-- device instance to determine whether a particular window can be
-- presented to. Knowing that a device supports presentation to a platform
-- in general is not sufficient, as a single machine might support multiple
-- seats, or instances of the platform that each use different underlying
-- physical devices. Additionally, on some platforms, such as the X Window
-- System, different drivers and devices might be used for different
-- windows depending on which section of the desktop they exist on.
--
-- 2) Should the 'getPhysicalDeviceSurfaceCapabilitiesKHR',
-- 'getPhysicalDeviceSurfaceFormatsKHR', and
-- 'getPhysicalDeviceSurfacePresentModesKHR' functions be in this extension
-- and operate on physical devices, rather than being in @VK_KHR_swapchain@
-- (i.e. device extension) and being dependent on
-- 'Vulkan.Core10.Handles.Device'?
--
-- __RESOLVED__: Yes. While it might be useful to depend on
-- 'Vulkan.Core10.Handles.Device' (and therefore on enabled extensions and
-- features) for the queries, Vulkan was released only with the
-- 'Vulkan.Core10.Handles.PhysicalDevice' versions. Many cases can be
-- resolved by a Valid Usage statement, and\/or by a separate @pNext@ chain
-- version of the query structure specific to a given extension or
-- parameters, via extensible versions of the queries:
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.getPhysicalDeviceSurfacePresentModes2EXT',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceCapabilities2KHR',
-- and
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.getPhysicalDeviceSurfaceFormats2KHR'.
--
-- 3) Should Vulkan support Xlib or XCB as the API for accessing the X
-- Window System platform?
--
-- __RESOLVED__: Both. XCB is a more modern and efficient API, but Xlib
-- usage is deeply ingrained in many applications and likely will remain in
-- use for the foreseeable future. Not all drivers necessarily need to
-- support both, but including both as options in the core specification
-- will probably encourage support, which should in turn ease adoption of
-- the Vulkan API in older codebases. Additionally, the performance
-- improvements possible with XCB likely will not have a measurable impact
-- on the performance of Vulkan presentation and other minimal window
-- system interactions defined here.
--
-- 4) Should the GBM platform be included in the list of platform enums?
--
-- __RESOLVED__: Deferred, and will be addressed with a platform-specific
-- extension to be written in the future.
--
-- == Version History
--
-- -   Revision 1, 2015-05-20 (James Jones)
--
--     -   Initial draft, based on LunarG KHR spec, other KHR specs,
--         patches attached to bugs.
--
-- -   Revision 2, 2015-05-22 (Ian Elliott)
--
--     -   Created initial Description section.
--
--     -   Removed query for whether a platform requires the use of a queue
--         for presentation, since it was decided that presentation will
--         always be modeled as being part of the queue.
--
--     -   Fixed typos and other minor mistakes.
--
-- -   Revision 3, 2015-05-26 (Ian Elliott)
--
--     -   Improved the Description section.
--
-- -   Revision 4, 2015-05-27 (James Jones)
--
--     -   Fixed compilation errors in example code.
--
-- -   Revision 5, 2015-06-01 (James Jones)
--
--     -   Added issues 1 and 2 and made related spec updates.
--
-- -   Revision 6, 2015-06-01 (James Jones)
--
--     -   Merged the platform type mappings table previously removed from
--         VK_KHR_swapchain with the platform description table in this
--         spec.
--
--     -   Added issues 3 and 4 documenting choices made when building the
--         initial list of native platforms supported.
--
-- -   Revision 7, 2015-06-11 (Ian Elliott)
--
--     -   Updated table 1 per input from the KHR TSG.
--
--     -   Updated issue 4 (GBM) per discussion with Daniel Stone. He will
--         create a platform-specific extension sometime in the future.
--
-- -   Revision 8, 2015-06-17 (James Jones)
--
--     -   Updated enum-extending values using new convention.
--
--     -   Fixed the value of VK_SURFACE_PLATFORM_INFO_TYPE_SUPPORTED_KHR.
--
-- -   Revision 9, 2015-06-17 (James Jones)
--
--     -   Rebased on Vulkan API version 126.
--
-- -   Revision 10, 2015-06-18 (James Jones)
--
--     -   Marked issues 2 and 3 resolved.
--
-- -   Revision 11, 2015-06-23 (Ian Elliott)
--
--     -   Examples now show use of function pointers for extension
--         functions.
--
--     -   Eliminated extraneous whitespace.
--
-- -   Revision 12, 2015-07-07 (Daniel Rakos)
--
--     -   Added error section describing when each error is expected to be
--         reported.
--
--     -   Replaced the term “queue node index” with “queue family index”
--         in the spec as that is the agreed term to be used in the latest
--         version of the core header and spec.
--
--     -   Replaced bool32_t with VkBool32.
--
-- -   Revision 13, 2015-08-06 (Daniel Rakos)
--
--     -   Updated spec against latest core API header version.
--
-- -   Revision 14, 2015-08-20 (Ian Elliott)
--
--     -   Renamed this extension and all of its enumerations, types,
--         functions, etc. This makes it compliant with the proposed
--         standard for Vulkan extensions.
--
--     -   Switched from “revision” to “version”, including use of the
--         VK_MAKE_VERSION macro in the header file.
--
--     -   Did miscellaneous cleanup, etc.
--
-- -   Revision 15, 2015-08-20 (Ian Elliott—​porting a 2015-07-29 change
--     from James Jones)
--
--     -   Moved the surface transform enums here from VK_WSI_swapchain so
--         they could be reused by VK_WSI_display.
--
-- -   Revision 16, 2015-09-01 (James Jones)
--
--     -   Restore single-field revision number.
--
-- -   Revision 17, 2015-09-01 (James Jones)
--
--     -   Fix example code compilation errors.
--
-- -   Revision 18, 2015-09-26 (Jesse Hall)
--
--     -   Replaced VkSurfaceDescriptionKHR with the VkSurfaceKHR object,
--         which is created via layered extensions. Added
--         VkDestroySurfaceKHR.
--
-- -   Revision 19, 2015-09-28 (Jesse Hall)
--
--     -   Renamed from VK_EXT_KHR_swapchain to VK_EXT_KHR_surface.
--
-- -   Revision 20, 2015-09-30 (Jeff Vigil)
--
--     -   Add error result VK_ERROR_SURFACE_LOST_KHR.
--
-- -   Revision 21, 2015-10-15 (Daniel Rakos)
--
--     -   Updated the resolution of issue #2 and include the surface
--         capability queries in this extension.
--
--     -   Renamed SurfaceProperties to SurfaceCapabilities as it better
--         reflects that the values returned are the capabilities of the
--         surface on a particular device.
--
--     -   Other minor cleanup and consistency changes.
--
-- -   Revision 22, 2015-10-26 (Ian Elliott)
--
--     -   Renamed from VK_EXT_KHR_surface to VK_KHR_surface.
--
-- -   Revision 23, 2015-11-03 (Daniel Rakos)
--
--     -   Added allocation callbacks to vkDestroySurfaceKHR.
--
-- -   Revision 24, 2015-11-10 (Jesse Hall)
--
--     -   Removed VkSurfaceTransformKHR. Use VkSurfaceTransformFlagBitsKHR
--         instead.
--
--     -   Rename VkSurfaceCapabilitiesKHR member maxImageArraySize to
--         maxImageArrayLayers.
--
-- -   Revision 25, 2016-01-14 (James Jones)
--
--     -   Moved VK_ERROR_NATIVE_WINDOW_IN_USE_KHR from the
--         VK_KHR_android_surface to the VK_KHR_surface extension.
--
-- -   2016-08-23 (Ian Elliott)
--
--     -   Update the example code, to not have so many characters per
--         line, and to split out a new example to show how to obtain
--         function pointers.
--
-- -   2016-08-25 (Ian Elliott)
--
--     -   A note was added at the beginning of the example code, stating
--         that it will be removed from future versions of the appendix.
--
-- == 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_KHR_surface Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_surface  ( destroySurfaceKHR
                                         , getPhysicalDeviceSurfaceSupportKHR
                                         , getPhysicalDeviceSurfaceCapabilitiesKHR
                                         , getPhysicalDeviceSurfaceFormatsKHR
                                         , getPhysicalDeviceSurfacePresentModesKHR
                                         , pattern COLORSPACE_SRGB_NONLINEAR_KHR
                                         , SurfaceCapabilitiesKHR(..)
                                         , SurfaceFormatKHR(..)
                                         , PresentModeKHR( PRESENT_MODE_IMMEDIATE_KHR
                                                         , PRESENT_MODE_MAILBOX_KHR
                                                         , PRESENT_MODE_FIFO_KHR
                                                         , PRESENT_MODE_FIFO_RELAXED_KHR
                                                         , PRESENT_MODE_FIFO_LATEST_READY_KHR
                                                         , PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
                                                         , PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR
                                                         , ..
                                                         )
                                         , ColorSpaceKHR( COLOR_SPACE_SRGB_NONLINEAR_KHR
                                                        , COLOR_SPACE_DISPLAY_NATIVE_AMD
                                                        , COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
                                                        , COLOR_SPACE_PASS_THROUGH_EXT
                                                        , COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
                                                        , COLOR_SPACE_ADOBERGB_LINEAR_EXT
                                                        , COLOR_SPACE_HDR10_HLG_EXT
                                                        , COLOR_SPACE_DOLBYVISION_EXT
                                                        , COLOR_SPACE_HDR10_ST2084_EXT
                                                        , COLOR_SPACE_BT2020_LINEAR_EXT
                                                        , COLOR_SPACE_BT709_NONLINEAR_EXT
                                                        , COLOR_SPACE_BT709_LINEAR_EXT
                                                        , COLOR_SPACE_DCI_P3_NONLINEAR_EXT
                                                        , COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
                                                        , COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
                                                        , COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
                                                        , ..
                                                        )
                                         , CompositeAlphaFlagsKHR
                                         , CompositeAlphaFlagBitsKHR( COMPOSITE_ALPHA_OPAQUE_BIT_KHR
                                                                    , COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
                                                                    , COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
                                                                    , COMPOSITE_ALPHA_INHERIT_BIT_KHR
                                                                    , ..
                                                                    )
                                         , SurfaceTransformFlagsKHR
                                         , SurfaceTransformFlagBitsKHR( SURFACE_TRANSFORM_IDENTITY_BIT_KHR
                                                                      , SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
                                                                      , SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
                                                                      , SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
                                                                      , SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
                                                                      , SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
                                                                      , SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
                                                                      , SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
                                                                      , SURFACE_TRANSFORM_INHERIT_BIT_KHR
                                                                      , ..
                                                                      )
                                         , KHR_SURFACE_SPEC_VERSION
                                         , pattern KHR_SURFACE_SPEC_VERSION
                                         , KHR_SURFACE_EXTENSION_NAME
                                         , pattern KHR_SURFACE_EXTENSION_NAME
                                         , SurfaceKHR(..)
                                         ) 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 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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Bool32(..))
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlags)
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Core10.Handles (Instance(Instance))
import Vulkan.Dynamic (InstanceCmds(pVkDestroySurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceSurfaceCapabilitiesKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceSurfaceFormatsKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceSurfacePresentModesKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceSurfaceSupportKHR))
import Vulkan.Core10.Handles (Instance_T)
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Extensions.Handles (SurfaceKHR)
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroySurfaceKHR
  :: FunPtr (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ()) -> Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroySurfaceKHR - Destroy a VkSurfaceKHR object
--
-- = Description
--
-- Destroying a 'Vulkan.Extensions.Handles.SurfaceKHR' merely severs the
-- connection between Vulkan and the native surface, and does not imply
-- destroying the native surface, closing a window, or similar behavior.
--
-- == Valid Usage
--
-- -   #VUID-vkDestroySurfaceKHR-surface-01266# All
--     'Vulkan.Extensions.Handles.SwapchainKHR' objects created for
--     @surface@ /must/ have been destroyed prior to destroying @surface@
--
-- -   #VUID-vkDestroySurfaceKHR-surface-01267# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @surface@ was created, a compatible set of callbacks
--     /must/ be provided here
--
-- -   #VUID-vkDestroySurfaceKHR-surface-01268# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @surface@ was created, @pAllocator@ /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroySurfaceKHR-instance-parameter# @instance@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   #VUID-vkDestroySurfaceKHR-surface-parameter# If @surface@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @surface@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- -   #VUID-vkDestroySurfaceKHR-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroySurfaceKHR-surface-parent# If @surface@ is a valid
--     handle, it /must/ have been created, allocated, or retrieved from
--     @instance@
--
-- == Host Synchronization
--
-- -   Host access to @surface@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Instance', 'Vulkan.Extensions.Handles.SurfaceKHR'
destroySurfaceKHR :: forall io
                   . (MonadIO io)
                  => -- | @instance@ is the instance used to create the surface.
                     Instance
                  -> -- | @surface@ is the surface to destroy.
                     SurfaceKHR
                  -> -- | @pAllocator@ is the allocator used for host memory allocated for the
                     -- surface object when there is no more specific allocator available (see
                     -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>).
                     ("allocator" ::: Maybe AllocationCallbacks)
                  -> io ()
destroySurfaceKHR :: forall (io :: * -> *).
MonadIO io =>
Instance
-> SurfaceKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySurfaceKHR Instance
instance' SurfaceKHR
surface "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroySurfaceKHRPtr :: FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroySurfaceKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
pVkDestroySurfaceKHR (case Instance
instance' of Instance{InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds :: Instance -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroySurfaceKHRPtr FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
     (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
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 vkDestroySurfaceKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroySurfaceKHR' :: Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ()
vkDestroySurfaceKHR' = FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
-> Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ()
mkVkDestroySurfaceKHR FunPtr
  (Ptr Instance_T -> SurfaceKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroySurfaceKHRPtr
  pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
 -> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  lift $ traceAroundEvent "vkDestroySurfaceKHR" (vkDestroySurfaceKHR'
                                                   (instanceHandle (instance'))
                                                   (surface)
                                                   pAllocator)
  pure $ ()


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

-- | vkGetPhysicalDeviceSurfaceSupportKHR - Query if presentation is
-- supported
--
-- == Valid Usage
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceSupportKHR-queueFamilyIndex-01269#
--     @queueFamilyIndex@ /must/ be less than @pQueueFamilyPropertyCount@
--     returned by
--     'Vulkan.Core10.DeviceInitialization.getPhysicalDeviceQueueFamilyProperties'
--     for the given @physicalDevice@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceSupportKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter#
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter#
--     @pSupported@ /must/ be a valid pointer to a
--     'Vulkan.Core10.FundamentalTypes.Bool32' value
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceSupportKHR-commonparent# Both of
--     @physicalDevice@, and @surface@ /must/ have been created, allocated,
--     or retrieved from the same 'Vulkan.Core10.Handles.Instance'
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_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_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Handles.PhysicalDevice',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getPhysicalDeviceSurfaceSupportKHR :: forall io
                                    . (MonadIO io)
                                   => -- | @physicalDevice@ is the physical device.
                                      PhysicalDevice
                                   -> -- | @queueFamilyIndex@ is the queue family.
                                      ("queueFamilyIndex" ::: Word32)
                                   -> -- | @surface@ is the surface.
                                      SurfaceKHR
                                   -> io (("supported" ::: Bool))
getPhysicalDeviceSurfaceSupportKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice -> Word32 -> SurfaceKHR -> io Bool
getPhysicalDeviceSurfaceSupportKHR PhysicalDevice
physicalDevice
                                     Word32
queueFamilyIndex
                                     SurfaceKHR
surface = IO Bool -> io Bool
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> io Bool)
-> (ContT Bool IO Bool -> IO Bool) -> ContT Bool IO Bool -> io Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Bool IO Bool -> IO Bool
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Bool IO Bool -> io Bool) -> ContT Bool IO Bool -> io Bool
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceSurfaceSupportKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
vkGetPhysicalDeviceSurfaceSupportKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
pVkGetPhysicalDeviceSurfaceSupportKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds :: PhysicalDevice -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  IO () -> ContT Bool IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT Bool m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Bool IO ()) -> IO () -> ContT Bool IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
vkGetPhysicalDeviceSurfaceSupportKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> 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 vkGetPhysicalDeviceSurfaceSupportKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceSurfaceSupportKHR' :: Ptr PhysicalDevice_T
-> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result
vkGetPhysicalDeviceSurfaceSupportKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
-> Ptr PhysicalDevice_T
-> Word32
-> SurfaceKHR
-> Ptr Bool32
-> IO Result
mkVkGetPhysicalDeviceSurfaceSupportKHR FunPtr
  (Ptr PhysicalDevice_T
   -> Word32 -> SurfaceKHR -> Ptr Bool32 -> IO Result)
vkGetPhysicalDeviceSurfaceSupportKHRPtr
  pPSupported <- ((Ptr Bool32 -> IO Bool) -> IO Bool) -> ContT Bool IO (Ptr Bool32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Bool32 -> IO Bool) -> IO Bool)
 -> ContT Bool IO (Ptr Bool32))
-> ((Ptr Bool32 -> IO Bool) -> IO Bool)
-> ContT Bool IO (Ptr Bool32)
forall a b. (a -> b) -> a -> b
$ IO (Ptr Bool32)
-> (Ptr Bool32 -> IO ()) -> (Ptr Bool32 -> IO Bool) -> IO Bool
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Bool32 Int
4) Ptr Bool32 -> IO ()
forall a. Ptr a -> IO ()
free
  r <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfaceSupportKHR" (vkGetPhysicalDeviceSurfaceSupportKHR'
                                                                         (physicalDeviceHandle (physicalDevice))
                                                                         (queueFamilyIndex)
                                                                         (surface)
                                                                         (pPSupported))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pSupported <- lift $ peek @Bool32 pPSupported
  pure $ ((bool32ToBool pSupported))


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

-- | vkGetPhysicalDeviceSurfaceCapabilitiesKHR - Query surface capabilities
--
-- == Valid Usage
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-06211#
--     @surface@ /must/ be supported by @physicalDevice@, as reported by
--     'getPhysicalDeviceSurfaceSupportKHR' or an equivalent
--     platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-parameter#
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter#
--     @pSurfaceCapabilities@ /must/ be a valid pointer to a
--     'SurfaceCapabilitiesKHR' structure
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-commonparent# Both
--     of @physicalDevice@, and @surface@ /must/ have been created,
--     allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Instance'
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_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_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Core10.Handles.PhysicalDevice', 'SurfaceCapabilitiesKHR',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getPhysicalDeviceSurfaceCapabilitiesKHR :: forall io
                                         . (MonadIO io)
                                        => -- | @physicalDevice@ is the physical device that will be associated with the
                                           -- swapchain to be created, as described for
                                           -- 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                           PhysicalDevice
                                        -> -- | @surface@ is the surface that will be associated with the swapchain.
                                           SurfaceKHR
                                        -> io (SurfaceCapabilitiesKHR)
getPhysicalDeviceSurfaceCapabilitiesKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice -> SurfaceKHR -> io SurfaceCapabilitiesKHR
getPhysicalDeviceSurfaceCapabilitiesKHR PhysicalDevice
physicalDevice
                                          SurfaceKHR
surface = IO SurfaceCapabilitiesKHR -> io SurfaceCapabilitiesKHR
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SurfaceCapabilitiesKHR -> io SurfaceCapabilitiesKHR)
-> (ContT SurfaceCapabilitiesKHR IO SurfaceCapabilitiesKHR
    -> IO SurfaceCapabilitiesKHR)
-> ContT SurfaceCapabilitiesKHR IO SurfaceCapabilitiesKHR
-> io SurfaceCapabilitiesKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT SurfaceCapabilitiesKHR IO SurfaceCapabilitiesKHR
-> IO SurfaceCapabilitiesKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT SurfaceCapabilitiesKHR IO SurfaceCapabilitiesKHR
 -> io SurfaceCapabilitiesKHR)
-> ContT SurfaceCapabilitiesKHR IO SurfaceCapabilitiesKHR
-> io SurfaceCapabilitiesKHR
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceSurfaceCapabilitiesKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
vkGetPhysicalDeviceSurfaceCapabilitiesKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
pVkGetPhysicalDeviceSurfaceCapabilitiesKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  IO () -> ContT SurfaceCapabilitiesKHR IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT SurfaceCapabilitiesKHR m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SurfaceCapabilitiesKHR IO ())
-> IO () -> ContT SurfaceCapabilitiesKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
vkGetPhysicalDeviceSurfaceCapabilitiesKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> 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 vkGetPhysicalDeviceSurfaceCapabilitiesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceSurfaceCapabilitiesKHR' :: Ptr PhysicalDevice_T
-> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result
vkGetPhysicalDeviceSurfaceCapabilitiesKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
-> Ptr PhysicalDevice_T
-> SurfaceKHR
-> Ptr SurfaceCapabilitiesKHR
-> IO Result
mkVkGetPhysicalDeviceSurfaceCapabilitiesKHR FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr SurfaceCapabilitiesKHR -> IO Result)
vkGetPhysicalDeviceSurfaceCapabilitiesKHRPtr
  pPSurfaceCapabilities <- ((Ptr SurfaceCapabilitiesKHR -> IO SurfaceCapabilitiesKHR)
 -> IO SurfaceCapabilitiesKHR)
-> ContT SurfaceCapabilitiesKHR IO (Ptr SurfaceCapabilitiesKHR)
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 @SurfaceCapabilitiesKHR)
  r <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfaceCapabilitiesKHR" (vkGetPhysicalDeviceSurfaceCapabilitiesKHR'
                                                                              (physicalDeviceHandle (physicalDevice))
                                                                              (surface)
                                                                              (pPSurfaceCapabilities))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pSurfaceCapabilities <- lift $ peekCStruct @SurfaceCapabilitiesKHR pPSurfaceCapabilities
  pure $ (pSurfaceCapabilities)


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

-- | vkGetPhysicalDeviceSurfaceFormatsKHR - Query color formats supported by
-- surface
--
-- = Description
--
-- If @pSurfaceFormats@ is @NULL@, then the number of format pairs
-- supported for the given @surface@ is returned in @pSurfaceFormatCount@.
-- Otherwise, @pSurfaceFormatCount@ /must/ point to a variable set by the
-- application to the number of elements in the @pSurfaceFormats@ array,
-- and on return the variable is overwritten with the number of structures
-- actually written to @pSurfaceFormats@. If the value of
-- @pSurfaceFormatCount@ is less than the number of format pairs supported,
-- at most @pSurfaceFormatCount@ structures will be written, and
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not all the
-- available format pairs were returned.
--
-- The number of format pairs supported /must/ be greater than or equal to
-- 1. @pSurfaceFormats@ /must/ not contain an entry whose value for
-- @format@ is 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED'.
--
-- If @pSurfaceFormats@ includes an entry whose value for @colorSpace@ is
-- 'COLOR_SPACE_SRGB_NONLINEAR_KHR' and whose value for @format@ is a UNORM
-- (or SRGB) format and the corresponding SRGB (or UNORM) format is a color
-- renderable format for
-- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL', then
-- @pSurfaceFormats@ /must/ also contain an entry with the same value for
-- @colorSpace@ and @format@ equal to the corresponding SRGB (or UNORM)
-- format.
--
-- If the @VK_GOOGLE_surfaceless_query@ extension is enabled, the values
-- returned in @pSurfaceFormats@ will be identical for every valid surface
-- created on this physical device, and so @surface@ /can/ be
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE'.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-06524# If the
--     @VK_GOOGLE_surfaceless_query@ extension is not enabled, @surface@
--     /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-06525# If
--     @surface@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @surface@
--     /must/ be supported by @physicalDevice@, as reported by
--     'getPhysicalDeviceSurfaceSupportKHR' or an equivalent
--     platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-parameter# If
--     @surface@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @surface@
--     /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter#
--     @pSurfaceFormatCount@ /must/ be a valid pointer to a @uint32_t@
--     value
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter#
--     If the value referenced by @pSurfaceFormatCount@ is not @0@, and
--     @pSurfaceFormats@ is not @NULL@, @pSurfaceFormats@ /must/ be a valid
--     pointer to an array of @pSurfaceFormatCount@ 'SurfaceFormatKHR'
--     structures
--
-- -   #VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-commonparent# Both of
--     @physicalDevice@, and @surface@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Instance'
--
-- == 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_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Core10.Handles.PhysicalDevice', 'SurfaceFormatKHR',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getPhysicalDeviceSurfaceFormatsKHR :: forall io
                                    . (MonadIO io)
                                   => -- | @physicalDevice@ is the physical device that will be associated with the
                                      -- swapchain to be created, as described for
                                      -- 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                      PhysicalDevice
                                   -> -- | @surface@ is the surface that will be associated with the swapchain.
                                      SurfaceKHR
                                   -> io (Result, ("surfaceFormats" ::: Vector SurfaceFormatKHR))
getPhysicalDeviceSurfaceFormatsKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> SurfaceKHR
-> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
getPhysicalDeviceSurfaceFormatsKHR PhysicalDevice
physicalDevice
                                     SurfaceKHR
surface = IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
-> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
 -> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> (ContT
      (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
      IO
      (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
     IO
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
-> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
  IO
  (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
-> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
   IO
   (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
 -> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
     IO
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
-> io (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceSurfaceFormatsKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
vkGetPhysicalDeviceSurfaceFormatsKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
pVkGetPhysicalDeviceSurfaceFormatsKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  IO ()
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ()
forall (m :: * -> *) a.
Monad m =>
m a
-> ContT (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ())
-> IO ()
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
vkGetPhysicalDeviceSurfaceFormatsKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> 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 vkGetPhysicalDeviceSurfaceFormatsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceSurfaceFormatsKHR' :: Ptr PhysicalDevice_T
-> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result
vkGetPhysicalDeviceSurfaceFormatsKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
-> Ptr PhysicalDevice_T
-> SurfaceKHR
-> Ptr Word32
-> Ptr SurfaceFormatKHR
-> IO Result
mkVkGetPhysicalDeviceSurfaceFormatsKHR FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr SurfaceFormatKHR -> IO Result)
vkGetPhysicalDeviceSurfaceFormatsKHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  pPSurfaceFormatCount <- ((Ptr Word32
  -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
 -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
     IO
     (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32
   -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
  -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
 -> ContT
      (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
      IO
      (Ptr Word32))
-> ((Ptr Word32
     -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
     IO
     (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO (Ptr Word32)
-> (Ptr Word32 -> IO ())
-> (Ptr Word32
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
free
  r <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfaceFormatsKHR" (vkGetPhysicalDeviceSurfaceFormatsKHR'
                                                                         physicalDevice'
                                                                         (surface)
                                                                         (pPSurfaceFormatCount)
                                                                         (nullPtr))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pSurfaceFormatCount <- lift $ peek @Word32 pPSurfaceFormatCount
  pPSurfaceFormats <- ContT $ bracket (callocBytes @SurfaceFormatKHR ((fromIntegral (pSurfaceFormatCount)) * 8)) free
  _ <- traverse (\Int
i -> ((() -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
 -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
  -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
 -> ContT
      (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ())
-> ((()
     -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ContT
     (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SurfaceFormatKHR
-> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
-> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall b. Ptr SurfaceFormatKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct (Ptr SurfaceFormatKHR
pPSurfaceFormats Ptr SurfaceFormatKHR -> Int -> Ptr SurfaceFormatKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8) :: Ptr SurfaceFormatKHR) (IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
 -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> ((()
     -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> (()
    -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR))
-> () -> IO (Result, "surfaceFormats" ::: Vector SurfaceFormatKHR)
forall a b. (a -> b) -> a -> b
$ ())) [0..(fromIntegral (pSurfaceFormatCount)) - 1]
  r' <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfaceFormatsKHR" (vkGetPhysicalDeviceSurfaceFormatsKHR'
                                                                          physicalDevice'
                                                                          (surface)
                                                                          (pPSurfaceFormatCount)
                                                                          ((pPSurfaceFormats)))
  lift $ when (r' < SUCCESS) (throwIO (VulkanException r'))
  pSurfaceFormatCount' <- lift $ peek @Word32 pPSurfaceFormatCount
  pSurfaceFormats' <- lift $ generateM (fromIntegral (pSurfaceFormatCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SurfaceFormatKHR (((Ptr SurfaceFormatKHR
pPSurfaceFormats) Ptr SurfaceFormatKHR -> Int -> Ptr SurfaceFormatKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SurfaceFormatKHR)))
  pure $ ((r'), pSurfaceFormats')


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

-- | vkGetPhysicalDeviceSurfacePresentModesKHR - Query supported presentation
-- modes
--
-- = Description
--
-- If @pPresentModes@ is @NULL@, then the number of presentation modes
-- supported for the given @surface@ is returned in @pPresentModeCount@.
-- Otherwise, @pPresentModeCount@ /must/ point to a variable set by the
-- application to the number of elements in the @pPresentModes@ array, and
-- on return the variable is overwritten with the number of values actually
-- written to @pPresentModes@. If the value of @pPresentModeCount@ is less
-- than the number of presentation modes supported, at most
-- @pPresentModeCount@ values will be written, and
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not all the
-- available modes were returned.
--
-- If the @VK_GOOGLE_surfaceless_query@ extension is enabled and @surface@
-- is 'Vulkan.Core10.APIConstants.NULL_HANDLE', the values returned in
-- @pPresentModes@ will only indicate support for 'PRESENT_MODE_FIFO_KHR',
-- 'PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR', and
-- 'PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR'. To query support for any
-- other present mode, a valid handle /must/ be provided in @surface@.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06524# If
--     the @VK_GOOGLE_surfaceless_query@ extension is not enabled,
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06525# If
--     @surface@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @surface@
--     /must/ be supported by @physicalDevice@, as reported by
--     'getPhysicalDeviceSurfaceSupportKHR' or an equivalent
--     platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-parameter#
--     If @surface@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @surface@ /must/ be a valid 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter#
--     @pPresentModeCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter#
--     If the value referenced by @pPresentModeCount@ is not @0@, and
--     @pPresentModes@ is not @NULL@, @pPresentModes@ /must/ be a valid
--     pointer to an array of @pPresentModeCount@ 'PresentModeKHR' values
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-commonparent# Both
--     of @physicalDevice@, and @surface@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Instance'
--
-- == 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_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Core10.Handles.PhysicalDevice', 'PresentModeKHR',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
getPhysicalDeviceSurfacePresentModesKHR :: forall io
                                         . (MonadIO io)
                                        => -- | @physicalDevice@ is the physical device that will be associated with the
                                           -- swapchain to be created, as described for
                                           -- 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                           PhysicalDevice
                                        -> -- | @surface@ is the surface that will be associated with the swapchain.
                                           SurfaceKHR
                                        -> io (Result, ("presentModes" ::: Vector PresentModeKHR))
getPhysicalDeviceSurfacePresentModesKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> SurfaceKHR
-> io (Result, "presentModes" ::: Vector PresentModeKHR)
getPhysicalDeviceSurfacePresentModesKHR PhysicalDevice
physicalDevice
                                          SurfaceKHR
surface = IO (Result, "presentModes" ::: Vector PresentModeKHR)
-> io (Result, "presentModes" ::: Vector PresentModeKHR)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "presentModes" ::: Vector PresentModeKHR)
 -> io (Result, "presentModes" ::: Vector PresentModeKHR))
-> (ContT
      (Result, "presentModes" ::: Vector PresentModeKHR)
      IO
      (Result, "presentModes" ::: Vector PresentModeKHR)
    -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
-> ContT
     (Result, "presentModes" ::: Vector PresentModeKHR)
     IO
     (Result, "presentModes" ::: Vector PresentModeKHR)
-> io (Result, "presentModes" ::: Vector PresentModeKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "presentModes" ::: Vector PresentModeKHR)
  IO
  (Result, "presentModes" ::: Vector PresentModeKHR)
-> IO (Result, "presentModes" ::: Vector PresentModeKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "presentModes" ::: Vector PresentModeKHR)
   IO
   (Result, "presentModes" ::: Vector PresentModeKHR)
 -> io (Result, "presentModes" ::: Vector PresentModeKHR))
-> ContT
     (Result, "presentModes" ::: Vector PresentModeKHR)
     IO
     (Result, "presentModes" ::: Vector PresentModeKHR)
-> io (Result, "presentModes" ::: Vector PresentModeKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceSurfacePresentModesKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
vkGetPhysicalDeviceSurfacePresentModesKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
pVkGetPhysicalDeviceSurfacePresentModesKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  IO ()
-> ContT (Result, "presentModes" ::: Vector PresentModeKHR) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (Result, "presentModes" ::: Vector PresentModeKHR) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT (Result, "presentModes" ::: Vector PresentModeKHR) IO ())
-> IO ()
-> ContT (Result, "presentModes" ::: Vector PresentModeKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
vkGetPhysicalDeviceSurfacePresentModesKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> 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 vkGetPhysicalDeviceSurfacePresentModesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceSurfacePresentModesKHR' :: Ptr PhysicalDevice_T
-> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result
vkGetPhysicalDeviceSurfacePresentModesKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
-> Ptr PhysicalDevice_T
-> SurfaceKHR
-> Ptr Word32
-> Ptr PresentModeKHR
-> IO Result
mkVkGetPhysicalDeviceSurfacePresentModesKHR FunPtr
  (Ptr PhysicalDevice_T
   -> SurfaceKHR -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result)
vkGetPhysicalDeviceSurfacePresentModesKHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  pPPresentModeCount <- ((Ptr Word32
  -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
 -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
-> ContT
     (Result, "presentModes" ::: Vector PresentModeKHR) IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32
   -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
  -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
 -> ContT
      (Result, "presentModes" ::: Vector PresentModeKHR) IO (Ptr Word32))
-> ((Ptr Word32
     -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
    -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
-> ContT
     (Result, "presentModes" ::: Vector PresentModeKHR) IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO (Ptr Word32)
-> (Ptr Word32 -> IO ())
-> (Ptr Word32
    -> IO (Result, "presentModes" ::: Vector PresentModeKHR))
-> IO (Result, "presentModes" ::: Vector PresentModeKHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
free
  r <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfacePresentModesKHR" (vkGetPhysicalDeviceSurfacePresentModesKHR'
                                                                              physicalDevice'
                                                                              (surface)
                                                                              (pPPresentModeCount)
                                                                              (nullPtr))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pPresentModeCount <- lift $ peek @Word32 pPPresentModeCount
  pPPresentModes <- ContT $ bracket (callocBytes @PresentModeKHR ((fromIntegral (pPresentModeCount)) * 4)) free
  r' <- lift $ traceAroundEvent "vkGetPhysicalDeviceSurfacePresentModesKHR" (vkGetPhysicalDeviceSurfacePresentModesKHR'
                                                                               physicalDevice'
                                                                               (surface)
                                                                               (pPPresentModeCount)
                                                                               (pPPresentModes))
  lift $ when (r' < SUCCESS) (throwIO (VulkanException r'))
  pPresentModeCount' <- lift $ peek @Word32 pPPresentModeCount
  pPresentModes' <- lift $ generateM (fromIntegral (pPresentModeCount')) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @PresentModeKHR ((Ptr PresentModeKHR
pPPresentModes Ptr PresentModeKHR -> Int -> Ptr PresentModeKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentModeKHR)))
  pure $ ((r'), pPresentModes')


-- No documentation found for TopLevel "VK_COLORSPACE_SRGB_NONLINEAR_KHR"
pattern $mCOLORSPACE_SRGB_NONLINEAR_KHR :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLORSPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR
COLORSPACE_SRGB_NONLINEAR_KHR = COLOR_SPACE_SRGB_NONLINEAR_KHR


-- | VkSurfaceCapabilitiesKHR - Structure describing capabilities of a
-- surface
--
-- = Description
--
-- Supported usage flags of a presentable image when using
-- 'PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR' or
-- 'PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR' presentation mode are
-- provided by
-- 'Vulkan.Extensions.VK_KHR_shared_presentable_image.SharedPresentSurfaceCapabilitiesKHR'::@sharedPresentSupportedUsageFlags@.
--
-- Formulas such as min(N, @maxImageCount@) are not correct, since
-- @maxImageCount@ /may/ be zero.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'CompositeAlphaFlagsKHR', 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlags',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR',
-- 'SurfaceTransformFlagBitsKHR', 'SurfaceTransformFlagsKHR',
-- 'getPhysicalDeviceSurfaceCapabilitiesKHR'
data SurfaceCapabilitiesKHR = SurfaceCapabilitiesKHR
  { -- | @minImageCount@ is the minimum number of images the specified device
    -- supports for a swapchain created for the surface, and will be at least
    -- one.
    SurfaceCapabilitiesKHR -> Word32
minImageCount :: Word32
  , -- | @maxImageCount@ is the maximum number of images the specified device
    -- supports for a swapchain created for the surface, and will be either 0,
    -- or greater than or equal to @minImageCount@. A value of 0 means that
    -- there is no limit on the number of images, though there /may/ be limits
    -- related to the total amount of memory used by presentable images.
    SurfaceCapabilitiesKHR -> Word32
maxImageCount :: Word32
  , -- | @currentExtent@ is the current width and height of the surface, or the
    -- special value (0xFFFFFFFF, 0xFFFFFFFF) indicating that the surface size
    -- will be determined by the extent of a swapchain targeting the surface.
    SurfaceCapabilitiesKHR -> Extent2D
currentExtent :: Extent2D
  , -- | @minImageExtent@ contains the smallest valid swapchain extent for the
    -- surface on the specified device. The @width@ and @height@ of the extent
    -- will each be less than or equal to the corresponding @width@ and
    -- @height@ of @currentExtent@, unless @currentExtent@ has the special
    -- value described above.
    SurfaceCapabilitiesKHR -> Extent2D
minImageExtent :: Extent2D
  , -- | @maxImageExtent@ contains the largest valid swapchain extent for the
    -- surface on the specified device. The @width@ and @height@ of the extent
    -- will each be greater than or equal to the corresponding @width@ and
    -- @height@ of @minImageExtent@. The @width@ and @height@ of the extent
    -- will each be greater than or equal to the corresponding @width@ and
    -- @height@ of @currentExtent@, unless @currentExtent@ has the special
    -- value described above.
    SurfaceCapabilitiesKHR -> Extent2D
maxImageExtent :: Extent2D
  , -- | @maxImageArrayLayers@ is the maximum number of layers presentable images
    -- /can/ have for a swapchain created for this device and surface, and will
    -- be at least one.
    SurfaceCapabilitiesKHR -> Word32
maxImageArrayLayers :: Word32
  , -- | @supportedTransforms@ is a bitmask of 'SurfaceTransformFlagBitsKHR'
    -- indicating the presentation transforms supported for the surface on the
    -- specified device. At least one bit will be set.
    SurfaceCapabilitiesKHR -> SurfaceTransformFlagsKHR
supportedTransforms :: SurfaceTransformFlagsKHR
  , -- | @currentTransform@ is 'SurfaceTransformFlagBitsKHR' value indicating the
    -- surface’s current transform relative to the presentation engine’s
    -- natural orientation.
    SurfaceCapabilitiesKHR -> SurfaceTransformFlagsKHR
currentTransform :: SurfaceTransformFlagBitsKHR
  , -- | @supportedCompositeAlpha@ is a bitmask of 'CompositeAlphaFlagBitsKHR',
    -- representing the alpha compositing modes supported by the presentation
    -- engine for the surface on the specified device, and at least one bit
    -- will be set. Opaque composition /can/ be achieved in any alpha
    -- compositing mode by either using an image format that has no alpha
    -- component, or by ensuring that all pixels in the presentable images have
    -- an alpha value of 1.0.
    SurfaceCapabilitiesKHR -> CompositeAlphaFlagsKHR
supportedCompositeAlpha :: CompositeAlphaFlagsKHR
  , -- | @supportedUsageFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits' representing
    -- the ways the application /can/ use the presentable images of a swapchain
    -- created with 'PresentModeKHR' set to
    -- 'PRESENT_MODE_FIFO_LATEST_READY_KHR', 'PRESENT_MODE_IMMEDIATE_KHR',
    -- 'PRESENT_MODE_MAILBOX_KHR', 'PRESENT_MODE_FIFO_KHR' or
    -- 'PRESENT_MODE_FIFO_RELAXED_KHR' for the surface on the specified device.
    -- 'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_COLOR_ATTACHMENT_BIT'
    -- /must/ be included in the set. Implementations /may/ support additional
    -- usages.
    SurfaceCapabilitiesKHR -> ImageUsageFlags
supportedUsageFlags :: ImageUsageFlags
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceCapabilitiesKHR)
#endif
deriving instance Show SurfaceCapabilitiesKHR

instance ToCStruct SurfaceCapabilitiesKHR where
  withCStruct :: forall b.
SurfaceCapabilitiesKHR
-> (Ptr SurfaceCapabilitiesKHR -> IO b) -> IO b
withCStruct SurfaceCapabilitiesKHR
x Ptr SurfaceCapabilitiesKHR -> IO b
f = Int -> (Ptr SurfaceCapabilitiesKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
52 ((Ptr SurfaceCapabilitiesKHR -> IO b) -> IO b)
-> (Ptr SurfaceCapabilitiesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceCapabilitiesKHR
p -> Ptr SurfaceCapabilitiesKHR
-> SurfaceCapabilitiesKHR -> IO b -> IO b
forall b.
Ptr SurfaceCapabilitiesKHR
-> SurfaceCapabilitiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesKHR
p SurfaceCapabilitiesKHR
x (Ptr SurfaceCapabilitiesKHR -> IO b
f Ptr SurfaceCapabilitiesKHR
p)
  pokeCStruct :: forall b.
Ptr SurfaceCapabilitiesKHR
-> SurfaceCapabilitiesKHR -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesKHR
p SurfaceCapabilitiesKHR{Word32
Extent2D
ImageUsageFlags
SurfaceTransformFlagsKHR
CompositeAlphaFlagsKHR
minImageCount :: SurfaceCapabilitiesKHR -> Word32
maxImageCount :: SurfaceCapabilitiesKHR -> Word32
currentExtent :: SurfaceCapabilitiesKHR -> Extent2D
minImageExtent :: SurfaceCapabilitiesKHR -> Extent2D
maxImageExtent :: SurfaceCapabilitiesKHR -> Extent2D
maxImageArrayLayers :: SurfaceCapabilitiesKHR -> Word32
supportedTransforms :: SurfaceCapabilitiesKHR -> SurfaceTransformFlagsKHR
currentTransform :: SurfaceCapabilitiesKHR -> SurfaceTransformFlagsKHR
supportedCompositeAlpha :: SurfaceCapabilitiesKHR -> CompositeAlphaFlagsKHR
supportedUsageFlags :: SurfaceCapabilitiesKHR -> ImageUsageFlags
minImageCount :: Word32
maxImageCount :: Word32
currentExtent :: Extent2D
minImageExtent :: Extent2D
maxImageExtent :: Extent2D
maxImageArrayLayers :: Word32
supportedTransforms :: SurfaceTransformFlagsKHR
currentTransform :: SurfaceTransformFlagsKHR
supportedCompositeAlpha :: CompositeAlphaFlagsKHR
supportedUsageFlags :: ImageUsageFlags
..} IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
minImageCount)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Word32
maxImageCount)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Extent2D)) (Extent2D
currentExtent)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (Extent2D
minImageExtent)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Extent2D)) (Extent2D
maxImageExtent)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
maxImageArrayLayers)
    Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr SurfaceTransformFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr SurfaceTransformFlagsKHR)) (SurfaceTransformFlagsKHR
supportedTransforms)
    Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr SurfaceTransformFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr SurfaceTransformFlagBitsKHR)) (SurfaceTransformFlagsKHR
currentTransform)
    Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr CompositeAlphaFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CompositeAlphaFlagsKHR)) (CompositeAlphaFlagsKHR
supportedCompositeAlpha)
    Ptr ImageUsageFlags -> ImageUsageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr ImageUsageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ImageUsageFlags)) (ImageUsageFlags
supportedUsageFlags)
    IO b
f
  cStructSize :: Int
cStructSize = Int
52
  cStructAlignment :: Int
cStructAlignment = Int
4
  pokeZeroCStruct :: forall b. Ptr SurfaceCapabilitiesKHR -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceCapabilitiesKHR
p IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr SurfaceTransformFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr SurfaceTransformFlagsKHR)) (SurfaceTransformFlagsKHR
forall a. Zero a => a
zero)
    Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr SurfaceTransformFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr SurfaceTransformFlagBitsKHR)) (SurfaceTransformFlagsKHR
forall a. Zero a => a
zero)
    Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr CompositeAlphaFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CompositeAlphaFlagsKHR)) (CompositeAlphaFlagsKHR
forall a. Zero a => a
zero)
    Ptr ImageUsageFlags -> ImageUsageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr ImageUsageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ImageUsageFlags)) (ImageUsageFlags
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SurfaceCapabilitiesKHR where
  peekCStruct :: Ptr SurfaceCapabilitiesKHR -> IO SurfaceCapabilitiesKHR
peekCStruct Ptr SurfaceCapabilitiesKHR
p = do
    minImageCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SurfaceCapabilitiesKHR
p Ptr SurfaceCapabilitiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
    maxImageCount <- peek @Word32 ((p `plusPtr` 4 :: Ptr Word32))
    currentExtent <- peekCStruct @Extent2D ((p `plusPtr` 8 :: Ptr Extent2D))
    minImageExtent <- peekCStruct @Extent2D ((p `plusPtr` 16 :: Ptr Extent2D))
    maxImageExtent <- peekCStruct @Extent2D ((p `plusPtr` 24 :: Ptr Extent2D))
    maxImageArrayLayers <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    supportedTransforms <- peek @SurfaceTransformFlagsKHR ((p `plusPtr` 36 :: Ptr SurfaceTransformFlagsKHR))
    currentTransform <- peek @SurfaceTransformFlagBitsKHR ((p `plusPtr` 40 :: Ptr SurfaceTransformFlagBitsKHR))
    supportedCompositeAlpha <- peek @CompositeAlphaFlagsKHR ((p `plusPtr` 44 :: Ptr CompositeAlphaFlagsKHR))
    supportedUsageFlags <- peek @ImageUsageFlags ((p `plusPtr` 48 :: Ptr ImageUsageFlags))
    pure $ SurfaceCapabilitiesKHR
             minImageCount
             maxImageCount
             currentExtent
             minImageExtent
             maxImageExtent
             maxImageArrayLayers
             supportedTransforms
             currentTransform
             supportedCompositeAlpha
             supportedUsageFlags

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

instance Zero SurfaceCapabilitiesKHR where
  zero :: SurfaceCapabilitiesKHR
zero = Word32
-> Word32
-> Extent2D
-> Extent2D
-> Extent2D
-> Word32
-> SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR
-> CompositeAlphaFlagsKHR
-> ImageUsageFlags
-> SurfaceCapabilitiesKHR
SurfaceCapabilitiesKHR
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Extent2D
forall a. Zero a => a
zero
           Extent2D
forall a. Zero a => a
zero
           Extent2D
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           SurfaceTransformFlagsKHR
forall a. Zero a => a
zero
           SurfaceTransformFlagsKHR
forall a. Zero a => a
zero
           CompositeAlphaFlagsKHR
forall a. Zero a => a
zero
           ImageUsageFlags
forall a. Zero a => a
zero


-- | VkSurfaceFormatKHR - Structure describing a supported swapchain
-- format-color space pair
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'ColorSpaceKHR', 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceFormat2KHR',
-- 'getPhysicalDeviceSurfaceFormatsKHR'
data SurfaceFormatKHR = SurfaceFormatKHR
  { -- | @format@ is a 'Vulkan.Core10.Enums.Format.Format' that is compatible
    -- with the specified surface.
    SurfaceFormatKHR -> Format
format :: Format
  , -- | @colorSpace@ is a presentation 'ColorSpaceKHR' that is compatible with
    -- the surface.
    SurfaceFormatKHR -> ColorSpaceKHR
colorSpace :: ColorSpaceKHR
  }
  deriving (Typeable, SurfaceFormatKHR -> SurfaceFormatKHR -> Bool
(SurfaceFormatKHR -> SurfaceFormatKHR -> Bool)
-> (SurfaceFormatKHR -> SurfaceFormatKHR -> Bool)
-> Eq SurfaceFormatKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SurfaceFormatKHR -> SurfaceFormatKHR -> Bool
== :: SurfaceFormatKHR -> SurfaceFormatKHR -> Bool
$c/= :: SurfaceFormatKHR -> SurfaceFormatKHR -> Bool
/= :: SurfaceFormatKHR -> SurfaceFormatKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceFormatKHR)
#endif
deriving instance Show SurfaceFormatKHR

instance ToCStruct SurfaceFormatKHR where
  withCStruct :: forall b.
SurfaceFormatKHR -> (Ptr SurfaceFormatKHR -> IO b) -> IO b
withCStruct SurfaceFormatKHR
x Ptr SurfaceFormatKHR -> IO b
f = Int -> (Ptr SurfaceFormatKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
8 ((Ptr SurfaceFormatKHR -> IO b) -> IO b)
-> (Ptr SurfaceFormatKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceFormatKHR
p -> Ptr SurfaceFormatKHR -> SurfaceFormatKHR -> IO b -> IO b
forall b. Ptr SurfaceFormatKHR -> SurfaceFormatKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceFormatKHR
p SurfaceFormatKHR
x (Ptr SurfaceFormatKHR -> IO b
f Ptr SurfaceFormatKHR
p)
  pokeCStruct :: forall b. Ptr SurfaceFormatKHR -> SurfaceFormatKHR -> IO b -> IO b
pokeCStruct Ptr SurfaceFormatKHR
p SurfaceFormatKHR{Format
ColorSpaceKHR
format :: SurfaceFormatKHR -> Format
colorSpace :: SurfaceFormatKHR -> ColorSpaceKHR
format :: Format
colorSpace :: ColorSpaceKHR
..} IO b
f = do
    Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFormatKHR
p Ptr SurfaceFormatKHR -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Format)) (Format
format)
    Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFormatKHR
p Ptr SurfaceFormatKHR -> Int -> Ptr ColorSpaceKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr ColorSpaceKHR)) (ColorSpaceKHR
colorSpace)
    IO b
f
  cStructSize :: Int
cStructSize = Int
8
  cStructAlignment :: Int
cStructAlignment = Int
4
  pokeZeroCStruct :: forall b. Ptr SurfaceFormatKHR -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceFormatKHR
p IO b
f = do
    Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFormatKHR
p Ptr SurfaceFormatKHR -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
    Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFormatKHR
p Ptr SurfaceFormatKHR -> Int -> Ptr ColorSpaceKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr ColorSpaceKHR)) (ColorSpaceKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SurfaceFormatKHR where
  peekCStruct :: Ptr SurfaceFormatKHR -> IO SurfaceFormatKHR
peekCStruct Ptr SurfaceFormatKHR
p = do
    format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr SurfaceFormatKHR
p Ptr SurfaceFormatKHR -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Format))
    colorSpace <- peek @ColorSpaceKHR ((p `plusPtr` 4 :: Ptr ColorSpaceKHR))
    pure $ SurfaceFormatKHR
             format colorSpace

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

instance Zero SurfaceFormatKHR where
  zero :: SurfaceFormatKHR
zero = Format -> ColorSpaceKHR -> SurfaceFormatKHR
SurfaceFormatKHR
           Format
forall a. Zero a => a
zero
           ColorSpaceKHR
forall a. Zero a => a
zero


-- | VkPresentModeKHR - Presentation mode supported for a surface
--
-- = Description
--
-- -   'PRESENT_MODE_IMMEDIATE_KHR' specifies that the presentation engine
--     does not wait for a vertical blanking period to update the current
--     image, meaning this mode /may/ result in visible tearing. No
--     internal queuing of presentation requests is needed, as the requests
--     are applied immediately.
--
-- -   'PRESENT_MODE_MAILBOX_KHR' specifies that the presentation engine
--     waits for the next vertical blanking period to update the current
--     image. Tearing /cannot/ be observed. An internal single-entry queue
--     is used to hold pending presentation requests. If the queue is full
--     when a new presentation request is received, the new request
--     replaces the existing entry, and any images associated with the
--     prior entry become available for reuse by the application. One
--     request is removed from the queue and processed during each vertical
--     blanking period in which the queue is non-empty.
--
-- -   'PRESENT_MODE_FIFO_KHR' specifies that the presentation engine waits
--     for the next vertical blanking period to update the current image.
--     Tearing /cannot/ be observed. An internal queue is used to hold
--     pending presentation requests. New requests are appended to the end
--     of the queue, and one request is removed from the beginning of the
--     queue and processed during each vertical blanking period in which
--     the queue is non-empty. This is the only value of @presentMode@ that
--     is /required/ to be supported.
--
-- -   'PRESENT_MODE_FIFO_RELAXED_KHR' specifies that the presentation
--     engine generally waits for the next vertical blanking period to
--     update the current image. If a vertical blanking period has already
--     passed since the last update of the current image then the
--     presentation engine does not wait for another vertical blanking
--     period for the update, meaning this mode /may/ result in visible
--     tearing in this case. This mode is useful for reducing visual
--     stutter with an application that will mostly present a new image
--     before the next vertical blanking period, but may occasionally be
--     late, and present a new image just after the next vertical blanking
--     period. An internal queue is used to hold pending presentation
--     requests. New requests are appended to the end of the queue, and one
--     request is removed from the beginning of the queue and processed
--     during or after each vertical blanking period in which the queue is
--     non-empty.
--
-- -   'PRESENT_MODE_FIFO_LATEST_READY_KHR' specifies that the presentation
--     engine waits for the next vertical blanking period to update the
--     current image. Tearing /cannot/ be observed. An internal queue is
--     used to hold pending presentation requests. New requests are
--     appended to the end of the queue. At each vertical blanking period,
--     the presentation engine dequeues all successive requests that are
--     ready to be presented from the beginning of the queue. If using the
--     @VK_GOOGLE_display_timing@ extension or the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-presentAtAbsoluteTime presentAtAbsoluteTime>
--     feature to provide a target present time, the presentation engine
--     checks the specified time for each image. If the target present time
--     is less-than or equal-to the current time, the presentation engine
--     dequeues the image and checks the next one. The image of the last
--     dequeued request is presented. The other dequeued requests are
--     dropped.
--
-- -   'PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR' specifies that the
--     presentation engine and application have concurrent access to a
--     single image, which is referred to as a /shared presentable image/.
--     The presentation engine is only required to update the current image
--     after a new presentation request is received. Therefore the
--     application /must/ make a presentation request whenever an update is
--     required. However, the presentation engine /may/ update the current
--     image at any point, meaning this mode /may/ result in visible
--     tearing.
--
-- -   'PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR' specifies that the
--     presentation engine and application have concurrent access to a
--     single image, which is referred to as a /shared presentable image/.
--     The presentation engine periodically updates the current image on
--     its regular refresh cycle. The application is only required to make
--     one initial presentation request, after which the presentation
--     engine /must/ update the current image without any need for further
--     presentation requests. The application /can/ indicate the image
--     contents have been updated by making a presentation request, but
--     this does not guarantee the timing of when it will be updated. This
--     mode /may/ result in visible tearing if rendering to the image is
--     not timed correctly.
--
-- The supported
-- 'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits' of the
-- presentable images of a swapchain created for a surface /may/ differ
-- depending on the presentation mode, and can be determined as per the
-- table below:
--
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | Presentation mode                            | Image usage flags                                                                                                           |
-- +==============================================+=============================================================================================================================+
-- | 'PRESENT_MODE_IMMEDIATE_KHR'                 | 'SurfaceCapabilitiesKHR'::@supportedUsageFlags@                                                                             |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_MAILBOX_KHR'                   | 'SurfaceCapabilitiesKHR'::@supportedUsageFlags@                                                                             |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_FIFO_KHR'                      | 'SurfaceCapabilitiesKHR'::@supportedUsageFlags@                                                                             |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_FIFO_RELAXED_KHR'              | 'SurfaceCapabilitiesKHR'::@supportedUsageFlags@                                                                             |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_FIFO_LATEST_READY_KHR'         | 'SurfaceCapabilitiesKHR'::@supportedUsageFlags@                                                                             |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR'     | 'Vulkan.Extensions.VK_KHR_shared_presentable_image.SharedPresentSurfaceCapabilitiesKHR'::@sharedPresentSupportedUsageFlags@ |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
-- | 'PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR' | 'Vulkan.Extensions.VK_KHR_shared_presentable_image.SharedPresentSurfaceCapabilitiesKHR'::@sharedPresentSupportedUsageFlags@ |
-- +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
--
-- Presentable Image Usage Queries
--
-- For reference, the mode indicated by 'PRESENT_MODE_FIFO_KHR' is
-- equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap
-- interval of 1, while the mode indicated by
-- 'PRESENT_MODE_FIFO_RELAXED_KHR' is equivalent to the behavior of
-- {wgl|glX}SwapBuffers with a swap interval of -1 (from the
-- {WGL|GLX}_EXT_swap_control_tear extensions).
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Extensions.VK_NV_low_latency2.LatencySurfaceCapabilitiesNV',
-- 'Vulkan.Extensions.VK_KHR_surface_maintenance1.SurfacePresentModeCompatibilityKHR',
-- 'Vulkan.Extensions.VK_KHR_surface_maintenance1.SurfacePresentModeKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain_maintenance1.SwapchainPresentModeInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain_maintenance1.SwapchainPresentModesCreateInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.getPhysicalDeviceSurfacePresentModes2EXT',
-- 'getPhysicalDeviceSurfacePresentModesKHR'
newtype PresentModeKHR = PresentModeKHR Int32
  deriving newtype (PresentModeKHR -> PresentModeKHR -> Bool
(PresentModeKHR -> PresentModeKHR -> Bool)
-> (PresentModeKHR -> PresentModeKHR -> Bool) -> Eq PresentModeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PresentModeKHR -> PresentModeKHR -> Bool
== :: PresentModeKHR -> PresentModeKHR -> Bool
$c/= :: PresentModeKHR -> PresentModeKHR -> Bool
/= :: PresentModeKHR -> PresentModeKHR -> Bool
Eq, Eq PresentModeKHR
Eq PresentModeKHR =>
(PresentModeKHR -> PresentModeKHR -> Ordering)
-> (PresentModeKHR -> PresentModeKHR -> Bool)
-> (PresentModeKHR -> PresentModeKHR -> Bool)
-> (PresentModeKHR -> PresentModeKHR -> Bool)
-> (PresentModeKHR -> PresentModeKHR -> Bool)
-> (PresentModeKHR -> PresentModeKHR -> PresentModeKHR)
-> (PresentModeKHR -> PresentModeKHR -> PresentModeKHR)
-> Ord PresentModeKHR
PresentModeKHR -> PresentModeKHR -> Bool
PresentModeKHR -> PresentModeKHR -> Ordering
PresentModeKHR -> PresentModeKHR -> PresentModeKHR
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 :: PresentModeKHR -> PresentModeKHR -> Ordering
compare :: PresentModeKHR -> PresentModeKHR -> Ordering
$c< :: PresentModeKHR -> PresentModeKHR -> Bool
< :: PresentModeKHR -> PresentModeKHR -> Bool
$c<= :: PresentModeKHR -> PresentModeKHR -> Bool
<= :: PresentModeKHR -> PresentModeKHR -> Bool
$c> :: PresentModeKHR -> PresentModeKHR -> Bool
> :: PresentModeKHR -> PresentModeKHR -> Bool
$c>= :: PresentModeKHR -> PresentModeKHR -> Bool
>= :: PresentModeKHR -> PresentModeKHR -> Bool
$cmax :: PresentModeKHR -> PresentModeKHR -> PresentModeKHR
max :: PresentModeKHR -> PresentModeKHR -> PresentModeKHR
$cmin :: PresentModeKHR -> PresentModeKHR -> PresentModeKHR
min :: PresentModeKHR -> PresentModeKHR -> PresentModeKHR
Ord, Ptr PresentModeKHR -> IO PresentModeKHR
Ptr PresentModeKHR -> Int -> IO PresentModeKHR
Ptr PresentModeKHR -> Int -> PresentModeKHR -> IO ()
Ptr PresentModeKHR -> PresentModeKHR -> IO ()
PresentModeKHR -> Int
(PresentModeKHR -> Int)
-> (PresentModeKHR -> Int)
-> (Ptr PresentModeKHR -> Int -> IO PresentModeKHR)
-> (Ptr PresentModeKHR -> Int -> PresentModeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO PresentModeKHR)
-> (forall b. Ptr b -> Int -> PresentModeKHR -> IO ())
-> (Ptr PresentModeKHR -> IO PresentModeKHR)
-> (Ptr PresentModeKHR -> PresentModeKHR -> IO ())
-> Storable PresentModeKHR
forall b. Ptr b -> Int -> IO PresentModeKHR
forall b. Ptr b -> Int -> PresentModeKHR -> 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 :: PresentModeKHR -> Int
sizeOf :: PresentModeKHR -> Int
$calignment :: PresentModeKHR -> Int
alignment :: PresentModeKHR -> Int
$cpeekElemOff :: Ptr PresentModeKHR -> Int -> IO PresentModeKHR
peekElemOff :: Ptr PresentModeKHR -> Int -> IO PresentModeKHR
$cpokeElemOff :: Ptr PresentModeKHR -> Int -> PresentModeKHR -> IO ()
pokeElemOff :: Ptr PresentModeKHR -> Int -> PresentModeKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PresentModeKHR
peekByteOff :: forall b. Ptr b -> Int -> IO PresentModeKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> PresentModeKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> PresentModeKHR -> IO ()
$cpeek :: Ptr PresentModeKHR -> IO PresentModeKHR
peek :: Ptr PresentModeKHR -> IO PresentModeKHR
$cpoke :: Ptr PresentModeKHR -> PresentModeKHR -> IO ()
poke :: Ptr PresentModeKHR -> PresentModeKHR -> IO ()
Storable, PresentModeKHR
PresentModeKHR -> Zero PresentModeKHR
forall a. a -> Zero a
$czero :: PresentModeKHR
zero :: PresentModeKHR
Zero)

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_IMMEDIATE_KHR"
pattern $mPRESENT_MODE_IMMEDIATE_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_IMMEDIATE_KHR :: PresentModeKHR
PRESENT_MODE_IMMEDIATE_KHR = PresentModeKHR 0

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_MAILBOX_KHR"
pattern $mPRESENT_MODE_MAILBOX_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_MAILBOX_KHR :: PresentModeKHR
PRESENT_MODE_MAILBOX_KHR = PresentModeKHR 1

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_FIFO_KHR"
pattern $mPRESENT_MODE_FIFO_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_FIFO_KHR :: PresentModeKHR
PRESENT_MODE_FIFO_KHR = PresentModeKHR 2

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_FIFO_RELAXED_KHR"
pattern $mPRESENT_MODE_FIFO_RELAXED_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_FIFO_RELAXED_KHR :: PresentModeKHR
PRESENT_MODE_FIFO_RELAXED_KHR = PresentModeKHR 3

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_FIFO_LATEST_READY_KHR"
pattern $mPRESENT_MODE_FIFO_LATEST_READY_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_FIFO_LATEST_READY_KHR :: PresentModeKHR
PRESENT_MODE_FIFO_LATEST_READY_KHR = PresentModeKHR 1000361000

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR"
pattern $mPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR :: PresentModeKHR
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = PresentModeKHR 1000111001

-- No documentation found for Nested "VkPresentModeKHR" "VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR"
pattern $mPRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: forall {r}. PresentModeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bPRESENT_MODE_SHARED_DEMAND_REFRESH_KHR :: PresentModeKHR
PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = PresentModeKHR 1000111000

{-# COMPLETE
  PRESENT_MODE_IMMEDIATE_KHR
  , PRESENT_MODE_MAILBOX_KHR
  , PRESENT_MODE_FIFO_KHR
  , PRESENT_MODE_FIFO_RELAXED_KHR
  , PRESENT_MODE_FIFO_LATEST_READY_KHR
  , PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
  , PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR ::
    PresentModeKHR
  #-}

conNamePresentModeKHR :: String
conNamePresentModeKHR :: String
conNamePresentModeKHR = String
"PresentModeKHR"

enumPrefixPresentModeKHR :: String
enumPrefixPresentModeKHR :: String
enumPrefixPresentModeKHR = String
"PRESENT_MODE_"

showTablePresentModeKHR :: [(PresentModeKHR, String)]
showTablePresentModeKHR :: [(PresentModeKHR, String)]
showTablePresentModeKHR =
  [ (PresentModeKHR
PRESENT_MODE_IMMEDIATE_KHR, String
"IMMEDIATE_KHR")
  , (PresentModeKHR
PRESENT_MODE_MAILBOX_KHR, String
"MAILBOX_KHR")
  , (PresentModeKHR
PRESENT_MODE_FIFO_KHR, String
"FIFO_KHR")
  , (PresentModeKHR
PRESENT_MODE_FIFO_RELAXED_KHR, String
"FIFO_RELAXED_KHR")
  ,
    ( PresentModeKHR
PRESENT_MODE_FIFO_LATEST_READY_KHR
    , String
"FIFO_LATEST_READY_KHR"
    )
  ,
    ( PresentModeKHR
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
    , String
"SHARED_CONTINUOUS_REFRESH_KHR"
    )
  ,
    ( PresentModeKHR
PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR
    , String
"SHARED_DEMAND_REFRESH_KHR"
    )
  ]

instance Show PresentModeKHR where
  showsPrec :: Int -> PresentModeKHR -> ShowS
showsPrec =
    String
-> [(PresentModeKHR, String)]
-> String
-> (PresentModeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> PresentModeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixPresentModeKHR
      [(PresentModeKHR, String)]
showTablePresentModeKHR
      String
conNamePresentModeKHR
      (\(PresentModeKHR Int32
x) -> Int32
x)
      (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read PresentModeKHR where
  readPrec :: ReadPrec PresentModeKHR
readPrec =
    String
-> [(PresentModeKHR, String)]
-> String
-> (Int32 -> PresentModeKHR)
-> ReadPrec PresentModeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixPresentModeKHR
      [(PresentModeKHR, String)]
showTablePresentModeKHR
      String
conNamePresentModeKHR
      Int32 -> PresentModeKHR
PresentModeKHR

-- | VkColorSpaceKHR - Supported color space of the presentation engine
--
-- = Description
--
-- -   'COLOR_SPACE_SRGB_NONLINEAR_KHR' specifies support for the images in
--     sRGB color space, encoded according to the sRGB specification.
--
-- -   'COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT' specifies support for the
--     images in Display-P3 color space, encoded using a Display-P3
--     transfer function.
--
-- -   'COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT' specifies support for the
--     images in extended sRGB color space, encoded using a linear transfer
--     function.
--
-- -   'COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT' specifies support for the
--     images in extended sRGB color space, encoded according to the scRGB
--     specification.
--
-- -   'COLOR_SPACE_DISPLAY_P3_LINEAR_EXT' specifies support for the images
--     in Display-P3 color space, encoded using a linear transfer function.
--
-- -   'COLOR_SPACE_DCI_P3_NONLINEAR_EXT' specifies support for the images
--     in DCI-P3 color space, encoded according to the DCI-P3
--     specification. Note that values in such an image are interpreted as
--     XYZ encoded color data by the presentation engine.
--
-- -   'COLOR_SPACE_BT709_LINEAR_EXT' specifies support for the images in
--     BT709 color space, encoded using a linear transfer function.
--
-- -   'COLOR_SPACE_BT709_NONLINEAR_EXT' specifies support for the images
--     in BT709 color space, encoded according to the BT709 specification.
--
-- -   'COLOR_SPACE_BT2020_LINEAR_EXT' specifies support for the images in
--     BT2020 color space, encoded using a linear transfer function.
--
-- -   'COLOR_SPACE_HDR10_ST2084_EXT' specifies support for the images in
--     HDR10 (BT2020) color space, encoded according to SMPTE ST2084
--     Perceptual Quantizer (PQ) specification.
--
-- -   'COLOR_SPACE_HDR10_HLG_EXT' specifies support for the images in
--     HDR10 (BT2020) color space, encoded according to the Hybrid Log
--     Gamma (HLG) specification.
--
-- -   'COLOR_SPACE_ADOBERGB_LINEAR_EXT' specifies support for images in
--     Adobe RGB color space, encoded using a linear transfer function.
--
-- -   'COLOR_SPACE_ADOBERGB_NONLINEAR_EXT' specifies support for the
--     images in Adobe RGB color space, encoded according to the Adobe RGB
--     specification (approximately Gamma 2.2).
--
-- -   'COLOR_SPACE_PASS_THROUGH_EXT' specifies that color components are
--     used “as is”. This is intended to allow applications to supply data
--     for color spaces not described here.
--
-- -   'COLOR_SPACE_DISPLAY_NATIVE_AMD' specifies support for the display’s
--     native color space. This matches the color space expectations of
--     AMD’s FreeSync2 standard, for displays supporting it.
--
-- In the initial release of the @VK_KHR_surface@ and @VK_KHR_swapchain@
-- extensions, the token 'COLORSPACE_SRGB_NONLINEAR_KHR' was used. Starting
-- in the 2016-05-13 updates to the extension branches, matching release
-- 1.0.13 of the core API specification, 'COLOR_SPACE_SRGB_NONLINEAR_KHR'
-- is used instead for consistency with Vulkan naming rules. The older enum
-- is still available for backwards compatibility.
--
-- In older versions of this extension 'COLOR_SPACE_DISPLAY_P3_LINEAR_EXT'
-- was misnamed
-- 'Vulkan.Extensions.VK_EXT_swapchain_colorspace.COLOR_SPACE_DCI_P3_LINEAR_EXT'.
-- This has been updated to indicate that it uses RGB color encoding, not
-- XYZ. The old name is legacy but is maintained for backwards
-- compatibility.
--
-- In older versions of the @VK_EXT_swapchain_colorspace@ extension,
-- 'COLOR_SPACE_DOLBYVISION_EXT' was exposed. The intent was to indicate
-- the presentation engine shall decode an image using the SMPTE ST 2084
-- Perceptual Quantizer (PQ) EOTF, and then apply a proprietary OOTF to
-- process the image. However, Dolby Vision profile 8.4 describes an
-- encoding using the Hybrid Log Gamma (HLG) OETF, and there is no
-- swapchain extension for signaling Dolby Vision metadata to be used by a
-- proprietary OOTF. This enum is legacy but is maintained for backwards
-- compatibility.
--
-- For a traditional “Linear” or non-gamma transfer function color space
-- use 'COLOR_SPACE_PASS_THROUGH_EXT'.
--
-- On Wayland, 'COLOR_SPACE_PASS_THROUGH_EXT' can be used to disable color
-- management by the WSI on a surface, which makes it possible for the
-- application to create a @wp_color_management_surface_v1@ object without
-- triggering a @surface_exists@ protocol error.
--
-- See 'Vulkan.Extensions.VK_KHR_wayland_surface.createWaylandSurfaceKHR'
--
-- The presentation engine interprets the pixel values of the R, G, and B
-- components as having been encoded using an appropriate transfer
-- function. Applications /should/ ensure that the appropriate transfer
-- function has been applied.
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#images-texel-encode Texel encode>
-- requires that all implementations implicitly apply the sRGB EOTF-1 on R,
-- G, and B components when shaders write to an sRGB pixel format image,
-- which is useful for sRGB color spaces. For sRGB color spaces with other
-- pixel formats, or other non-linear color spaces, applications /can/
-- apply the transfer function explicitly in a shader. The A channel is
-- always interpreted as linearly encoded.
--
-- This extension defines enums for 'ColorSpaceKHR' that correspond to the
-- following color spaces:
--
-- +--------------+----------+----------+----------+-------------+------------+
-- | Name         | Red      | Green    | Blue     | White-point | Transfer   |
-- |              | Primary  | Primary  | Primary  |             | function   |
-- +==============+==========+==========+==========+=============+============+
-- | DCI-P3       | 1.000,   | 0.000,   | 0.000,   | 0.3333,     | DCI P3     |
-- |              | 0.000    | 1.000    | 0.000    | 0.3333      |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | Display-P3   | 0.680,   | 0.265,   | 0.150,   | 0.3127,     | Display-P3 |
-- |              | 0.320    | 0.690    | 0.060    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | BT709        | 0.640,   | 0.300,   | 0.150,   | 0.3127,     | BT709      |
-- |              | 0.330    | 0.600    | 0.060    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | sRGB         | 0.640,   | 0.300,   | 0.150,   | 0.3127,     | sRGB       |
-- |              | 0.330    | 0.600    | 0.060    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | extended     | 0.640,   | 0.300,   | 0.150,   | 0.3127,     | scRGB      |
-- | sRGB         | 0.330    | 0.600    | 0.060    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | HDR10_ST2084 | 0.708,   | 0.170,   | 0.131,   | 0.3127,     | ST2084 PQ  |
-- |              | 0.292    | 0.797    | 0.046    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | HDR10_HLG    | 0.708,   | 0.170,   | 0.131,   | 0.3127,     | HLG        |
-- |              | 0.292    | 0.797    | 0.046    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
-- | Adobe RGB    | 0.640,   | 0.210,   | 0.150,   | 0.3127,     | Adobe RGB  |
-- |              | 0.330    | 0.710    | 0.060    | 0.3290      |            |
-- |              |          |          |          | (D65)       |            |
-- +--------------+----------+----------+----------+-------------+------------+
--
-- Color Spaces and Attributes
--
-- The transfer functions are described in the “Transfer Functions” chapter
-- of the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#data-format Khronos Data Format Specification>.
--
-- Except Display-P3 OETF, which is:
--
-- \[\begin{aligned}
-- E & =
--   \begin{cases}
--     1.055 \times L^{1 \over 2.4} - 0.055 & \text{for}\  0.0030186 \leq L \leq 1 \\
--     12.92 \times L                       & \text{for}\  0 \leq L < 0.0030186
--   \end{cases}
-- \end{aligned}\]
--
-- where L is the linear value of a color component and E is the encoded
-- value (as stored in the image in memory).
--
-- For most uses, the sRGB OETF is equivalent.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'SurfaceFormatKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR'
newtype ColorSpaceKHR = ColorSpaceKHR Int32
  deriving newtype (ColorSpaceKHR -> ColorSpaceKHR -> Bool
(ColorSpaceKHR -> ColorSpaceKHR -> Bool)
-> (ColorSpaceKHR -> ColorSpaceKHR -> Bool) -> Eq ColorSpaceKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
== :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
$c/= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
/= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
Eq, Eq ColorSpaceKHR
Eq ColorSpaceKHR =>
(ColorSpaceKHR -> ColorSpaceKHR -> Ordering)
-> (ColorSpaceKHR -> ColorSpaceKHR -> Bool)
-> (ColorSpaceKHR -> ColorSpaceKHR -> Bool)
-> (ColorSpaceKHR -> ColorSpaceKHR -> Bool)
-> (ColorSpaceKHR -> ColorSpaceKHR -> Bool)
-> (ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR)
-> (ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR)
-> Ord ColorSpaceKHR
ColorSpaceKHR -> ColorSpaceKHR -> Bool
ColorSpaceKHR -> ColorSpaceKHR -> Ordering
ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR
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 :: ColorSpaceKHR -> ColorSpaceKHR -> Ordering
compare :: ColorSpaceKHR -> ColorSpaceKHR -> Ordering
$c< :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
< :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
$c<= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
<= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
$c> :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
> :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
$c>= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
>= :: ColorSpaceKHR -> ColorSpaceKHR -> Bool
$cmax :: ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR
max :: ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR
$cmin :: ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR
min :: ColorSpaceKHR -> ColorSpaceKHR -> ColorSpaceKHR
Ord, Ptr ColorSpaceKHR -> IO ColorSpaceKHR
Ptr ColorSpaceKHR -> Int -> IO ColorSpaceKHR
Ptr ColorSpaceKHR -> Int -> ColorSpaceKHR -> IO ()
Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ()
ColorSpaceKHR -> Int
(ColorSpaceKHR -> Int)
-> (ColorSpaceKHR -> Int)
-> (Ptr ColorSpaceKHR -> Int -> IO ColorSpaceKHR)
-> (Ptr ColorSpaceKHR -> Int -> ColorSpaceKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO ColorSpaceKHR)
-> (forall b. Ptr b -> Int -> ColorSpaceKHR -> IO ())
-> (Ptr ColorSpaceKHR -> IO ColorSpaceKHR)
-> (Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ())
-> Storable ColorSpaceKHR
forall b. Ptr b -> Int -> IO ColorSpaceKHR
forall b. Ptr b -> Int -> ColorSpaceKHR -> 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 :: ColorSpaceKHR -> Int
sizeOf :: ColorSpaceKHR -> Int
$calignment :: ColorSpaceKHR -> Int
alignment :: ColorSpaceKHR -> Int
$cpeekElemOff :: Ptr ColorSpaceKHR -> Int -> IO ColorSpaceKHR
peekElemOff :: Ptr ColorSpaceKHR -> Int -> IO ColorSpaceKHR
$cpokeElemOff :: Ptr ColorSpaceKHR -> Int -> ColorSpaceKHR -> IO ()
pokeElemOff :: Ptr ColorSpaceKHR -> Int -> ColorSpaceKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ColorSpaceKHR
peekByteOff :: forall b. Ptr b -> Int -> IO ColorSpaceKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> ColorSpaceKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> ColorSpaceKHR -> IO ()
$cpeek :: Ptr ColorSpaceKHR -> IO ColorSpaceKHR
peek :: Ptr ColorSpaceKHR -> IO ColorSpaceKHR
$cpoke :: Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ()
poke :: Ptr ColorSpaceKHR -> ColorSpaceKHR -> IO ()
Storable, ColorSpaceKHR
ColorSpaceKHR -> Zero ColorSpaceKHR
forall a. a -> Zero a
$czero :: ColorSpaceKHR
zero :: ColorSpaceKHR
Zero)

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_SRGB_NONLINEAR_KHR"
pattern $mCOLOR_SPACE_SRGB_NONLINEAR_KHR :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR
COLOR_SPACE_SRGB_NONLINEAR_KHR = ColorSpaceKHR 0

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_DISPLAY_NATIVE_AMD"
pattern $mCOLOR_SPACE_DISPLAY_NATIVE_AMD :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_DISPLAY_NATIVE_AMD :: ColorSpaceKHR
COLOR_SPACE_DISPLAY_NATIVE_AMD = ColorSpaceKHR 1000213000

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT"
pattern $mCOLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT = ColorSpaceKHR 1000104014

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_PASS_THROUGH_EXT"
pattern $mCOLOR_SPACE_PASS_THROUGH_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_PASS_THROUGH_EXT :: ColorSpaceKHR
COLOR_SPACE_PASS_THROUGH_EXT = ColorSpaceKHR 1000104013

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT"
pattern $mCOLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = ColorSpaceKHR 1000104012

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT"
pattern $mCOLOR_SPACE_ADOBERGB_LINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_ADOBERGB_LINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_ADOBERGB_LINEAR_EXT = ColorSpaceKHR 1000104011

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_HDR10_HLG_EXT"
pattern $mCOLOR_SPACE_HDR10_HLG_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_HDR10_HLG_EXT :: ColorSpaceKHR
COLOR_SPACE_HDR10_HLG_EXT = ColorSpaceKHR 1000104010

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_DOLBYVISION_EXT"
pattern $mCOLOR_SPACE_DOLBYVISION_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_DOLBYVISION_EXT :: ColorSpaceKHR
COLOR_SPACE_DOLBYVISION_EXT = ColorSpaceKHR 1000104009

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_HDR10_ST2084_EXT"
pattern $mCOLOR_SPACE_HDR10_ST2084_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_HDR10_ST2084_EXT :: ColorSpaceKHR
COLOR_SPACE_HDR10_ST2084_EXT = ColorSpaceKHR 1000104008

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_BT2020_LINEAR_EXT"
pattern $mCOLOR_SPACE_BT2020_LINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_BT2020_LINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_BT2020_LINEAR_EXT = ColorSpaceKHR 1000104007

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_BT709_NONLINEAR_EXT"
pattern $mCOLOR_SPACE_BT709_NONLINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_BT709_NONLINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_BT709_NONLINEAR_EXT = ColorSpaceKHR 1000104006

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_BT709_LINEAR_EXT"
pattern $mCOLOR_SPACE_BT709_LINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_BT709_LINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_BT709_LINEAR_EXT = ColorSpaceKHR 1000104005

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT"
pattern $mCOLOR_SPACE_DCI_P3_NONLINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_DCI_P3_NONLINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_DCI_P3_NONLINEAR_EXT = ColorSpaceKHR 1000104004

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT"
pattern $mCOLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = ColorSpaceKHR 1000104003

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT"
pattern $mCOLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT = ColorSpaceKHR 1000104002

-- No documentation found for Nested "VkColorSpaceKHR" "VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT"
pattern $mCOLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: forall {r}. ColorSpaceKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: ColorSpaceKHR
COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = ColorSpaceKHR 1000104001

{-# COMPLETE
  COLOR_SPACE_SRGB_NONLINEAR_KHR
  , COLOR_SPACE_DISPLAY_NATIVE_AMD
  , COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
  , COLOR_SPACE_PASS_THROUGH_EXT
  , COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
  , COLOR_SPACE_ADOBERGB_LINEAR_EXT
  , COLOR_SPACE_HDR10_HLG_EXT
  , COLOR_SPACE_DOLBYVISION_EXT
  , COLOR_SPACE_HDR10_ST2084_EXT
  , COLOR_SPACE_BT2020_LINEAR_EXT
  , COLOR_SPACE_BT709_NONLINEAR_EXT
  , COLOR_SPACE_BT709_LINEAR_EXT
  , COLOR_SPACE_DCI_P3_NONLINEAR_EXT
  , COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
  , COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
  , COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT ::
    ColorSpaceKHR
  #-}

conNameColorSpaceKHR :: String
conNameColorSpaceKHR :: String
conNameColorSpaceKHR = String
"ColorSpaceKHR"

enumPrefixColorSpaceKHR :: String
enumPrefixColorSpaceKHR :: String
enumPrefixColorSpaceKHR = String
"COLOR_SPACE_"

showTableColorSpaceKHR :: [(ColorSpaceKHR, String)]
showTableColorSpaceKHR :: [(ColorSpaceKHR, String)]
showTableColorSpaceKHR =
  [
    ( ColorSpaceKHR
COLOR_SPACE_SRGB_NONLINEAR_KHR
    , String
"SRGB_NONLINEAR_KHR"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_DISPLAY_NATIVE_AMD
    , String
"DISPLAY_NATIVE_AMD"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
    , String
"EXTENDED_SRGB_NONLINEAR_EXT"
    )
  , (ColorSpaceKHR
COLOR_SPACE_PASS_THROUGH_EXT, String
"PASS_THROUGH_EXT")
  ,
    ( ColorSpaceKHR
COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
    , String
"ADOBERGB_NONLINEAR_EXT"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_ADOBERGB_LINEAR_EXT
    , String
"ADOBERGB_LINEAR_EXT"
    )
  , (ColorSpaceKHR
COLOR_SPACE_HDR10_HLG_EXT, String
"HDR10_HLG_EXT")
  , (ColorSpaceKHR
COLOR_SPACE_DOLBYVISION_EXT, String
"DOLBYVISION_EXT")
  , (ColorSpaceKHR
COLOR_SPACE_HDR10_ST2084_EXT, String
"HDR10_ST2084_EXT")
  , (ColorSpaceKHR
COLOR_SPACE_BT2020_LINEAR_EXT, String
"BT2020_LINEAR_EXT")
  ,
    ( ColorSpaceKHR
COLOR_SPACE_BT709_NONLINEAR_EXT
    , String
"BT709_NONLINEAR_EXT"
    )
  , (ColorSpaceKHR
COLOR_SPACE_BT709_LINEAR_EXT, String
"BT709_LINEAR_EXT")
  ,
    ( ColorSpaceKHR
COLOR_SPACE_DCI_P3_NONLINEAR_EXT
    , String
"DCI_P3_NONLINEAR_EXT"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
    , String
"DISPLAY_P3_LINEAR_EXT"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
    , String
"EXTENDED_SRGB_LINEAR_EXT"
    )
  ,
    ( ColorSpaceKHR
COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
    , String
"DISPLAY_P3_NONLINEAR_EXT"
    )
  ]

instance Show ColorSpaceKHR where
  showsPrec :: Int -> ColorSpaceKHR -> ShowS
showsPrec =
    String
-> [(ColorSpaceKHR, String)]
-> String
-> (ColorSpaceKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> ColorSpaceKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixColorSpaceKHR
      [(ColorSpaceKHR, String)]
showTableColorSpaceKHR
      String
conNameColorSpaceKHR
      (\(ColorSpaceKHR Int32
x) -> Int32
x)
      (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read ColorSpaceKHR where
  readPrec :: ReadPrec ColorSpaceKHR
readPrec =
    String
-> [(ColorSpaceKHR, String)]
-> String
-> (Int32 -> ColorSpaceKHR)
-> ReadPrec ColorSpaceKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixColorSpaceKHR
      [(ColorSpaceKHR, String)]
showTableColorSpaceKHR
      String
conNameColorSpaceKHR
      Int32 -> ColorSpaceKHR
ColorSpaceKHR

type CompositeAlphaFlagsKHR = CompositeAlphaFlagBitsKHR

-- | VkCompositeAlphaFlagBitsKHR - Alpha compositing modes supported on a
-- device
--
-- = Description
--
-- These values are described as follows:
--
-- -   'COMPOSITE_ALPHA_OPAQUE_BIT_KHR': The alpha component, if it exists,
--     of the images is ignored in the compositing process. Instead, the
--     image is treated as if it has a constant alpha of 1.0.
--
-- -   'COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR': The alpha component, if it
--     exists, of the images is respected in the compositing process. The
--     non-alpha components of the image are expected to already be
--     multiplied by the alpha component by the application.
--
-- -   'COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR': The alpha component, if
--     it exists, of the images is respected in the compositing process.
--     The non-alpha components of the image are not expected to already be
--     multiplied by the alpha component by the application; instead, the
--     compositor will multiply the non-alpha components of the image by
--     the alpha component during compositing.
--
-- -   'COMPOSITE_ALPHA_INHERIT_BIT_KHR': The way in which the presentation
--     engine treats the alpha component in the images is unknown to the
--     Vulkan API. Instead, the application is responsible for setting the
--     composite alpha blending mode using native window system commands.
--     If the application does not set the blending mode using native
--     window system commands, then a platform-specific default will be
--     used.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'CompositeAlphaFlagsKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR'
newtype CompositeAlphaFlagBitsKHR = CompositeAlphaFlagBitsKHR Flags
  deriving newtype (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
(CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> Eq CompositeAlphaFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
== :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
$c/= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
/= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
Eq, Eq CompositeAlphaFlagsKHR
Eq CompositeAlphaFlagsKHR =>
(CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Ordering)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR
    -> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR
    -> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> Ord CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Ordering
CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
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 :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Ordering
compare :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Ordering
$c< :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
< :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
$c<= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
<= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
$c> :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
> :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
$c>= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
>= :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> Bool
$cmax :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
max :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
$cmin :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
min :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
Ord, Ptr CompositeAlphaFlagsKHR -> IO CompositeAlphaFlagsKHR
Ptr CompositeAlphaFlagsKHR -> Int -> IO CompositeAlphaFlagsKHR
Ptr CompositeAlphaFlagsKHR
-> Int -> CompositeAlphaFlagsKHR -> IO ()
Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ()
CompositeAlphaFlagsKHR -> Int
(CompositeAlphaFlagsKHR -> Int)
-> (CompositeAlphaFlagsKHR -> Int)
-> (Ptr CompositeAlphaFlagsKHR -> Int -> IO CompositeAlphaFlagsKHR)
-> (Ptr CompositeAlphaFlagsKHR
    -> Int -> CompositeAlphaFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO CompositeAlphaFlagsKHR)
-> (forall b. Ptr b -> Int -> CompositeAlphaFlagsKHR -> IO ())
-> (Ptr CompositeAlphaFlagsKHR -> IO CompositeAlphaFlagsKHR)
-> (Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ())
-> Storable CompositeAlphaFlagsKHR
forall b. Ptr b -> Int -> IO CompositeAlphaFlagsKHR
forall b. Ptr b -> Int -> CompositeAlphaFlagsKHR -> 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 :: CompositeAlphaFlagsKHR -> Int
sizeOf :: CompositeAlphaFlagsKHR -> Int
$calignment :: CompositeAlphaFlagsKHR -> Int
alignment :: CompositeAlphaFlagsKHR -> Int
$cpeekElemOff :: Ptr CompositeAlphaFlagsKHR -> Int -> IO CompositeAlphaFlagsKHR
peekElemOff :: Ptr CompositeAlphaFlagsKHR -> Int -> IO CompositeAlphaFlagsKHR
$cpokeElemOff :: Ptr CompositeAlphaFlagsKHR
-> Int -> CompositeAlphaFlagsKHR -> IO ()
pokeElemOff :: Ptr CompositeAlphaFlagsKHR
-> Int -> CompositeAlphaFlagsKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO CompositeAlphaFlagsKHR
peekByteOff :: forall b. Ptr b -> Int -> IO CompositeAlphaFlagsKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> CompositeAlphaFlagsKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> CompositeAlphaFlagsKHR -> IO ()
$cpeek :: Ptr CompositeAlphaFlagsKHR -> IO CompositeAlphaFlagsKHR
peek :: Ptr CompositeAlphaFlagsKHR -> IO CompositeAlphaFlagsKHR
$cpoke :: Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ()
poke :: Ptr CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR -> IO ()
Storable, CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR -> Zero CompositeAlphaFlagsKHR
forall a. a -> Zero a
$czero :: CompositeAlphaFlagsKHR
zero :: CompositeAlphaFlagsKHR
Zero, Eq CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR
Eq CompositeAlphaFlagsKHR =>
(CompositeAlphaFlagsKHR
 -> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR
    -> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR
    -> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> CompositeAlphaFlagsKHR
-> (Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> Bool)
-> (CompositeAlphaFlagsKHR -> Maybe Int)
-> (CompositeAlphaFlagsKHR -> Int)
-> (CompositeAlphaFlagsKHR -> Bool)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR)
-> (CompositeAlphaFlagsKHR -> Int)
-> Bits CompositeAlphaFlagsKHR
Int -> CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR -> Bool
CompositeAlphaFlagsKHR -> Int
CompositeAlphaFlagsKHR -> Maybe Int
CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR -> Int -> Bool
CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
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.&. :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
.&. :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
$c.|. :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
.|. :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
$cxor :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
xor :: CompositeAlphaFlagsKHR
-> CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
$ccomplement :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
complement :: CompositeAlphaFlagsKHR -> CompositeAlphaFlagsKHR
$cshift :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
shift :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$crotate :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
rotate :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$czeroBits :: CompositeAlphaFlagsKHR
zeroBits :: CompositeAlphaFlagsKHR
$cbit :: Int -> CompositeAlphaFlagsKHR
bit :: Int -> CompositeAlphaFlagsKHR
$csetBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
setBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$cclearBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
clearBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$ccomplementBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
complementBit :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$ctestBit :: CompositeAlphaFlagsKHR -> Int -> Bool
testBit :: CompositeAlphaFlagsKHR -> Int -> Bool
$cbitSizeMaybe :: CompositeAlphaFlagsKHR -> Maybe Int
bitSizeMaybe :: CompositeAlphaFlagsKHR -> Maybe Int
$cbitSize :: CompositeAlphaFlagsKHR -> Int
bitSize :: CompositeAlphaFlagsKHR -> Int
$cisSigned :: CompositeAlphaFlagsKHR -> Bool
isSigned :: CompositeAlphaFlagsKHR -> Bool
$cshiftL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
shiftL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$cunsafeShiftL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
unsafeShiftL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$cshiftR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
shiftR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$cunsafeShiftR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
unsafeShiftR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$crotateL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
rotateL :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$crotateR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
rotateR :: CompositeAlphaFlagsKHR -> Int -> CompositeAlphaFlagsKHR
$cpopCount :: CompositeAlphaFlagsKHR -> Int
popCount :: CompositeAlphaFlagsKHR -> Int
Bits, Bits CompositeAlphaFlagsKHR
Bits CompositeAlphaFlagsKHR =>
(CompositeAlphaFlagsKHR -> Int)
-> (CompositeAlphaFlagsKHR -> Int)
-> (CompositeAlphaFlagsKHR -> Int)
-> FiniteBits CompositeAlphaFlagsKHR
CompositeAlphaFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: CompositeAlphaFlagsKHR -> Int
finiteBitSize :: CompositeAlphaFlagsKHR -> Int
$ccountLeadingZeros :: CompositeAlphaFlagsKHR -> Int
countLeadingZeros :: CompositeAlphaFlagsKHR -> Int
$ccountTrailingZeros :: CompositeAlphaFlagsKHR -> Int
countTrailingZeros :: CompositeAlphaFlagsKHR -> Int
FiniteBits)

-- No documentation found for Nested "VkCompositeAlphaFlagBitsKHR" "VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR"
pattern $mCOMPOSITE_ALPHA_OPAQUE_BIT_KHR :: forall {r}.
CompositeAlphaFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOMPOSITE_ALPHA_OPAQUE_BIT_KHR :: CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_OPAQUE_BIT_KHR = CompositeAlphaFlagBitsKHR 0x00000001

-- No documentation found for Nested "VkCompositeAlphaFlagBitsKHR" "VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR"
pattern $mCOMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR :: forall {r}.
CompositeAlphaFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = CompositeAlphaFlagBitsKHR 0x00000002

-- No documentation found for Nested "VkCompositeAlphaFlagBitsKHR" "VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR"
pattern $mCOMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR :: forall {r}.
CompositeAlphaFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR :: CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = CompositeAlphaFlagBitsKHR 0x00000004

-- No documentation found for Nested "VkCompositeAlphaFlagBitsKHR" "VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR"
pattern $mCOMPOSITE_ALPHA_INHERIT_BIT_KHR :: forall {r}.
CompositeAlphaFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bCOMPOSITE_ALPHA_INHERIT_BIT_KHR :: CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_INHERIT_BIT_KHR = CompositeAlphaFlagBitsKHR 0x00000008

conNameCompositeAlphaFlagBitsKHR :: String
conNameCompositeAlphaFlagBitsKHR :: String
conNameCompositeAlphaFlagBitsKHR = String
"CompositeAlphaFlagBitsKHR"

enumPrefixCompositeAlphaFlagBitsKHR :: String
enumPrefixCompositeAlphaFlagBitsKHR :: String
enumPrefixCompositeAlphaFlagBitsKHR = String
"COMPOSITE_ALPHA_"

showTableCompositeAlphaFlagBitsKHR :: [(CompositeAlphaFlagBitsKHR, String)]
showTableCompositeAlphaFlagBitsKHR :: [(CompositeAlphaFlagsKHR, String)]
showTableCompositeAlphaFlagBitsKHR =
  [
    ( CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_OPAQUE_BIT_KHR
    , String
"OPAQUE_BIT_KHR"
    )
  ,
    ( CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
    , String
"PRE_MULTIPLIED_BIT_KHR"
    )
  ,
    ( CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
    , String
"POST_MULTIPLIED_BIT_KHR"
    )
  ,
    ( CompositeAlphaFlagsKHR
COMPOSITE_ALPHA_INHERIT_BIT_KHR
    , String
"INHERIT_BIT_KHR"
    )
  ]

instance Show CompositeAlphaFlagBitsKHR where
  showsPrec :: Int -> CompositeAlphaFlagsKHR -> ShowS
showsPrec =
    String
-> [(CompositeAlphaFlagsKHR, String)]
-> String
-> (CompositeAlphaFlagsKHR -> Word32)
-> (Word32 -> ShowS)
-> Int
-> CompositeAlphaFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixCompositeAlphaFlagBitsKHR
      [(CompositeAlphaFlagsKHR, String)]
showTableCompositeAlphaFlagBitsKHR
      String
conNameCompositeAlphaFlagBitsKHR
      (\(CompositeAlphaFlagBitsKHR 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 CompositeAlphaFlagBitsKHR where
  readPrec :: ReadPrec CompositeAlphaFlagsKHR
readPrec =
    String
-> [(CompositeAlphaFlagsKHR, String)]
-> String
-> (Word32 -> CompositeAlphaFlagsKHR)
-> ReadPrec CompositeAlphaFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixCompositeAlphaFlagBitsKHR
      [(CompositeAlphaFlagsKHR, String)]
showTableCompositeAlphaFlagBitsKHR
      String
conNameCompositeAlphaFlagBitsKHR
      Word32 -> CompositeAlphaFlagsKHR
CompositeAlphaFlagBitsKHR

type SurfaceTransformFlagsKHR = SurfaceTransformFlagBitsKHR

-- | VkSurfaceTransformFlagBitsKHR - Presentation transforms supported on a
-- device
--
-- = Description
--
-- -   'SURFACE_TRANSFORM_IDENTITY_BIT_KHR' specifies that image content is
--     presented without being transformed.
--
-- -   'SURFACE_TRANSFORM_ROTATE_90_BIT_KHR' specifies that image content
--     is rotated 90 degrees clockwise.
--
-- -   'SURFACE_TRANSFORM_ROTATE_180_BIT_KHR' specifies that image content
--     is rotated 180 degrees clockwise.
--
-- -   'SURFACE_TRANSFORM_ROTATE_270_BIT_KHR' specifies that image content
--     is rotated 270 degrees clockwise.
--
-- -   'SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR' specifies that image
--     content is mirrored horizontally.
--
-- -   'SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR' specifies
--     that image content is mirrored horizontally, then rotated 90 degrees
--     clockwise.
--
-- -   'SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR' specifies
--     that image content is mirrored horizontally, then rotated 180
--     degrees clockwise.
--
-- -   'SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR' specifies
--     that image content is mirrored horizontally, then rotated 270
--     degrees clockwise.
--
-- -   'SURFACE_TRANSFORM_INHERIT_BIT_KHR' specifies that the presentation
--     transform is not specified, and is instead determined by
--     platform-specific considerations and mechanisms outside Vulkan.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>,
-- 'Vulkan.Extensions.VK_QCOM_render_pass_transform.CommandBufferInheritanceRenderPassTransformInfoQCOM',
-- 'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM',
-- 'Vulkan.Extensions.VK_KHR_display.DisplaySurfaceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_QCOM_render_pass_transform.RenderPassTransformBeginInfoQCOM',
-- 'Vulkan.Extensions.VK_EXT_display_surface_counter.SurfaceCapabilities2EXT',
-- 'SurfaceCapabilitiesKHR', 'SurfaceTransformFlagsKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR'
newtype SurfaceTransformFlagBitsKHR = SurfaceTransformFlagBitsKHR Flags
  deriving newtype (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
(SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> Eq SurfaceTransformFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
== :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
$c/= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
/= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
Eq, Eq SurfaceTransformFlagsKHR
Eq SurfaceTransformFlagsKHR =>
(SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Ordering)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR
    -> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR
    -> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> Ord SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Ordering
SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
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 :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Ordering
compare :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Ordering
$c< :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
< :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
$c<= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
<= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
$c> :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
> :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
$c>= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
>= :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> Bool
$cmax :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
max :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
$cmin :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
min :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
Ord, Ptr SurfaceTransformFlagsKHR -> IO SurfaceTransformFlagsKHR
Ptr SurfaceTransformFlagsKHR -> Int -> IO SurfaceTransformFlagsKHR
Ptr SurfaceTransformFlagsKHR
-> Int -> SurfaceTransformFlagsKHR -> IO ()
Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
SurfaceTransformFlagsKHR -> Int
(SurfaceTransformFlagsKHR -> Int)
-> (SurfaceTransformFlagsKHR -> Int)
-> (Ptr SurfaceTransformFlagsKHR
    -> Int -> IO SurfaceTransformFlagsKHR)
-> (Ptr SurfaceTransformFlagsKHR
    -> Int -> SurfaceTransformFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO SurfaceTransformFlagsKHR)
-> (forall b. Ptr b -> Int -> SurfaceTransformFlagsKHR -> IO ())
-> (Ptr SurfaceTransformFlagsKHR -> IO SurfaceTransformFlagsKHR)
-> (Ptr SurfaceTransformFlagsKHR
    -> SurfaceTransformFlagsKHR -> IO ())
-> Storable SurfaceTransformFlagsKHR
forall b. Ptr b -> Int -> IO SurfaceTransformFlagsKHR
forall b. Ptr b -> Int -> SurfaceTransformFlagsKHR -> 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 :: SurfaceTransformFlagsKHR -> Int
sizeOf :: SurfaceTransformFlagsKHR -> Int
$calignment :: SurfaceTransformFlagsKHR -> Int
alignment :: SurfaceTransformFlagsKHR -> Int
$cpeekElemOff :: Ptr SurfaceTransformFlagsKHR -> Int -> IO SurfaceTransformFlagsKHR
peekElemOff :: Ptr SurfaceTransformFlagsKHR -> Int -> IO SurfaceTransformFlagsKHR
$cpokeElemOff :: Ptr SurfaceTransformFlagsKHR
-> Int -> SurfaceTransformFlagsKHR -> IO ()
pokeElemOff :: Ptr SurfaceTransformFlagsKHR
-> Int -> SurfaceTransformFlagsKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SurfaceTransformFlagsKHR
peekByteOff :: forall b. Ptr b -> Int -> IO SurfaceTransformFlagsKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> SurfaceTransformFlagsKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SurfaceTransformFlagsKHR -> IO ()
$cpeek :: Ptr SurfaceTransformFlagsKHR -> IO SurfaceTransformFlagsKHR
peek :: Ptr SurfaceTransformFlagsKHR -> IO SurfaceTransformFlagsKHR
$cpoke :: Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
poke :: Ptr SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR -> IO ()
Storable, SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR -> Zero SurfaceTransformFlagsKHR
forall a. a -> Zero a
$czero :: SurfaceTransformFlagsKHR
zero :: SurfaceTransformFlagsKHR
Zero, Eq SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR
Eq SurfaceTransformFlagsKHR =>
(SurfaceTransformFlagsKHR
 -> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR
    -> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR
    -> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> SurfaceTransformFlagsKHR
-> (Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> Bool)
-> (SurfaceTransformFlagsKHR -> Maybe Int)
-> (SurfaceTransformFlagsKHR -> Int)
-> (SurfaceTransformFlagsKHR -> Bool)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR)
-> (SurfaceTransformFlagsKHR -> Int)
-> Bits SurfaceTransformFlagsKHR
Int -> SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR -> Bool
SurfaceTransformFlagsKHR -> Int
SurfaceTransformFlagsKHR -> Maybe Int
SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR -> Int -> Bool
SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
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.&. :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
.&. :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
$c.|. :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
.|. :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
$cxor :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
xor :: SurfaceTransformFlagsKHR
-> SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
$ccomplement :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
complement :: SurfaceTransformFlagsKHR -> SurfaceTransformFlagsKHR
$cshift :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
shift :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$crotate :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
rotate :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$czeroBits :: SurfaceTransformFlagsKHR
zeroBits :: SurfaceTransformFlagsKHR
$cbit :: Int -> SurfaceTransformFlagsKHR
bit :: Int -> SurfaceTransformFlagsKHR
$csetBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
setBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$cclearBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
clearBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$ccomplementBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
complementBit :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$ctestBit :: SurfaceTransformFlagsKHR -> Int -> Bool
testBit :: SurfaceTransformFlagsKHR -> Int -> Bool
$cbitSizeMaybe :: SurfaceTransformFlagsKHR -> Maybe Int
bitSizeMaybe :: SurfaceTransformFlagsKHR -> Maybe Int
$cbitSize :: SurfaceTransformFlagsKHR -> Int
bitSize :: SurfaceTransformFlagsKHR -> Int
$cisSigned :: SurfaceTransformFlagsKHR -> Bool
isSigned :: SurfaceTransformFlagsKHR -> Bool
$cshiftL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
shiftL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$cunsafeShiftL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
unsafeShiftL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$cshiftR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
shiftR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$cunsafeShiftR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
unsafeShiftR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$crotateL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
rotateL :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$crotateR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
rotateR :: SurfaceTransformFlagsKHR -> Int -> SurfaceTransformFlagsKHR
$cpopCount :: SurfaceTransformFlagsKHR -> Int
popCount :: SurfaceTransformFlagsKHR -> Int
Bits, Bits SurfaceTransformFlagsKHR
Bits SurfaceTransformFlagsKHR =>
(SurfaceTransformFlagsKHR -> Int)
-> (SurfaceTransformFlagsKHR -> Int)
-> (SurfaceTransformFlagsKHR -> Int)
-> FiniteBits SurfaceTransformFlagsKHR
SurfaceTransformFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: SurfaceTransformFlagsKHR -> Int
finiteBitSize :: SurfaceTransformFlagsKHR -> Int
$ccountLeadingZeros :: SurfaceTransformFlagsKHR -> Int
countLeadingZeros :: SurfaceTransformFlagsKHR -> Int
$ccountTrailingZeros :: SurfaceTransformFlagsKHR -> Int
countTrailingZeros :: SurfaceTransformFlagsKHR -> Int
FiniteBits)

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR"
pattern $mSURFACE_TRANSFORM_IDENTITY_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_IDENTITY_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_IDENTITY_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000001

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR"
pattern $mSURFACE_TRANSFORM_ROTATE_90_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_ROTATE_90_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000002

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR"
pattern $mSURFACE_TRANSFORM_ROTATE_180_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_ROTATE_180_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000004

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR"
pattern $mSURFACE_TRANSFORM_ROTATE_270_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_ROTATE_270_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000008

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR"
pattern $mSURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000010

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"
pattern $mSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000020

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"
pattern $mSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000040

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"
pattern $mSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000080

-- No documentation found for Nested "VkSurfaceTransformFlagBitsKHR" "VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR"
pattern $mSURFACE_TRANSFORM_INHERIT_BIT_KHR :: forall {r}.
SurfaceTransformFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bSURFACE_TRANSFORM_INHERIT_BIT_KHR :: SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_INHERIT_BIT_KHR = SurfaceTransformFlagBitsKHR 0x00000100

conNameSurfaceTransformFlagBitsKHR :: String
conNameSurfaceTransformFlagBitsKHR :: String
conNameSurfaceTransformFlagBitsKHR = String
"SurfaceTransformFlagBitsKHR"

enumPrefixSurfaceTransformFlagBitsKHR :: String
enumPrefixSurfaceTransformFlagBitsKHR :: String
enumPrefixSurfaceTransformFlagBitsKHR = String
"SURFACE_TRANSFORM_"

showTableSurfaceTransformFlagBitsKHR :: [(SurfaceTransformFlagBitsKHR, String)]
showTableSurfaceTransformFlagBitsKHR :: [(SurfaceTransformFlagsKHR, String)]
showTableSurfaceTransformFlagBitsKHR =
  [
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_IDENTITY_BIT_KHR
    , String
"IDENTITY_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
    , String
"ROTATE_90_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
    , String
"ROTATE_180_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
    , String
"ROTATE_270_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
    , String
"HORIZONTAL_MIRROR_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
    , String
"HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
    , String
"HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
    , String
"HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"
    )
  ,
    ( SurfaceTransformFlagsKHR
SURFACE_TRANSFORM_INHERIT_BIT_KHR
    , String
"INHERIT_BIT_KHR"
    )
  ]

instance Show SurfaceTransformFlagBitsKHR where
  showsPrec :: Int -> SurfaceTransformFlagsKHR -> ShowS
showsPrec =
    String
-> [(SurfaceTransformFlagsKHR, String)]
-> String
-> (SurfaceTransformFlagsKHR -> Word32)
-> (Word32 -> ShowS)
-> Int
-> SurfaceTransformFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixSurfaceTransformFlagBitsKHR
      [(SurfaceTransformFlagsKHR, String)]
showTableSurfaceTransformFlagBitsKHR
      String
conNameSurfaceTransformFlagBitsKHR
      (\(SurfaceTransformFlagBitsKHR 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 SurfaceTransformFlagBitsKHR where
  readPrec :: ReadPrec SurfaceTransformFlagsKHR
readPrec =
    String
-> [(SurfaceTransformFlagsKHR, String)]
-> String
-> (Word32 -> SurfaceTransformFlagsKHR)
-> ReadPrec SurfaceTransformFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixSurfaceTransformFlagBitsKHR
      [(SurfaceTransformFlagsKHR, String)]
showTableSurfaceTransformFlagBitsKHR
      String
conNameSurfaceTransformFlagBitsKHR
      Word32 -> SurfaceTransformFlagsKHR
SurfaceTransformFlagBitsKHR

type KHR_SURFACE_SPEC_VERSION = 25

-- No documentation found for TopLevel "VK_KHR_SURFACE_SPEC_VERSION"
pattern KHR_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_SURFACE_SPEC_VERSION :: forall a. Integral a => a
KHR_SURFACE_SPEC_VERSION = 25


type KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface"

-- No documentation found for TopLevel "VK_KHR_SURFACE_EXTENSION_NAME"
pattern KHR_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface"