{-# language CPP #-}
-- | = Name
--
-- VK_NN_vi_surface - instance extension
--
-- == VK_NN_vi_surface
--
-- [__Name String__]
--     @VK_NN_vi_surface@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     63
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
--     -   Requires @VK_KHR_surface@ to be enabled
--
-- [__Contact__]
--
--     -   Mathias Heyer <<data:image/png;base64, GitLab>>mheyer
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2016-12-02
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Mathias Heyer, NVIDIA
--
--     -   Michael Chock, NVIDIA
--
--     -   Yasuhiro Yoshioka, Nintendo
--
--     -   Daniel Koch, NVIDIA
--
-- == Description
--
-- The @VK_NN_vi_surface@ extension is an instance extension. It provides a
-- mechanism to create a 'Vulkan.Extensions.Handles.SurfaceKHR' object
-- (defined by the @VK_KHR_surface@ extension) associated with an
-- @nn@::@vi@::@Layer@.
--
-- == New Commands
--
-- -   'createViSurfaceNN'
--
-- == New Structures
--
-- -   'ViSurfaceCreateInfoNN'
--
-- == New Bitmasks
--
-- -   'ViSurfaceCreateFlagsNN'
--
-- == New Enum Constants
--
-- -   'NN_VI_SURFACE_EXTENSION_NAME'
--
-- -   'NN_VI_SURFACE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN'
--
-- == Issues
--
-- 1) Does VI need a way to query for compatibility between a particular
-- physical device (and queue family?) and a specific VI display?
--
-- __RESOLVED__: No. It is currently always assumed that the device and
-- display will always be compatible.
--
-- 2) 'ViSurfaceCreateInfoNN'::@pWindow@ is intended to store an
-- @nn@::@vi@::@NativeWindowHandle@, but its declared type is a bare
-- @void*@ to store the window handle. Why the discrepancy?
--
-- __RESOLVED__: It is for C compatibility. The definition for the VI
-- native window handle type is defined inside the @nn@::@vi@ C++
-- namespace. This prevents its use in C source files.
-- @nn@::@vi@::@NativeWindowHandle@ is always defined to be @void*@, so
-- this extension uses @void*@ to match.
--
-- == Version History
--
-- -   Revision 1, 2016-12-2 (Michael Chock)
--
--     -   Initial draft.
--
-- == See Also
--
-- 'ViSurfaceCreateFlagsNN', 'ViSurfaceCreateInfoNN', 'createViSurfaceNN'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_NN_vi_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_NN_vi_surface  ( createViSurfaceNN
                                           , ViSurfaceCreateInfoNN(..)
                                           , ViSurfaceCreateFlagsNN(..)
                                           , NN_VI_SURFACE_SPEC_VERSION
                                           , pattern NN_VI_SURFACE_SPEC_VERSION
                                           , NN_VI_SURFACE_EXTENSION_NAME
                                           , pattern NN_VI_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(pVkCreateViSurfaceNN))
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_VI_SURFACE_CREATE_INFO_NN))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateViSurfaceNN
  :: FunPtr (Ptr Instance_T -> Ptr ViSurfaceCreateInfoNN -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr ViSurfaceCreateInfoNN -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result

-- | vkCreateViSurfaceNN - Create a 'Vulkan.Extensions.Handles.SurfaceKHR'
-- object for a VI layer
--
-- = Description
--
-- During the lifetime of a surface created using a particular
-- @nn@::@vi@::@NativeWindowHandle@, applications /must/ not attempt to
-- create another surface for the same @nn@::@vi@::@Layer@ or attempt to
-- connect to the same @nn@::@vi@::@Layer@ through other platform
-- mechanisms.
--
-- If the native window is created with a specified size, @currentExtent@
-- will reflect that size. In this case, applications should use the same
-- size for the swapchain’s @imageExtent@. Otherwise, the @currentExtent@
-- will have the special value (0xFFFFFFFF, 0xFFFFFFFF), indicating that
-- applications are expected to choose an appropriate size for the
-- swapchain’s @imageExtent@ (e.g., by matching the result of a call to
-- @nn@::@vi@::@GetDisplayResolution@).
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateViSurfaceNN-instance-parameter# @instance@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   #VUID-vkCreateViSurfaceNN-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'ViSurfaceCreateInfoNN'
--     structure
--
-- -   #VUID-vkCreateViSurfaceNN-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateViSurfaceNN-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'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_NATIVE_WINDOW_IN_USE_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NN_vi_surface VK_NN_vi_surface>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Instance',
-- 'Vulkan.Extensions.Handles.SurfaceKHR', 'ViSurfaceCreateInfoNN'
createViSurfaceNN :: forall io
                   . (MonadIO io)
                  => -- | @instance@ is the instance with which to associate the surface.
                     Instance
                  -> -- | @pCreateInfo@ is a pointer to a 'ViSurfaceCreateInfoNN' structure
                     -- containing parameters affecting the creation of the surface object.
                     ViSurfaceCreateInfoNN
                  -> -- | @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)
