{-# language CPP #-}
-- | = Name
--
-- VK_EXT_headless_surface - instance extension
--
-- == VK_EXT_headless_surface
--
-- [__Name String__]
--     @VK_EXT_headless_surface@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     257
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>
--
-- [__Contact__]
--
--     -   Lisa Wu
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_headless_surface] @chengtianww%0A*Here describe the issue or question you have about the VK_EXT_headless_surface extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2019-03-21
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Ray Smith, Arm
--
-- == Description
--
-- The @VK_EXT_headless_surface@ extension is an instance extension. It
-- provides a mechanism to create 'Vulkan.Extensions.Handles.SurfaceKHR'
-- objects independently of any window system or display device. The
-- presentation operation for a swapchain created from a headless surface
-- is by default a no-op, resulting in no externally-visible result.
--
-- Because there is no real presentation target, future extensions can
-- layer on top of the headless surface to introduce arbitrary or
-- customisable sets of restrictions or features. These could include
-- features like saving to a file or restrictions to emulate a particular
-- presentation target.
--
-- This functionality is expected to be useful for application and driver
-- development because it allows any platform to expose an arbitrary or
-- customisable set of restrictions and features of a presentation engine.
-- This makes it a useful portable test target for applications targeting a
-- wide range of presentation engines where the actual target presentation
-- engines might be scarce, unavailable or otherwise undesirable or
-- inconvenient to use for general Vulkan application development.
--
-- == New Commands
--
-- -   'createHeadlessSurfaceEXT'
--
-- == New Structures
--
-- -   'HeadlessSurfaceCreateInfoEXT'
--
-- == New Bitmasks
--
-- -   'HeadlessSurfaceCreateFlagsEXT'
--
-- == New Enum Constants
--
-- -   'EXT_HEADLESS_SURFACE_EXTENSION_NAME'
--
-- -   'EXT_HEADLESS_SURFACE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT'
--
-- == Version History
--
-- -   Revision 1, 2019-03-21 (Ray Smith)
--
--     -   Initial draft
--
-- == See Also
--
-- 'HeadlessSurfaceCreateFlagsEXT', 'HeadlessSurfaceCreateInfoEXT',
-- 'createHeadlessSurfaceEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_headless_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_EXT_headless_surface  ( createHeadlessSurfaceEXT
                                                  , HeadlessSurfaceCreateInfoEXT(..)
                                                  , HeadlessSurfaceCreateFlagsEXT(..)
                                                  , EXT_HEADLESS_SURFACE_SPEC_VERSION
                                                  , pattern EXT_HEADLESS_SURFACE_SPEC_VERSION
                                                  , EXT_HEADLESS_SURFACE_EXTENSION_NAME
                                                  , pattern EXT_HEADLESS_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 Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
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 Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Core10.Handles (Instance(Instance))
import Vulkan.Dynamic (InstanceCmds(pVkCreateHeadlessSurfaceEXT))
import Vulkan.Core10.Handles (Instance_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (SurfaceKHR)
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateHeadlessSurfaceEXT
  :: FunPtr (Ptr Instance_T -> Ptr HeadlessSurfaceCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr HeadlessSurfaceCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result

-- | vkCreateHeadlessSurfaceEXT - Create a headless
-- 'Vulkan.Extensions.Handles.SurfaceKHR' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateHeadlessSurfaceEXT-instance-parameter# @instance@
--     /must/ be a valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   #VUID-vkCreateHeadlessSurfaceEXT-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'HeadlessSurfaceCreateInfoEXT' structure
--
-- -   #VUID-vkCreateHeadlessSurfaceEXT-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateHeadlessSurfaceEXT-pSurface-parameter# @pSurface@
--     /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_headless_surface VK_EXT_headless_surface>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'HeadlessSurfaceCreateInfoEXT', 'Vulkan.Core10.Handles.Instance',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
createHeadlessSurfaceEXT :: forall io
                          . (MonadIO io)
                         => -- | @instance@ is the instance to associate the surface with.
                            Instance
                         -> -- | @pCreateInfo@ is a pointer to a 'HeadlessSurfaceCreateInfoEXT' structure
                            -- containing parameters affecting the creation of the surface object.
                            HeadlessSurfaceCreateInfoEXT
                         -> -- | @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/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
                            ("allocator" ::: Maybe AllocationCallbacks)
                         -> io (SurfaceKHR)
createHeadlessSurfaceEXT :: forall (io :: * -> *).
MonadIO io =>
Instance
-> HeadlessSurfaceCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createHeadlessSurfaceEXT Instance
instance'
                           HeadlessSurfaceCreateInfoEXT
createInfo
                           "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCreateHeadlessSurfaceEXTPtr :: FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateHeadlessSurfaceEXTPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
pVkCreateHeadlessSurfaceEXT (case Instance
instance' of Instance{InstanceCmds
$sel:instanceCmds:Instance :: Instance -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateHeadlessSurfaceEXTPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateHeadlessSurfaceEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateHeadlessSurfaceEXT' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateHeadlessSurfaceEXT' = FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateHeadlessSurfaceEXT FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateHeadlessSurfaceEXTPtr
  "pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (HeadlessSurfaceCreateInfoEXT
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pSurface" ::: Ptr SurfaceKHR
pPSurface <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @SurfaceKHR Int
8) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateHeadlessSurfaceEXT" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateHeadlessSurfaceEXT'
                                                               (Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
                                                               "pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT
pCreateInfo
                                                               "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
                                                               ("pSurface" ::: Ptr SurfaceKHR
pPSurface))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  SurfaceKHR
pSurface <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @SurfaceKHR "pSurface" ::: Ptr SurfaceKHR
pPSurface
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (SurfaceKHR
pSurface)


-- | VkHeadlessSurfaceCreateInfoEXT - Structure specifying parameters of a
-- newly created headless surface object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_headless_surface VK_EXT_headless_surface>,
-- 'HeadlessSurfaceCreateFlagsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createHeadlessSurfaceEXT'
data HeadlessSurfaceCreateInfoEXT = HeadlessSurfaceCreateInfoEXT
  { -- | @flags@ is reserved for future use.
    --
    -- #VUID-VkHeadlessSurfaceCreateInfoEXT-flags-zerobitmask# @flags@ /must/
    -- be @0@
    HeadlessSurfaceCreateInfoEXT -> HeadlessSurfaceCreateFlagsEXT
flags :: HeadlessSurfaceCreateFlagsEXT }
  deriving (Typeable, HeadlessSurfaceCreateInfoEXT
-> HeadlessSurfaceCreateInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HeadlessSurfaceCreateInfoEXT
-> HeadlessSurfaceCreateInfoEXT -> Bool
$c/= :: HeadlessSurfaceCreateInfoEXT
-> HeadlessSurfaceCreateInfoEXT -> Bool
== :: HeadlessSurfaceCreateInfoEXT
-> HeadlessSurfaceCreateInfoEXT -> Bool
$c== :: HeadlessSurfaceCreateInfoEXT
-> HeadlessSurfaceCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HeadlessSurfaceCreateInfoEXT)
#endif
deriving instance Show HeadlessSurfaceCreateInfoEXT

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

instance FromCStruct HeadlessSurfaceCreateInfoEXT where
  peekCStruct :: ("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT)
-> IO HeadlessSurfaceCreateInfoEXT
peekCStruct "pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT
p = do
    HeadlessSurfaceCreateFlagsEXT
flags <- forall a. Storable a => Ptr a -> IO a
peek @HeadlessSurfaceCreateFlagsEXT (("pCreateInfo" ::: Ptr HeadlessSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr HeadlessSurfaceCreateFlagsEXT))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ HeadlessSurfaceCreateFlagsEXT -> HeadlessSurfaceCreateInfoEXT
HeadlessSurfaceCreateInfoEXT
             HeadlessSurfaceCreateFlagsEXT
flags

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

instance Zero HeadlessSurfaceCreateInfoEXT where
  zero :: HeadlessSurfaceCreateInfoEXT
zero = HeadlessSurfaceCreateFlagsEXT -> HeadlessSurfaceCreateInfoEXT
HeadlessSurfaceCreateInfoEXT
           forall a. Zero a => a
zero


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

conNameHeadlessSurfaceCreateFlagsEXT :: String
conNameHeadlessSurfaceCreateFlagsEXT :: String
conNameHeadlessSurfaceCreateFlagsEXT = String
"HeadlessSurfaceCreateFlagsEXT"

enumPrefixHeadlessSurfaceCreateFlagsEXT :: String
enumPrefixHeadlessSurfaceCreateFlagsEXT :: String
enumPrefixHeadlessSurfaceCreateFlagsEXT = String
""

showTableHeadlessSurfaceCreateFlagsEXT :: [(HeadlessSurfaceCreateFlagsEXT, String)]
showTableHeadlessSurfaceCreateFlagsEXT :: [(HeadlessSurfaceCreateFlagsEXT, String)]
showTableHeadlessSurfaceCreateFlagsEXT = []

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

instance Read HeadlessSurfaceCreateFlagsEXT where
  readPrec :: ReadPrec HeadlessSurfaceCreateFlagsEXT
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixHeadlessSurfaceCreateFlagsEXT
      [(HeadlessSurfaceCreateFlagsEXT, String)]
showTableHeadlessSurfaceCreateFlagsEXT
      String
conNameHeadlessSurfaceCreateFlagsEXT
      Flags -> HeadlessSurfaceCreateFlagsEXT
HeadlessSurfaceCreateFlagsEXT

type EXT_HEADLESS_SURFACE_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_HEADLESS_SURFACE_SPEC_VERSION"
pattern EXT_HEADLESS_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_HEADLESS_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_HEADLESS_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_HEADLESS_SURFACE_SPEC_VERSION = 1


type EXT_HEADLESS_SURFACE_EXTENSION_NAME = "VK_EXT_headless_surface"

-- No documentation found for TopLevel "VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME"
pattern EXT_HEADLESS_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_HEADLESS_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_HEADLESS_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_HEADLESS_SURFACE_EXTENSION_NAME = "VK_EXT_headless_surface"