createViSurfaceNN :: forall (io :: * -> *).
MonadIO io =>
Instance
-> ViSurfaceCreateInfoNN
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createViSurfaceNN Instance
instance' ViSurfaceCreateInfoNN
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 vkCreateViSurfaceNNPtr :: FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateViSurfaceNNPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
pVkCreateViSurfaceNN (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 ViSurfaceCreateInfoNN)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateViSurfaceNNPtr 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 vkCreateViSurfaceNN is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateViSurfaceNN' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateViSurfaceNN' = FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateViSurfaceNN FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateViSurfaceNNPtr
  "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
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 (ViSurfaceCreateInfoNN
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
"vkCreateViSurfaceNN" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateViSurfaceNN'
                                                        (Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
                                                        "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
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)


-- | VkViSurfaceCreateInfoNN - Structure specifying parameters of a newly
-- created VI surface object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NN_vi_surface VK_NN_vi_surface>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'ViSurfaceCreateFlagsNN', 'createViSurfaceNN'
data ViSurfaceCreateInfoNN = ViSurfaceCreateInfoNN
  { -- | @flags@ is reserved for future use.
    --
    -- #VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask# @flags@ /must/ be @0@
    ViSurfaceCreateInfoNN -> ViSurfaceCreateFlagsNN
flags :: ViSurfaceCreateFlagsNN
  , -- | @window@ is the @nn@::@vi@::@NativeWindowHandle@ for the
    -- @nn@::@vi@::@Layer@ with which to associate the surface.
    --
    -- #VUID-VkViSurfaceCreateInfoNN-window-01318# @window@ /must/ be a valid
    -- @nn@::@vi@::@NativeWindowHandle@
    ViSurfaceCreateInfoNN -> Ptr ()
window :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ViSurfaceCreateInfoNN)
#endif
deriving instance Show ViSurfaceCreateInfoNN

instance ToCStruct ViSurfaceCreateInfoNN where
  withCStruct :: forall b.
ViSurfaceCreateInfoNN
-> (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN) -> IO b) -> IO b
withCStruct ViSurfaceCreateInfoNN
x ("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p ViSurfaceCreateInfoNN
x (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN) -> IO b
f "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p)
  pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN)
-> ViSurfaceCreateInfoNN -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p ViSurfaceCreateInfoNN{Ptr ()
ViSurfaceCreateFlagsNN
window :: Ptr ()
flags :: ViSurfaceCreateFlagsNN
$sel:window:ViSurfaceCreateInfoNN :: ViSurfaceCreateInfoNN -> Ptr ()
$sel:flags:ViSurfaceCreateInfoNN :: ViSurfaceCreateInfoNN -> ViSurfaceCreateFlagsNN
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
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 ViSurfaceCreateInfoNN
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ViSurfaceCreateFlagsNN)) (ViSurfaceCreateFlagsNN
flags)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (Ptr ()
window)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN) -> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ViSurfaceCreateInfoNN
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 ViSurfaceCreateInfoNN
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (forall a. Zero a => a
zero)
    IO b
f

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

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

instance Zero ViSurfaceCreateInfoNN where
  zero :: ViSurfaceCreateInfoNN
zero = ViSurfaceCreateFlagsNN -> Ptr () -> ViSurfaceCreateInfoNN
ViSurfaceCreateInfoNN
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkViSurfaceCreateFlagsNN - Reserved for future use
--
-- = Description
--
-- 'ViSurfaceCreateFlagsNN' 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_NN_vi_surface VK_NN_vi_surface>,
-- 'ViSurfaceCreateInfoNN'
newtype ViSurfaceCreateFlagsNN = ViSurfaceCreateFlagsNN Flags
  deriving newtype (ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c/= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
== :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c== :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
Eq, Eq ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Ordering
ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
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 :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$cmin :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
max :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$cmax :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
>= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c>= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
> :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c> :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
<= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c<= :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
< :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
$c< :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Bool
compare :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Ordering
$ccompare :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> Ordering
Ord, Ptr ViSurfaceCreateFlagsNN -> IO ViSurfaceCreateFlagsNN
Ptr ViSurfaceCreateFlagsNN -> Int -> IO ViSurfaceCreateFlagsNN
Ptr ViSurfaceCreateFlagsNN
-> Int -> ViSurfaceCreateFlagsNN -> IO ()
Ptr ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> IO ()
ViSurfaceCreateFlagsNN -> Int
forall b. Ptr b -> Int -> IO ViSurfaceCreateFlagsNN
forall b. Ptr b -> Int -> ViSurfaceCreateFlagsNN -> 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 ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> IO ()
$cpoke :: Ptr ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN -> IO ()
peek :: Ptr ViSurfaceCreateFlagsNN -> IO ViSurfaceCreateFlagsNN
$cpeek :: Ptr ViSurfaceCreateFlagsNN -> IO ViSurfaceCreateFlagsNN
pokeByteOff :: forall b. Ptr b -> Int -> ViSurfaceCreateFlagsNN -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ViSurfaceCreateFlagsNN -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO ViSurfaceCreateFlagsNN
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ViSurfaceCreateFlagsNN
pokeElemOff :: Ptr ViSurfaceCreateFlagsNN
-> Int -> ViSurfaceCreateFlagsNN -> IO ()
$cpokeElemOff :: Ptr ViSurfaceCreateFlagsNN
-> Int -> ViSurfaceCreateFlagsNN -> IO ()
peekElemOff :: Ptr ViSurfaceCreateFlagsNN -> Int -> IO ViSurfaceCreateFlagsNN
$cpeekElemOff :: Ptr ViSurfaceCreateFlagsNN -> Int -> IO ViSurfaceCreateFlagsNN
alignment :: ViSurfaceCreateFlagsNN -> Int
$calignment :: ViSurfaceCreateFlagsNN -> Int
sizeOf :: ViSurfaceCreateFlagsNN -> Int
$csizeOf :: ViSurfaceCreateFlagsNN -> Int
Storable, ViSurfaceCreateFlagsNN
forall a. a -> Zero a
zero :: ViSurfaceCreateFlagsNN
$czero :: ViSurfaceCreateFlagsNN
Zero, Eq ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN
Int -> ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN -> Bool
ViSurfaceCreateFlagsNN -> Int
ViSurfaceCreateFlagsNN -> Maybe Int
ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN -> Int -> Bool
ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
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 :: ViSurfaceCreateFlagsNN -> Int
$cpopCount :: ViSurfaceCreateFlagsNN -> Int
rotateR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$crotateR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
rotateL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$crotateL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
unsafeShiftR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cunsafeShiftR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
shiftR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cshiftR :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
unsafeShiftL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cunsafeShiftL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
shiftL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cshiftL :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
isSigned :: ViSurfaceCreateFlagsNN -> Bool
$cisSigned :: ViSurfaceCreateFlagsNN -> Bool
bitSize :: ViSurfaceCreateFlagsNN -> Int
$cbitSize :: ViSurfaceCreateFlagsNN -> Int
bitSizeMaybe :: ViSurfaceCreateFlagsNN -> Maybe Int
$cbitSizeMaybe :: ViSurfaceCreateFlagsNN -> Maybe Int
testBit :: ViSurfaceCreateFlagsNN -> Int -> Bool
$ctestBit :: ViSurfaceCreateFlagsNN -> Int -> Bool
complementBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$ccomplementBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
clearBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cclearBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
setBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$csetBit :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
bit :: Int -> ViSurfaceCreateFlagsNN
$cbit :: Int -> ViSurfaceCreateFlagsNN
zeroBits :: ViSurfaceCreateFlagsNN
$czeroBits :: ViSurfaceCreateFlagsNN
rotate :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$crotate :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
shift :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
$cshift :: ViSurfaceCreateFlagsNN -> Int -> ViSurfaceCreateFlagsNN
complement :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$ccomplement :: ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
xor :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$cxor :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
.|. :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$c.|. :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
.&. :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
$c.&. :: ViSurfaceCreateFlagsNN
-> ViSurfaceCreateFlagsNN -> ViSurfaceCreateFlagsNN
Bits, Bits ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: ViSurfaceCreateFlagsNN -> Int
$ccountTrailingZeros :: ViSurfaceCreateFlagsNN -> Int
countLeadingZeros :: ViSurfaceCreateFlagsNN -> Int
$ccountLeadingZeros :: ViSurfaceCreateFlagsNN -> Int
finiteBitSize :: ViSurfaceCreateFlagsNN -> Int
$cfiniteBitSize :: ViSurfaceCreateFlagsNN -> Int
FiniteBits)

conNameViSurfaceCreateFlagsNN :: String
conNameViSurfaceCreateFlagsNN :: String
conNameViSurfaceCreateFlagsNN = String
"ViSurfaceCreateFlagsNN"

enumPrefixViSurfaceCreateFlagsNN :: String
enumPrefixViSurfaceCreateFlagsNN :: String
enumPrefixViSurfaceCreateFlagsNN = String
""

showTableViSurfaceCreateFlagsNN :: [(ViSurfaceCreateFlagsNN, String)]
showTableViSurfaceCreateFlagsNN :: [(ViSurfaceCreateFlagsNN, String)]
showTableViSurfaceCreateFlagsNN = []

instance Show ViSurfaceCreateFlagsNN where
  showsPrec :: Int -> ViSurfaceCreateFlagsNN -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixViSurfaceCreateFlagsNN
      [(ViSurfaceCreateFlagsNN, String)]
showTableViSurfaceCreateFlagsNN
      String
conNameViSurfaceCreateFlagsNN
      (\(ViSurfaceCreateFlagsNN 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 ViSurfaceCreateFlagsNN where
  readPrec :: ReadPrec ViSurfaceCreateFlagsNN
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixViSurfaceCreateFlagsNN
      [(ViSurfaceCreateFlagsNN, String)]
showTableViSurfaceCreateFlagsNN
      String
conNameViSurfaceCreateFlagsNN
      Flags -> ViSurfaceCreateFlagsNN
ViSurfaceCreateFlagsNN

type NN_VI_SURFACE_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_NN_VI_SURFACE_SPEC_VERSION"
pattern NN_VI_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bNN_VI_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mNN_VI_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NN_VI_SURFACE_SPEC_VERSION = 1


type NN_VI_SURFACE_EXTENSION_NAME = "VK_NN_vi_surface"

-- No documentation found for TopLevel "VK_NN_VI_SURFACE_EXTENSION_NAME"
pattern NN_VI_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNN_VI_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNN_VI_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NN_VI_SURFACE_EXTENSION_NAME = "VK_NN_vi_surface"