{-# language CPP #-}
-- | = Name
--
-- VK_EXT_metal_objects - device extension
--
-- == VK_EXT_metal_objects
--
-- [__Name String__]
--     @VK_EXT_metal_objects@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     312
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__; __Contact__]
--
--     -   Bill Hollings
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_metal_objects] @billhollings%0A*Here describe the issue or question you have about the VK_EXT_metal_objects extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_EXT_metal_objects.adoc VK_EXT_metal_objects>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-05-28
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Bill Hollings, The Brenwill Workshop Ltd.
--
--     -   Dzmitry Malyshau, Mozilla Corp.
--
-- == Description
--
-- In a Vulkan implementation that is layered on top of Metal on Apple
-- device platforms, this extension provides the ability to import and
-- export the underlying Metal objects associated with specific Vulkan
-- objects.
--
-- As detailed in the
-- <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_EXT_metal_objects.adoc extension proposal document>,
-- this extension adds one new Vulkan command, 'exportMetalObjectsEXT', to
-- export underlying Metal objects from Vulkan objects, and supports
-- importing the appropriate existing Metal objects when creating Vulkan
-- objects of types 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.Handles.Image', 'Vulkan.Core10.Handles.Semaphore', and
-- 'Vulkan.Core10.Handles.Event',
--
-- The intent is that this extension will be advertised and supported only
-- on implementations that are layered on top of Metal on Apple device
-- platforms.
--
-- == New Base Types
--
-- -   'IOSurfaceRef'
--
-- -   'MTLBuffer_id'
--
-- -   'MTLCommandQueue_id'
--
-- -   'MTLDevice_id'
--
-- -   'MTLSharedEvent_id'
--
-- -   'MTLTexture_id'
--
-- == New Commands
--
-- -   'exportMetalObjectsEXT'
--
-- == New Structures
--
-- -   'ExportMetalObjectsInfoEXT'
--
-- -   Extending 'ExportMetalObjectsInfoEXT':
--
--     -   'ExportMetalBufferInfoEXT'
--
--     -   'ExportMetalCommandQueueInfoEXT'
--
--     -   'ExportMetalDeviceInfoEXT'
--
--     -   'ExportMetalIOSurfaceInfoEXT'
--
--     -   'ExportMetalSharedEventInfoEXT'
--
--     -   'ExportMetalTextureInfoEXT'
--
-- -   Extending 'Vulkan.Core10.Image.ImageCreateInfo':
--
--     -   'ImportMetalIOSurfaceInfoEXT'
--
--     -   'ImportMetalTextureInfoEXT'
--
-- -   Extending 'Vulkan.Core10.DeviceInitialization.InstanceCreateInfo',
--     'Vulkan.Core10.Memory.MemoryAllocateInfo',
--     'Vulkan.Core10.Image.ImageCreateInfo',
--     'Vulkan.Core10.ImageView.ImageViewCreateInfo',
--     'Vulkan.Core10.BufferView.BufferViewCreateInfo',
--     'Vulkan.Core10.QueueSemaphore.SemaphoreCreateInfo',
--     'Vulkan.Core10.Event.EventCreateInfo':
--
--     -   'ExportMetalObjectCreateInfoEXT'
--
-- -   Extending 'Vulkan.Core10.Memory.MemoryAllocateInfo':
--
--     -   'ImportMetalBufferInfoEXT'
--
-- -   Extending 'Vulkan.Core10.QueueSemaphore.SemaphoreCreateInfo',
--     'Vulkan.Core10.Event.EventCreateInfo':
--
--     -   'ImportMetalSharedEventInfoEXT'
--
-- == New Enums
--
-- -   'ExportMetalObjectTypeFlagBitsEXT'
--
-- == New Bitmasks
--
-- -   'ExportMetalObjectTypeFlagsEXT'
--
-- == New Enum Constants
--
-- -   'EXT_METAL_OBJECTS_EXTENSION_NAME'
--
-- -   'EXT_METAL_OBJECTS_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT'
--
-- == Issues
--
-- None.
--
-- == Version History
--
-- -   Revision 1, 2022-05-28 (Bill Hollings)
--
--     -   Initial draft.
--
--     -   Incorporated feedback from review by the Vulkan Working Group.
--         Renamed many structures, moved import\/export of MTLBuffer to
--         VkDeviceMemory, added export of MTLSharedEvent, added import of
--         MTLSharedEvent for VkSemaphore and VkEvent, and changed used bit
--         mask fields to individual bit fields to simplify Valid Usage
--         rules.
--
-- == See Also
--
-- 'IOSurfaceRef', 'MTLBuffer_id', 'MTLCommandQueue_id', 'MTLDevice_id',
-- 'MTLSharedEvent_id', 'MTLTexture_id', 'ExportMetalBufferInfoEXT',
-- 'ExportMetalCommandQueueInfoEXT', 'ExportMetalDeviceInfoEXT',
-- 'ExportMetalIOSurfaceInfoEXT', 'ExportMetalObjectCreateInfoEXT',
-- 'ExportMetalObjectTypeFlagBitsEXT', 'ExportMetalObjectTypeFlagsEXT',
-- 'ExportMetalObjectsInfoEXT', 'ExportMetalSharedEventInfoEXT',
-- 'ExportMetalTextureInfoEXT', 'ImportMetalBufferInfoEXT',
-- 'ImportMetalIOSurfaceInfoEXT', 'ImportMetalSharedEventInfoEXT',
-- 'ImportMetalTextureInfoEXT', 'exportMetalObjectsEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_metal_objects 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_metal_objects  ( exportMetalObjectsEXT
                                               , ExportMetalObjectCreateInfoEXT(..)
                                               , ExportMetalObjectsInfoEXT(..)
                                               , ExportMetalDeviceInfoEXT(..)
                                               , ExportMetalCommandQueueInfoEXT(..)
                                               , ExportMetalBufferInfoEXT(..)
                                               , ImportMetalBufferInfoEXT(..)
                                               , ExportMetalTextureInfoEXT(..)
                                               , ImportMetalTextureInfoEXT(..)
                                               , ExportMetalIOSurfaceInfoEXT(..)
                                               , ImportMetalIOSurfaceInfoEXT(..)
                                               , ExportMetalSharedEventInfoEXT(..)
                                               , ImportMetalSharedEventInfoEXT(..)
                                               , ExportMetalObjectTypeFlagsEXT
                                               , ExportMetalObjectTypeFlagBitsEXT( EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT
                                                                                 , EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT
                                                                                 , EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT
                                                                                 , EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT
                                                                                 , EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT
                                                                                 , EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT
                                                                                 , ..
                                                                                 )
                                               , EXT_METAL_OBJECTS_SPEC_VERSION
                                               , pattern EXT_METAL_OBJECTS_SPEC_VERSION
                                               , EXT_METAL_OBJECTS_EXTENSION_NAME
                                               , pattern EXT_METAL_OBJECTS_EXTENSION_NAME
                                               , MTLDevice_id
                                               , MTLCommandQueue_id
                                               , MTLBuffer_id
                                               , MTLTexture_id
                                               , IOSurfaceRef
                                               , MTLSharedEvent_id
                                               ) 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.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.Core10.Handles (BufferView)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkExportMetalObjectsEXT))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Handles (Event)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits)
import Vulkan.Core10.Handles (ImageView)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Handles (Queue_T)
import Vulkan.Core10.Handles (Semaphore)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkExportMetalObjectsEXT
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct ExportMetalObjectsInfoEXT) -> IO ()) -> Ptr Device_T -> Ptr (SomeStruct ExportMetalObjectsInfoEXT) -> IO ()

-- | vkExportMetalObjectsEXT - Export Metal objects from the corresponding
-- Vulkan objects
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.Device', 'ExportMetalObjectsInfoEXT'
exportMetalObjectsEXT :: forall a io
                       . ( Extendss ExportMetalObjectsInfoEXT a
                         , PokeChain a
                         , PeekChain a
                         , MonadIO io )
                      => -- | @device@ is the device that created the Vulkan objects.
                         --
                         -- #VUID-vkExportMetalObjectsEXT-device-parameter# @device@ /must/ be a
                         -- valid 'Vulkan.Core10.Handles.Device' handle
                         Device
                      -> io (ExportMetalObjectsInfoEXT a)
exportMetalObjectsEXT :: forall (a :: [*]) (io :: * -> *).
(Extendss ExportMetalObjectsInfoEXT a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device -> io (ExportMetalObjectsInfoEXT a)
exportMetalObjectsEXT Device
device = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkExportMetalObjectsEXTPtr :: FunPtr
  (Ptr Device_T
   -> ("pMetalObjectsInfo"
       ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
   -> IO ())
vkExportMetalObjectsEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pMetalObjectsInfo"
          ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
      -> IO ())
pVkExportMetalObjectsEXT (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pMetalObjectsInfo"
       ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
   -> IO ())
vkExportMetalObjectsEXTPtr 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 vkExportMetalObjectsEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkExportMetalObjectsEXT' :: Ptr Device_T
-> ("pMetalObjectsInfo"
    ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
-> IO ()
vkExportMetalObjectsEXT' = FunPtr
  (Ptr Device_T
   -> ("pMetalObjectsInfo"
       ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
   -> IO ())
-> Ptr Device_T
-> ("pMetalObjectsInfo"
    ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
-> IO ()
mkVkExportMetalObjectsEXT FunPtr
  (Ptr Device_T
   -> ("pMetalObjectsInfo"
       ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
   -> IO ())
vkExportMetalObjectsEXTPtr
  Ptr (ExportMetalObjectsInfoEXT a)
pPMetalObjectsInfo <- 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 @(ExportMetalObjectsInfoEXT _))
  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
"vkExportMetalObjectsEXT" (Ptr Device_T
-> ("pMetalObjectsInfo"
    ::: Ptr (SomeStruct ExportMetalObjectsInfoEXT))
-> IO ()
vkExportMetalObjectsEXT'
                                                       (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                       (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ExportMetalObjectsInfoEXT a)
pPMetalObjectsInfo)))
  ExportMetalObjectsInfoEXT a
pMetalObjectsInfo <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(ExportMetalObjectsInfoEXT _) Ptr (ExportMetalObjectsInfoEXT a)
pPMetalObjectsInfo
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (ExportMetalObjectsInfoEXT a
pMetalObjectsInfo)


-- | VkExportMetalObjectCreateInfoEXT - Structure that identifies the Metal
-- objects that can be exported from Vulkan objects
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkExportMetalObjectCreateInfoEXT-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT'
--
-- -   #VUID-VkExportMetalObjectCreateInfoEXT-exportObjectType-parameter#
--     If @exportObjectType@ is not @0@, @exportObjectType@ /must/ be a
--     valid 'ExportMetalObjectTypeFlagBitsEXT' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'ExportMetalObjectTypeFlagBitsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalObjectCreateInfoEXT = ExportMetalObjectCreateInfoEXT
  { -- | @exportObjectType@ is a 'ExportMetalObjectTypeFlagBitsEXT' indicating
    -- the type of Metal object that the application may request to be exported
    -- from the Vulkan object.
    ExportMetalObjectCreateInfoEXT -> ExportMetalObjectTypeFlagBitsEXT
exportObjectType :: ExportMetalObjectTypeFlagBitsEXT }
  deriving (Typeable, ExportMetalObjectCreateInfoEXT
-> ExportMetalObjectCreateInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalObjectCreateInfoEXT
-> ExportMetalObjectCreateInfoEXT -> Bool
$c/= :: ExportMetalObjectCreateInfoEXT
-> ExportMetalObjectCreateInfoEXT -> Bool
== :: ExportMetalObjectCreateInfoEXT
-> ExportMetalObjectCreateInfoEXT -> Bool
$c== :: ExportMetalObjectCreateInfoEXT
-> ExportMetalObjectCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalObjectCreateInfoEXT)
#endif
deriving instance Show ExportMetalObjectCreateInfoEXT

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

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

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

instance Zero ExportMetalObjectCreateInfoEXT where
  zero :: ExportMetalObjectCreateInfoEXT
zero = ExportMetalObjectTypeFlagBitsEXT -> ExportMetalObjectCreateInfoEXT
ExportMetalObjectCreateInfoEXT
           forall a. Zero a => a
zero


-- | VkExportMetalObjectsInfoEXT - Structure whose pNext chain identifies
-- Vulkan objects and corresponding Metal objects
--
-- == Valid Usage
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06791# If the @pNext@ chain
--     includes a 'ExportMetalDeviceInfoEXT' structure, the
--     'Vulkan.Core10.Handles.Instance' /must/ have been created with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.DeviceInitialization.InstanceCreateInfo' structure in
--     the 'Vulkan.Core10.DeviceInitialization.createInstance' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06792# If the @pNext@ chain
--     includes a 'ExportMetalCommandQueueInfoEXT' structure, the
--     'Vulkan.Core10.Handles.Instance' /must/ have been created with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.DeviceInitialization.InstanceCreateInfo' structure in
--     the 'Vulkan.Core10.DeviceInitialization.createInstance' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06793# If the @pNext@ chain
--     includes a 'ExportMetalBufferInfoEXT' structure, the
--     'Vulkan.Core10.Handles.DeviceMemory' in its @memory@ member /must/
--     have been allocated with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.Memory.MemoryAllocateInfo' structure in the
--     'Vulkan.Core10.Memory.allocateMemory' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06794# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, exactly one of its
--     @image@, @imageView@, or @bufferView@ members /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06795# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and its @image@
--     member is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', the
--     'Vulkan.Core10.Handles.Image' in its @image@ member /must/ have been
--     created with 'EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.Image.ImageCreateInfo' structure in the
--     'Vulkan.Core10.Image.createImage' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06796# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and its
--     @imageView@ member is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     the 'Vulkan.Core10.Handles.ImageView' in its @imageView@ member
--     /must/ have been created with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.ImageView.ImageViewCreateInfo' structure in the
--     'Vulkan.Core10.ImageView.createImageView' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06797# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and its
--     @bufferView@ member is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     the 'Vulkan.Core10.Handles.BufferView' in its @bufferView@ member
--     /must/ have been created with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.BufferView.BufferViewCreateInfo' structure in the
--     'Vulkan.Core10.BufferView.createBufferView' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06798# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and if either its
--     @image@ or @imageView@ member is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', then @plane@ /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT',
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT',
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06799# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and if the
--     'Vulkan.Core10.Handles.Image' in its @image@ member does not have a
--     multi-planar format, then its @plane@ member /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06800# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and if the
--     'Vulkan.Core10.Handles.Image' in its @image@ member has a
--     multi-planar format with only two planes, then its @plane@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06801# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and if the
--     'Vulkan.Core10.Handles.ImageView' in its @imageView@ member does not
--     have a multi-planar format, then its @plane@ member /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06802# If the @pNext@ chain
--     includes a 'ExportMetalTextureInfoEXT' structure, and if the
--     'Vulkan.Core10.Handles.ImageView' in its @imageView@ member has a
--     multi-planar format with only two planes, then its @plane@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06803# If the @pNext@ chain
--     includes a 'ExportMetalIOSurfaceInfoEXT' structure, the
--     'Vulkan.Core10.Handles.Image' in its @image@ member /must/ have been
--     created with 'EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT' in
--     the @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.Image.ImageCreateInfo' structure in the
--     'Vulkan.Core10.Image.createImage' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06804# If the @pNext@ chain
--     includes a 'ExportMetalSharedEventInfoEXT' structure, exactly one of
--     its @semaphore@ or @event@ members /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06805# If the @pNext@ chain
--     includes a 'ExportMetalSharedEventInfoEXT' structure, and its
--     @semaphore@ member is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     the 'Vulkan.Core10.Handles.Semaphore' in its @semaphore@ member
--     /must/ have been created with
--     'EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT' in the
--     @exportObjectType@ member of a 'ExportMetalObjectCreateInfoEXT'
--     structure in the @pNext@ chain of the
--     'Vulkan.Core10.QueueSemaphore.SemaphoreCreateInfo' structure in the
--     'Vulkan.Core10.QueueSemaphore.createSemaphore' command
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-06806# If the @pNext@ chain
--     includes a 'ExportMetalSharedEventInfoEXT' structure, and its
--     @event@ member is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', the
--     'Vulkan.Core10.Handles.Event' in its @event@ member /must/ have been
--     created with 'EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT'
--     in the @exportObjectType@ member of a
--     'ExportMetalObjectCreateInfoEXT' structure in the @pNext@ chain of
--     the 'Vulkan.Core10.Event.EventCreateInfo' structure in the
--     'Vulkan.Core10.Event.createEvent' command
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-pNext-pNext# Each @pNext@ member
--     of any structure (including this one) in the @pNext@ chain /must/ be
--     either @NULL@ or a pointer to a valid instance of
--     'ExportMetalBufferInfoEXT', 'ExportMetalCommandQueueInfoEXT',
--     'ExportMetalDeviceInfoEXT', 'ExportMetalIOSurfaceInfoEXT',
--     'ExportMetalSharedEventInfoEXT', or 'ExportMetalTextureInfoEXT'
--
-- -   #VUID-VkExportMetalObjectsInfoEXT-sType-unique# The @sType@ value of
--     each struct in the @pNext@ chain /must/ be unique, with the
--     exception of structures of type 'ExportMetalBufferInfoEXT',
--     'ExportMetalCommandQueueInfoEXT', 'ExportMetalIOSurfaceInfoEXT',
--     'ExportMetalSharedEventInfoEXT', or 'ExportMetalTextureInfoEXT'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'exportMetalObjectsEXT'
data ExportMetalObjectsInfoEXT (es :: [Type]) = ExportMetalObjectsInfoEXT
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). ExportMetalObjectsInfoEXT es -> Chain es
next :: Chain es }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalObjectsInfoEXT (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ExportMetalObjectsInfoEXT es)

instance Extensible ExportMetalObjectsInfoEXT where
  extensibleTypeName :: String
extensibleTypeName = String
"ExportMetalObjectsInfoEXT"
  setNext :: forall (ds :: [*]) (es :: [*]).
ExportMetalObjectsInfoEXT ds
-> Chain es -> ExportMetalObjectsInfoEXT es
setNext ExportMetalObjectsInfoEXT ds
_ Chain es
next' = ExportMetalObjectsInfoEXT{$sel:next:ExportMetalObjectsInfoEXT :: Chain es
next = Chain es
next'}
  getNext :: forall (es :: [*]). ExportMetalObjectsInfoEXT es -> Chain es
getNext ExportMetalObjectsInfoEXT{Chain es
next :: Chain es
$sel:next:ExportMetalObjectsInfoEXT :: forall (es :: [*]). ExportMetalObjectsInfoEXT es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends ExportMetalObjectsInfoEXT e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends ExportMetalObjectsInfoEXT e => b) -> Maybe b
extends proxy e
_ Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalSharedEventInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalSharedEventInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalIOSurfaceInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalIOSurfaceInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalTextureInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalTextureInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalBufferInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalBufferInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalCommandQueueInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalCommandQueueInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Just e :~: ExportMetalDeviceInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExportMetalDeviceInfoEXT = forall a. a -> Maybe a
Just Extends ExportMetalObjectsInfoEXT e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss ExportMetalObjectsInfoEXT es
         , PokeChain es ) => ToCStruct (ExportMetalObjectsInfoEXT es) where
  withCStruct :: forall b.
ExportMetalObjectsInfoEXT es
-> (Ptr (ExportMetalObjectsInfoEXT es) -> IO b) -> IO b
withCStruct ExportMetalObjectsInfoEXT es
x Ptr (ExportMetalObjectsInfoEXT es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr (ExportMetalObjectsInfoEXT es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ExportMetalObjectsInfoEXT es)
p ExportMetalObjectsInfoEXT es
x (Ptr (ExportMetalObjectsInfoEXT es) -> IO b
f Ptr (ExportMetalObjectsInfoEXT es)
p)
  pokeCStruct :: forall b.
Ptr (ExportMetalObjectsInfoEXT es)
-> ExportMetalObjectsInfoEXT es -> IO b -> IO b
pokeCStruct Ptr (ExportMetalObjectsInfoEXT es)
p ExportMetalObjectsInfoEXT{Chain es
next :: Chain es
$sel:next:ExportMetalObjectsInfoEXT :: forall (es :: [*]). ExportMetalObjectsInfoEXT es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ExportMetalObjectsInfoEXT es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT)
    Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ExportMetalObjectsInfoEXT es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
16
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (ExportMetalObjectsInfoEXT es) -> IO b -> IO b
pokeZeroCStruct Ptr (ExportMetalObjectsInfoEXT es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ExportMetalObjectsInfoEXT es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT)
    Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ExportMetalObjectsInfoEXT es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss ExportMetalObjectsInfoEXT es
         , PeekChain es ) => FromCStruct (ExportMetalObjectsInfoEXT es) where
  peekCStruct :: Ptr (ExportMetalObjectsInfoEXT es)
-> IO (ExportMetalObjectsInfoEXT es)
peekCStruct Ptr (ExportMetalObjectsInfoEXT es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ExportMetalObjectsInfoEXT es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]). Chain es -> ExportMetalObjectsInfoEXT es
ExportMetalObjectsInfoEXT
             Chain es
next

instance es ~ '[] => Zero (ExportMetalObjectsInfoEXT es) where
  zero :: ExportMetalObjectsInfoEXT es
zero = forall (es :: [*]). Chain es -> ExportMetalObjectsInfoEXT es
ExportMetalObjectsInfoEXT
           ()


-- | VkExportMetalDeviceInfoEXT - Structure that identifies a VkDevice object
-- and corresponding Metal MTLDevice object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalDeviceInfoEXT = ExportMetalDeviceInfoEXT
  { -- | @mtlDevice@ is the Metal @id\<MTLDevice>@ object underlying the
    -- 'Vulkan.Core10.Handles.PhysicalDevice' associated with the
    -- 'Vulkan.Core10.Handles.Device' object identified in the call. The
    -- implementation will return the @MTLDevice@ in this member, or it will
    -- return @NULL@ if no @MTLDevice@ could be found underlying the
    -- 'Vulkan.Core10.Handles.PhysicalDevice' object.
    ExportMetalDeviceInfoEXT -> Ptr ()
mtlDevice :: MTLDevice_id }
  deriving (Typeable, ExportMetalDeviceInfoEXT -> ExportMetalDeviceInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalDeviceInfoEXT -> ExportMetalDeviceInfoEXT -> Bool
$c/= :: ExportMetalDeviceInfoEXT -> ExportMetalDeviceInfoEXT -> Bool
== :: ExportMetalDeviceInfoEXT -> ExportMetalDeviceInfoEXT -> Bool
$c== :: ExportMetalDeviceInfoEXT -> ExportMetalDeviceInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalDeviceInfoEXT)
#endif
deriving instance Show ExportMetalDeviceInfoEXT

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

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

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

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


-- | VkExportMetalCommandQueueInfoEXT - Structure that identifies a VkQueue
-- object and corresponding Metal MTLCommandQueue object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.Queue',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalCommandQueueInfoEXT = ExportMetalCommandQueueInfoEXT
  { -- | @queue@ is a 'Vulkan.Core10.Handles.Queue'.
    --
    -- #VUID-VkExportMetalCommandQueueInfoEXT-queue-parameter# @queue@ /must/
    -- be a valid 'Vulkan.Core10.Handles.Queue' handle
    ExportMetalCommandQueueInfoEXT -> Ptr Queue_T
queue :: Ptr Queue_T
  , -- | @mtlCommandQueue@ is the Metal @id\<MTLCommandQueue>@ object underlying
    -- the 'Vulkan.Core10.Handles.Queue' object in @queue@. The implementation
    -- will return the @MTLCommandQueue@ in this member, or it will return
    -- @NULL@ if no @MTLCommandQueue@ could be found underlying the
    -- 'Vulkan.Core10.Handles.Queue' object.
    ExportMetalCommandQueueInfoEXT -> Ptr ()
mtlCommandQueue :: MTLCommandQueue_id
  }
  deriving (Typeable, ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> Bool
$c/= :: ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> Bool
== :: ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> Bool
$c== :: ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalCommandQueueInfoEXT)
#endif
deriving instance Show ExportMetalCommandQueueInfoEXT

instance ToCStruct ExportMetalCommandQueueInfoEXT where
  withCStruct :: forall b.
ExportMetalCommandQueueInfoEXT
-> (Ptr ExportMetalCommandQueueInfoEXT -> IO b) -> IO b
withCStruct ExportMetalCommandQueueInfoEXT
x Ptr ExportMetalCommandQueueInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMetalCommandQueueInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMetalCommandQueueInfoEXT
p ExportMetalCommandQueueInfoEXT
x (Ptr ExportMetalCommandQueueInfoEXT -> IO b
f Ptr ExportMetalCommandQueueInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ExportMetalCommandQueueInfoEXT
-> ExportMetalCommandQueueInfoEXT -> IO b -> IO b
pokeCStruct Ptr ExportMetalCommandQueueInfoEXT
p ExportMetalCommandQueueInfoEXT{Ptr ()
Ptr Queue_T
mtlCommandQueue :: Ptr ()
queue :: Ptr Queue_T
$sel:mtlCommandQueue:ExportMetalCommandQueueInfoEXT :: ExportMetalCommandQueueInfoEXT -> Ptr ()
$sel:queue:ExportMetalCommandQueueInfoEXT :: ExportMetalCommandQueueInfoEXT -> Ptr Queue_T
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Queue_T))) (Ptr Queue_T
queue)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLCommandQueue_id)) (Ptr ()
mtlCommandQueue)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExportMetalCommandQueueInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ExportMetalCommandQueueInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Queue_T))) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLCommandQueue_id)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExportMetalCommandQueueInfoEXT where
  peekCStruct :: Ptr ExportMetalCommandQueueInfoEXT
-> IO ExportMetalCommandQueueInfoEXT
peekCStruct Ptr ExportMetalCommandQueueInfoEXT
p = do
    Ptr Queue_T
queue <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Queue_T) ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Queue_T)))
    Ptr ()
mtlCommandQueue <- forall a. Storable a => Ptr a -> IO a
peek @MTLCommandQueue_id ((Ptr ExportMetalCommandQueueInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLCommandQueue_id))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Queue_T -> Ptr () -> ExportMetalCommandQueueInfoEXT
ExportMetalCommandQueueInfoEXT
             Ptr Queue_T
queue Ptr ()
mtlCommandQueue

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

instance Zero ExportMetalCommandQueueInfoEXT where
  zero :: ExportMetalCommandQueueInfoEXT
zero = Ptr Queue_T -> Ptr () -> ExportMetalCommandQueueInfoEXT
ExportMetalCommandQueueInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkExportMetalBufferInfoEXT - Structure that identifies a VkDeviceMemory
-- object and corresponding Metal MTLBuffer object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalBufferInfoEXT = ExportMetalBufferInfoEXT
  { -- | @memory@ is a 'Vulkan.Core10.Handles.DeviceMemory'.
    --
    -- #VUID-VkExportMetalBufferInfoEXT-memory-parameter# @memory@ /must/ be a
    -- valid 'Vulkan.Core10.Handles.DeviceMemory' handle
    ExportMetalBufferInfoEXT -> DeviceMemory
memory :: DeviceMemory
  , -- | @mtlBuffer@ is the Metal @id\<MTLBuffer>@ object underlying the
    -- 'Vulkan.Core10.Handles.DeviceMemory' object in @memory@. The
    -- implementation will return the @MTLBuffer@ in this member, or it will
    -- return @NULL@ if no @MTLBuffer@ could be found underlying the
    -- 'Vulkan.Core10.Handles.DeviceMemory' object.
    ExportMetalBufferInfoEXT -> Ptr ()
mtlBuffer :: MTLBuffer_id
  }
  deriving (Typeable, ExportMetalBufferInfoEXT -> ExportMetalBufferInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalBufferInfoEXT -> ExportMetalBufferInfoEXT -> Bool
$c/= :: ExportMetalBufferInfoEXT -> ExportMetalBufferInfoEXT -> Bool
== :: ExportMetalBufferInfoEXT -> ExportMetalBufferInfoEXT -> Bool
$c== :: ExportMetalBufferInfoEXT -> ExportMetalBufferInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalBufferInfoEXT)
#endif
deriving instance Show ExportMetalBufferInfoEXT

instance ToCStruct ExportMetalBufferInfoEXT where
  withCStruct :: forall b.
ExportMetalBufferInfoEXT
-> (Ptr ExportMetalBufferInfoEXT -> IO b) -> IO b
withCStruct ExportMetalBufferInfoEXT
x Ptr ExportMetalBufferInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMetalBufferInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMetalBufferInfoEXT
p ExportMetalBufferInfoEXT
x (Ptr ExportMetalBufferInfoEXT -> IO b
f Ptr ExportMetalBufferInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ExportMetalBufferInfoEXT
-> ExportMetalBufferInfoEXT -> IO b -> IO b
pokeCStruct Ptr ExportMetalBufferInfoEXT
p ExportMetalBufferInfoEXT{Ptr ()
DeviceMemory
mtlBuffer :: Ptr ()
memory :: DeviceMemory
$sel:mtlBuffer:ExportMetalBufferInfoEXT :: ExportMetalBufferInfoEXT -> Ptr ()
$sel:memory:ExportMetalBufferInfoEXT :: ExportMetalBufferInfoEXT -> DeviceMemory
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceMemory)) (DeviceMemory
memory)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLBuffer_id)) (Ptr ()
mtlBuffer)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExportMetalBufferInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ExportMetalBufferInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceMemory)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLBuffer_id)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExportMetalBufferInfoEXT where
  peekCStruct :: Ptr ExportMetalBufferInfoEXT -> IO ExportMetalBufferInfoEXT
peekCStruct Ptr ExportMetalBufferInfoEXT
p = do
    DeviceMemory
memory <- forall a. Storable a => Ptr a -> IO a
peek @DeviceMemory ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceMemory))
    Ptr ()
mtlBuffer <- forall a. Storable a => Ptr a -> IO a
peek @MTLBuffer_id ((Ptr ExportMetalBufferInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLBuffer_id))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceMemory -> Ptr () -> ExportMetalBufferInfoEXT
ExportMetalBufferInfoEXT
             DeviceMemory
memory Ptr ()
mtlBuffer

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

instance Zero ExportMetalBufferInfoEXT where
  zero :: ExportMetalBufferInfoEXT
zero = DeviceMemory -> Ptr () -> ExportMetalBufferInfoEXT
ExportMetalBufferInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkImportMetalBufferInfoEXT - Structure that identifies a Metal MTLBuffer
-- object to use when creating a VkDeviceMemory object.
--
-- = Description
--
-- The app /must/ ensure that the configuration of the @id\<MTLBuffer>@
-- object is compatible with the configuration of the
-- 'Vulkan.Core10.Handles.DeviceMemory'. Failure to do so results in
-- undefined behavior.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportMetalBufferInfoEXT = ImportMetalBufferInfoEXT
  { -- | @mtlBuffer@ is the Metal @id\<MTLBuffer>@ object that is to underlie the
    -- 'Vulkan.Core10.Handles.DeviceMemory'.
    ImportMetalBufferInfoEXT -> Ptr ()
mtlBuffer :: MTLBuffer_id }
  deriving (Typeable, ImportMetalBufferInfoEXT -> ImportMetalBufferInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMetalBufferInfoEXT -> ImportMetalBufferInfoEXT -> Bool
$c/= :: ImportMetalBufferInfoEXT -> ImportMetalBufferInfoEXT -> Bool
== :: ImportMetalBufferInfoEXT -> ImportMetalBufferInfoEXT -> Bool
$c== :: ImportMetalBufferInfoEXT -> ImportMetalBufferInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMetalBufferInfoEXT)
#endif
deriving instance Show ImportMetalBufferInfoEXT

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

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

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

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


-- | VkExportMetalTextureInfoEXT - Structure that identifies a VkImage,
-- VkImageView, or VkBufferView object and corresponding Metal MTLTexture
-- object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkExportMetalTextureInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT'
--
-- -   #VUID-VkExportMetalTextureInfoEXT-image-parameter# If @image@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @image@ /must/ be a valid
--     'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkExportMetalTextureInfoEXT-imageView-parameter# If
--     @imageView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @imageView@ /must/ be a valid 'Vulkan.Core10.Handles.ImageView'
--     handle
--
-- -   #VUID-VkExportMetalTextureInfoEXT-bufferView-parameter# If
--     @bufferView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @bufferView@ /must/ be a valid 'Vulkan.Core10.Handles.BufferView'
--     handle
--
-- -   #VUID-VkExportMetalTextureInfoEXT-plane-parameter# @plane@ /must/ be
--     a valid
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits' value
--
-- -   #VUID-VkExportMetalTextureInfoEXT-commonparent# Each of
--     @bufferView@, @image@, and @imageView@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.BufferView', 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits',
-- 'Vulkan.Core10.Handles.ImageView',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalTextureInfoEXT = ExportMetalTextureInfoEXT
  { -- | @image@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.Image'.
    ExportMetalTextureInfoEXT -> Image
image :: Image
  , -- | @imageView@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.ImageView'.
    ExportMetalTextureInfoEXT -> ImageView
imageView :: ImageView
  , -- | @bufferView@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.BufferView'.
    ExportMetalTextureInfoEXT -> BufferView
bufferView :: BufferView
  , -- | @plane@ indicates the plane of a multi-planar
    -- 'Vulkan.Core10.Handles.Image' or 'Vulkan.Core10.Handles.ImageView'.
    ExportMetalTextureInfoEXT -> ImageAspectFlagBits
plane :: ImageAspectFlagBits
  , -- | @mtlTexture@ is the Metal @id\<MTLTexture>@ object underlying the
    -- 'Vulkan.Core10.Handles.Image', 'Vulkan.Core10.Handles.ImageView', or
    -- 'Vulkan.Core10.Handles.BufferView' object in @image@, @imageView@, or
    -- @bufferView@, respectively, at the plane indicated in @aspectMask@. The
    -- implementation will return the @MTLTexture@ in this member, or it will
    -- return @NULL@ if no @MTLTexture@ could be found underlying the
    -- 'Vulkan.Core10.Handles.Image', 'Vulkan.Core10.Handles.ImageView', or
    -- 'Vulkan.Core10.Handles.BufferView' object, at the plane indicated in
    -- @aspectMask@.
    ExportMetalTextureInfoEXT -> Ptr ()
mtlTexture :: MTLTexture_id
  }
  deriving (Typeable, ExportMetalTextureInfoEXT -> ExportMetalTextureInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalTextureInfoEXT -> ExportMetalTextureInfoEXT -> Bool
$c/= :: ExportMetalTextureInfoEXT -> ExportMetalTextureInfoEXT -> Bool
== :: ExportMetalTextureInfoEXT -> ExportMetalTextureInfoEXT -> Bool
$c== :: ExportMetalTextureInfoEXT -> ExportMetalTextureInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalTextureInfoEXT)
#endif
deriving instance Show ExportMetalTextureInfoEXT

instance ToCStruct ExportMetalTextureInfoEXT where
  withCStruct :: forall b.
ExportMetalTextureInfoEXT
-> (Ptr ExportMetalTextureInfoEXT -> IO b) -> IO b
withCStruct ExportMetalTextureInfoEXT
x Ptr ExportMetalTextureInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMetalTextureInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMetalTextureInfoEXT
p ExportMetalTextureInfoEXT
x (Ptr ExportMetalTextureInfoEXT -> IO b
f Ptr ExportMetalTextureInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ExportMetalTextureInfoEXT
-> ExportMetalTextureInfoEXT -> IO b -> IO b
pokeCStruct Ptr ExportMetalTextureInfoEXT
p ExportMetalTextureInfoEXT{Ptr ()
ImageAspectFlagBits
ImageView
Image
BufferView
mtlTexture :: Ptr ()
plane :: ImageAspectFlagBits
bufferView :: BufferView
imageView :: ImageView
image :: Image
$sel:mtlTexture:ExportMetalTextureInfoEXT :: ExportMetalTextureInfoEXT -> Ptr ()
$sel:plane:ExportMetalTextureInfoEXT :: ExportMetalTextureInfoEXT -> ImageAspectFlagBits
$sel:bufferView:ExportMetalTextureInfoEXT :: ExportMetalTextureInfoEXT -> BufferView
$sel:imageView:ExportMetalTextureInfoEXT :: ExportMetalTextureInfoEXT -> ImageView
$sel:image:ExportMetalTextureInfoEXT :: ExportMetalTextureInfoEXT -> Image
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
image)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageView)) (ImageView
imageView)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr BufferView)) (BufferView
bufferView)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
plane)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr MTLTexture_id)) (Ptr ()
mtlTexture)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExportMetalTextureInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ExportMetalTextureInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageAspectFlagBits)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr MTLTexture_id)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExportMetalTextureInfoEXT where
  peekCStruct :: Ptr ExportMetalTextureInfoEXT -> IO ExportMetalTextureInfoEXT
peekCStruct Ptr ExportMetalTextureInfoEXT
p = do
    Image
image <- forall a. Storable a => Ptr a -> IO a
peek @Image ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
    ImageView
imageView <- forall a. Storable a => Ptr a -> IO a
peek @ImageView ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageView))
    BufferView
bufferView <- forall a. Storable a => Ptr a -> IO a
peek @BufferView ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr BufferView))
    ImageAspectFlagBits
plane <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageAspectFlagBits))
    Ptr ()
mtlTexture <- forall a. Storable a => Ptr a -> IO a
peek @MTLTexture_id ((Ptr ExportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr MTLTexture_id))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Image
-> ImageView
-> BufferView
-> ImageAspectFlagBits
-> Ptr ()
-> ExportMetalTextureInfoEXT
ExportMetalTextureInfoEXT
             Image
image ImageView
imageView BufferView
bufferView ImageAspectFlagBits
plane Ptr ()
mtlTexture

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

instance Zero ExportMetalTextureInfoEXT where
  zero :: ExportMetalTextureInfoEXT
zero = Image
-> ImageView
-> BufferView
-> ImageAspectFlagBits
-> Ptr ()
-> ExportMetalTextureInfoEXT
ExportMetalTextureInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkImportMetalTextureInfoEXT - Structure that identifies Metal MTLTexture
-- objects to use when creating a VkImage.
--
-- = Description
--
-- The @pNext@ chain /must/ include one 'ImportMetalTextureInfoEXT'
-- structure for each plane in the 'Vulkan.Core10.Handles.Image'. The app
-- /must/ ensure that the configuration of the Metal @id\<MTLTexture>@
-- objects are compatible with the configuration of the
-- 'Vulkan.Core10.Handles.Image'. Failure to do so results in undefined
-- behavior.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportMetalTextureInfoEXT = ImportMetalTextureInfoEXT
  { -- | @plane@ indicates the plane of the 'Vulkan.Core10.Handles.Image' that
    -- the @id\<MTLTexture>@ object should be attached to.
    --
    -- #VUID-VkImportMetalTextureInfoEXT-plane-parameter# @plane@ /must/ be a
    -- valid 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits'
    -- value
    ImportMetalTextureInfoEXT -> ImageAspectFlagBits
plane :: ImageAspectFlagBits
  , -- | @mtlTexture@ is a the Metal @id\<MTLTexture>@ object that is to underlie
    -- the 'Vulkan.Core10.Handles.Image' plane.
    ImportMetalTextureInfoEXT -> Ptr ()
mtlTexture :: MTLTexture_id
  }
  deriving (Typeable, ImportMetalTextureInfoEXT -> ImportMetalTextureInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMetalTextureInfoEXT -> ImportMetalTextureInfoEXT -> Bool
$c/= :: ImportMetalTextureInfoEXT -> ImportMetalTextureInfoEXT -> Bool
== :: ImportMetalTextureInfoEXT -> ImportMetalTextureInfoEXT -> Bool
$c== :: ImportMetalTextureInfoEXT -> ImportMetalTextureInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMetalTextureInfoEXT)
#endif
deriving instance Show ImportMetalTextureInfoEXT

instance ToCStruct ImportMetalTextureInfoEXT where
  withCStruct :: forall b.
ImportMetalTextureInfoEXT
-> (Ptr ImportMetalTextureInfoEXT -> IO b) -> IO b
withCStruct ImportMetalTextureInfoEXT
x Ptr ImportMetalTextureInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ImportMetalTextureInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMetalTextureInfoEXT
p ImportMetalTextureInfoEXT
x (Ptr ImportMetalTextureInfoEXT -> IO b
f Ptr ImportMetalTextureInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ImportMetalTextureInfoEXT
-> ImportMetalTextureInfoEXT -> IO b -> IO b
pokeCStruct Ptr ImportMetalTextureInfoEXT
p ImportMetalTextureInfoEXT{Ptr ()
ImageAspectFlagBits
mtlTexture :: Ptr ()
plane :: ImageAspectFlagBits
$sel:mtlTexture:ImportMetalTextureInfoEXT :: ImportMetalTextureInfoEXT -> Ptr ()
$sel:plane:ImportMetalTextureInfoEXT :: ImportMetalTextureInfoEXT -> ImageAspectFlagBits
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
plane)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLTexture_id)) (Ptr ()
mtlTexture)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ImportMetalTextureInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ImportMetalTextureInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLTexture_id)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImportMetalTextureInfoEXT where
  peekCStruct :: Ptr ImportMetalTextureInfoEXT -> IO ImportMetalTextureInfoEXT
peekCStruct Ptr ImportMetalTextureInfoEXT
p = do
    ImageAspectFlagBits
plane <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits))
    Ptr ()
mtlTexture <- forall a. Storable a => Ptr a -> IO a
peek @MTLTexture_id ((Ptr ImportMetalTextureInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr MTLTexture_id))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageAspectFlagBits -> Ptr () -> ImportMetalTextureInfoEXT
ImportMetalTextureInfoEXT
             ImageAspectFlagBits
plane Ptr ()
mtlTexture

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

instance Zero ImportMetalTextureInfoEXT where
  zero :: ImportMetalTextureInfoEXT
zero = ImageAspectFlagBits -> Ptr () -> ImportMetalTextureInfoEXT
ImportMetalTextureInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkExportMetalIOSurfaceInfoEXT - Structure that identifies a VkImage
-- object and corresponding Metal IOSurfaceRef object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalIOSurfaceInfoEXT = ExportMetalIOSurfaceInfoEXT
  { -- | @image@ is a 'Vulkan.Core10.Handles.Image'.
    --
    -- #VUID-VkExportMetalIOSurfaceInfoEXT-image-parameter# @image@ /must/ be a
    -- valid 'Vulkan.Core10.Handles.Image' handle
    ExportMetalIOSurfaceInfoEXT -> Image
image :: Image
  , -- | @ioSurface@ is the Metal 'IOSurfaceRef' object underlying the
    -- 'Vulkan.Core10.Handles.Image' object in @image@. The implementation will
    -- return the 'IOSurfaceRef' in this member, or it will return @NULL@ if no
    -- 'IOSurfaceRef' could be found underlying the
    -- 'Vulkan.Core10.Handles.Image' object.
    ExportMetalIOSurfaceInfoEXT -> Ptr ()
ioSurface :: IOSurfaceRef
  }
  deriving (Typeable, ExportMetalIOSurfaceInfoEXT -> ExportMetalIOSurfaceInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalIOSurfaceInfoEXT -> ExportMetalIOSurfaceInfoEXT -> Bool
$c/= :: ExportMetalIOSurfaceInfoEXT -> ExportMetalIOSurfaceInfoEXT -> Bool
== :: ExportMetalIOSurfaceInfoEXT -> ExportMetalIOSurfaceInfoEXT -> Bool
$c== :: ExportMetalIOSurfaceInfoEXT -> ExportMetalIOSurfaceInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalIOSurfaceInfoEXT)
#endif
deriving instance Show ExportMetalIOSurfaceInfoEXT

instance ToCStruct ExportMetalIOSurfaceInfoEXT where
  withCStruct :: forall b.
ExportMetalIOSurfaceInfoEXT
-> (Ptr ExportMetalIOSurfaceInfoEXT -> IO b) -> IO b
withCStruct ExportMetalIOSurfaceInfoEXT
x Ptr ExportMetalIOSurfaceInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMetalIOSurfaceInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMetalIOSurfaceInfoEXT
p ExportMetalIOSurfaceInfoEXT
x (Ptr ExportMetalIOSurfaceInfoEXT -> IO b
f Ptr ExportMetalIOSurfaceInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ExportMetalIOSurfaceInfoEXT
-> ExportMetalIOSurfaceInfoEXT -> IO b -> IO b
pokeCStruct Ptr ExportMetalIOSurfaceInfoEXT
p ExportMetalIOSurfaceInfoEXT{Ptr ()
Image
ioSurface :: Ptr ()
image :: Image
$sel:ioSurface:ExportMetalIOSurfaceInfoEXT :: ExportMetalIOSurfaceInfoEXT -> Ptr ()
$sel:image:ExportMetalIOSurfaceInfoEXT :: ExportMetalIOSurfaceInfoEXT -> Image
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
image)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr IOSurfaceRef)) (Ptr ()
ioSurface)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExportMetalIOSurfaceInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ExportMetalIOSurfaceInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr IOSurfaceRef)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExportMetalIOSurfaceInfoEXT where
  peekCStruct :: Ptr ExportMetalIOSurfaceInfoEXT -> IO ExportMetalIOSurfaceInfoEXT
peekCStruct Ptr ExportMetalIOSurfaceInfoEXT
p = do
    Image
image <- forall a. Storable a => Ptr a -> IO a
peek @Image ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
    Ptr ()
ioSurface <- forall a. Storable a => Ptr a -> IO a
peek @IOSurfaceRef ((Ptr ExportMetalIOSurfaceInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr IOSurfaceRef))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Image -> Ptr () -> ExportMetalIOSurfaceInfoEXT
ExportMetalIOSurfaceInfoEXT
             Image
image Ptr ()
ioSurface

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

instance Zero ExportMetalIOSurfaceInfoEXT where
  zero :: ExportMetalIOSurfaceInfoEXT
zero = Image -> Ptr () -> ExportMetalIOSurfaceInfoEXT
ExportMetalIOSurfaceInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkImportMetalIOSurfaceInfoEXT - Structure that identifies a VkImage
-- object and corresponding Metal IOSurfaceRef object to use.
--
-- = Description
--
-- If @ioSurface@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', it will
-- be used to underlie the 'Vulkan.Core10.Handles.Image'. If @ioSurface@ is
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE', the implementation will create
-- a new @IOSurface@ to underlie the 'Vulkan.Core10.Handles.Image'.
--
-- If provided, the app /must/ ensure that the configuration of the
-- 'IOSurfaceRef' object is compatible with the configuration of the
-- 'Vulkan.Core10.Handles.Image'. Failure to do so results in undefined
-- behavior.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportMetalIOSurfaceInfoEXT = ImportMetalIOSurfaceInfoEXT
  { -- | @ioSurface@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or the Metal
    -- 'IOSurfaceRef' object that is to underlie the
    -- 'Vulkan.Core10.Handles.Image'.
    ImportMetalIOSurfaceInfoEXT -> Ptr ()
ioSurface :: IOSurfaceRef }
  deriving (Typeable, ImportMetalIOSurfaceInfoEXT -> ImportMetalIOSurfaceInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMetalIOSurfaceInfoEXT -> ImportMetalIOSurfaceInfoEXT -> Bool
$c/= :: ImportMetalIOSurfaceInfoEXT -> ImportMetalIOSurfaceInfoEXT -> Bool
== :: ImportMetalIOSurfaceInfoEXT -> ImportMetalIOSurfaceInfoEXT -> Bool
$c== :: ImportMetalIOSurfaceInfoEXT -> ImportMetalIOSurfaceInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMetalIOSurfaceInfoEXT)
#endif
deriving instance Show ImportMetalIOSurfaceInfoEXT

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

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

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

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


-- | VkExportMetalSharedEventInfoEXT - Structure that identifies a
-- VkSemaphore or VkEvent object and corresponding Metal MTLSharedEvent
-- object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkExportMetalSharedEventInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT'
--
-- -   #VUID-VkExportMetalSharedEventInfoEXT-semaphore-parameter# If
--     @semaphore@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @semaphore@ /must/ be a valid 'Vulkan.Core10.Handles.Semaphore'
--     handle
--
-- -   #VUID-VkExportMetalSharedEventInfoEXT-event-parameter# If @event@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @event@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Event' handle
--
-- -   #VUID-VkExportMetalSharedEventInfoEXT-commonparent# Both of @event@,
--     and @semaphore@ that are valid handles of non-ignored parameters
--     /must/ have been created, allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Handles.Event', 'Vulkan.Core10.Handles.Semaphore',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExportMetalSharedEventInfoEXT = ExportMetalSharedEventInfoEXT
  { -- | @semaphore@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.Semaphore'.
    ExportMetalSharedEventInfoEXT -> Semaphore
semaphore :: Semaphore
  , -- | @event@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.Event'.
    ExportMetalSharedEventInfoEXT -> Event
event :: Event
  , -- | @mtlSharedEvent@ is the Metal @id\<MTLSharedEvent>@ object underlying
    -- the 'Vulkan.Core10.Handles.Semaphore' or 'Vulkan.Core10.Handles.Event'
    -- object in @semaphore@ or @event@, respectively. The implementation will
    -- return the @MTLSharedEvent@ in this member, or it will return @NULL@ if
    -- no @MTLSharedEvent@ could be found underlying the
    -- 'Vulkan.Core10.Handles.Semaphore' or 'Vulkan.Core10.Handles.Event'
    -- object.
    ExportMetalSharedEventInfoEXT -> Ptr ()
mtlSharedEvent :: MTLSharedEvent_id
  }
  deriving (Typeable, ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> Bool
$c/= :: ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> Bool
== :: ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> Bool
$c== :: ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMetalSharedEventInfoEXT)
#endif
deriving instance Show ExportMetalSharedEventInfoEXT

instance ToCStruct ExportMetalSharedEventInfoEXT where
  withCStruct :: forall b.
ExportMetalSharedEventInfoEXT
-> (Ptr ExportMetalSharedEventInfoEXT -> IO b) -> IO b
withCStruct ExportMetalSharedEventInfoEXT
x Ptr ExportMetalSharedEventInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMetalSharedEventInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMetalSharedEventInfoEXT
p ExportMetalSharedEventInfoEXT
x (Ptr ExportMetalSharedEventInfoEXT -> IO b
f Ptr ExportMetalSharedEventInfoEXT
p)
  pokeCStruct :: forall b.
Ptr ExportMetalSharedEventInfoEXT
-> ExportMetalSharedEventInfoEXT -> IO b -> IO b
pokeCStruct Ptr ExportMetalSharedEventInfoEXT
p ExportMetalSharedEventInfoEXT{Ptr ()
Semaphore
Event
mtlSharedEvent :: Ptr ()
event :: Event
semaphore :: Semaphore
$sel:mtlSharedEvent:ExportMetalSharedEventInfoEXT :: ExportMetalSharedEventInfoEXT -> Ptr ()
$sel:event:ExportMetalSharedEventInfoEXT :: ExportMetalSharedEventInfoEXT -> Event
$sel:semaphore:ExportMetalSharedEventInfoEXT :: ExportMetalSharedEventInfoEXT -> Semaphore
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
semaphore)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Event)) (Event
event)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr MTLSharedEvent_id)) (Ptr ()
mtlSharedEvent)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ExportMetalSharedEventInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ExportMetalSharedEventInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr MTLSharedEvent_id)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ExportMetalSharedEventInfoEXT where
  peekCStruct :: Ptr ExportMetalSharedEventInfoEXT
-> IO ExportMetalSharedEventInfoEXT
peekCStruct Ptr ExportMetalSharedEventInfoEXT
p = do
    Semaphore
semaphore <- forall a. Storable a => Ptr a -> IO a
peek @Semaphore ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore))
    Event
event <- forall a. Storable a => Ptr a -> IO a
peek @Event ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Event))
    Ptr ()
mtlSharedEvent <- forall a. Storable a => Ptr a -> IO a
peek @MTLSharedEvent_id ((Ptr ExportMetalSharedEventInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr MTLSharedEvent_id))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Semaphore -> Event -> Ptr () -> ExportMetalSharedEventInfoEXT
ExportMetalSharedEventInfoEXT
             Semaphore
semaphore Event
event Ptr ()
mtlSharedEvent

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

instance Zero ExportMetalSharedEventInfoEXT where
  zero :: ExportMetalSharedEventInfoEXT
zero = Semaphore -> Event -> Ptr () -> ExportMetalSharedEventInfoEXT
ExportMetalSharedEventInfoEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkImportMetalSharedEventInfoEXT - Structure that identifies a
-- VkSemaphore or VkEvent object and corresponding Metal Shared Event
-- object to use.
--
-- = Description
--
-- If the @pNext@ chain of the
-- 'Vulkan.Core10.QueueSemaphore.SemaphoreCreateInfo' structure includes
-- both 'ImportMetalSharedEventInfoEXT' and
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.SemaphoreTypeCreateInfo',
-- the @signaledValue@ property of the imported @id\<MTLSharedEvent>@
-- object will be set to @initialValue@ of
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.SemaphoreTypeCreateInfo'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportMetalSharedEventInfoEXT = ImportMetalSharedEventInfoEXT
  { -- | @mtlSharedEvent@ is the Metal @id\<MTLSharedEvent>@ object that is to
    -- underlie the 'Vulkan.Core10.Handles.Semaphore' or
    -- 'Vulkan.Core10.Handles.Event'.
    ImportMetalSharedEventInfoEXT -> Ptr ()
mtlSharedEvent :: MTLSharedEvent_id }
  deriving (Typeable, ImportMetalSharedEventInfoEXT
-> ImportMetalSharedEventInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMetalSharedEventInfoEXT
-> ImportMetalSharedEventInfoEXT -> Bool
$c/= :: ImportMetalSharedEventInfoEXT
-> ImportMetalSharedEventInfoEXT -> Bool
== :: ImportMetalSharedEventInfoEXT
-> ImportMetalSharedEventInfoEXT -> Bool
$c== :: ImportMetalSharedEventInfoEXT
-> ImportMetalSharedEventInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMetalSharedEventInfoEXT)
#endif
deriving instance Show ImportMetalSharedEventInfoEXT

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

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

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

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


type ExportMetalObjectTypeFlagsEXT = ExportMetalObjectTypeFlagBitsEXT

-- | VkExportMetalObjectTypeFlagBitsEXT - Bitmask specifying Metal object
-- types that can be exported from a Vulkan object
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_metal_objects VK_EXT_metal_objects>,
-- 'ExportMetalObjectCreateInfoEXT', 'ExportMetalObjectTypeFlagsEXT'
newtype ExportMetalObjectTypeFlagBitsEXT = ExportMetalObjectTypeFlagBitsEXT Flags
  deriving newtype (ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c/= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
== :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c== :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
Eq, Eq ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Ordering
ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
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 :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$cmin :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
max :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$cmax :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
>= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c>= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
> :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c> :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
<= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c<= :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
< :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
$c< :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Bool
compare :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Ordering
$ccompare :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> Ordering
Ord, Ptr ExportMetalObjectTypeFlagBitsEXT
-> IO ExportMetalObjectTypeFlagBitsEXT
Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> IO ExportMetalObjectTypeFlagBitsEXT
Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT -> IO ()
Ptr ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> IO ()
ExportMetalObjectTypeFlagBitsEXT -> Int
forall b. Ptr b -> Int -> IO ExportMetalObjectTypeFlagBitsEXT
forall b. Ptr b -> Int -> ExportMetalObjectTypeFlagBitsEXT -> 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 ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> IO ()
$cpoke :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT -> IO ()
peek :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> IO ExportMetalObjectTypeFlagBitsEXT
$cpeek :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> IO ExportMetalObjectTypeFlagBitsEXT
pokeByteOff :: forall b. Ptr b -> Int -> ExportMetalObjectTypeFlagBitsEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ExportMetalObjectTypeFlagBitsEXT -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO ExportMetalObjectTypeFlagBitsEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ExportMetalObjectTypeFlagBitsEXT
pokeElemOff :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT -> IO ()
$cpokeElemOff :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT -> IO ()
peekElemOff :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> IO ExportMetalObjectTypeFlagBitsEXT
$cpeekElemOff :: Ptr ExportMetalObjectTypeFlagBitsEXT
-> Int -> IO ExportMetalObjectTypeFlagBitsEXT
alignment :: ExportMetalObjectTypeFlagBitsEXT -> Int
$calignment :: ExportMetalObjectTypeFlagBitsEXT -> Int
sizeOf :: ExportMetalObjectTypeFlagBitsEXT -> Int
$csizeOf :: ExportMetalObjectTypeFlagBitsEXT -> Int
Storable, ExportMetalObjectTypeFlagBitsEXT
forall a. a -> Zero a
zero :: ExportMetalObjectTypeFlagBitsEXT
$czero :: ExportMetalObjectTypeFlagBitsEXT
Zero, Eq ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT
Int -> ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT -> Bool
ExportMetalObjectTypeFlagBitsEXT -> Int
ExportMetalObjectTypeFlagBitsEXT -> Maybe Int
ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT -> Int -> Bool
ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
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 :: ExportMetalObjectTypeFlagBitsEXT -> Int
$cpopCount :: ExportMetalObjectTypeFlagBitsEXT -> Int
rotateR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$crotateR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
rotateL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$crotateL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
unsafeShiftR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cunsafeShiftR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
shiftR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cshiftR :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
unsafeShiftL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cunsafeShiftL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
shiftL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cshiftL :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
isSigned :: ExportMetalObjectTypeFlagBitsEXT -> Bool
$cisSigned :: ExportMetalObjectTypeFlagBitsEXT -> Bool
bitSize :: ExportMetalObjectTypeFlagBitsEXT -> Int
$cbitSize :: ExportMetalObjectTypeFlagBitsEXT -> Int
bitSizeMaybe :: ExportMetalObjectTypeFlagBitsEXT -> Maybe Int
$cbitSizeMaybe :: ExportMetalObjectTypeFlagBitsEXT -> Maybe Int
testBit :: ExportMetalObjectTypeFlagBitsEXT -> Int -> Bool
$ctestBit :: ExportMetalObjectTypeFlagBitsEXT -> Int -> Bool
complementBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$ccomplementBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
clearBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cclearBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
setBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$csetBit :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
bit :: Int -> ExportMetalObjectTypeFlagBitsEXT
$cbit :: Int -> ExportMetalObjectTypeFlagBitsEXT
zeroBits :: ExportMetalObjectTypeFlagBitsEXT
$czeroBits :: ExportMetalObjectTypeFlagBitsEXT
rotate :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$crotate :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
shift :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
$cshift :: ExportMetalObjectTypeFlagBitsEXT
-> Int -> ExportMetalObjectTypeFlagBitsEXT
complement :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$ccomplement :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
xor :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$cxor :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
.|. :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$c.|. :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
.&. :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
$c.&. :: ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
-> ExportMetalObjectTypeFlagBitsEXT
Bits, Bits ExportMetalObjectTypeFlagBitsEXT
ExportMetalObjectTypeFlagBitsEXT -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: ExportMetalObjectTypeFlagBitsEXT -> Int
$ccountTrailingZeros :: ExportMetalObjectTypeFlagBitsEXT -> Int
countLeadingZeros :: ExportMetalObjectTypeFlagBitsEXT -> Int
$ccountLeadingZeros :: ExportMetalObjectTypeFlagBitsEXT -> Int
finiteBitSize :: ExportMetalObjectTypeFlagBitsEXT -> Int
$cfiniteBitSize :: ExportMetalObjectTypeFlagBitsEXT -> Int
FiniteBits)

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT' indicates a Metal
-- @MTLDevice@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000001

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT' indicates a Metal
-- @MTLCommandQueue@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000002

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT' indicates a Metal
-- @MTLBuffer@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000004

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT' indicates a Metal
-- @MTLTexture@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000008

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT' indicates a Metal
-- @IOSurface@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000010

-- | 'EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT' indicates a Metal
-- @MTLSharedEvent@ may be exported.
pattern $bEXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT :: ExportMetalObjectTypeFlagBitsEXT
$mEXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT :: forall {r}.
ExportMetalObjectTypeFlagBitsEXT
-> ((# #) -> r) -> ((# #) -> r) -> r
EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = ExportMetalObjectTypeFlagBitsEXT 0x00000020

conNameExportMetalObjectTypeFlagBitsEXT :: String
conNameExportMetalObjectTypeFlagBitsEXT :: String
conNameExportMetalObjectTypeFlagBitsEXT = String
"ExportMetalObjectTypeFlagBitsEXT"

enumPrefixExportMetalObjectTypeFlagBitsEXT :: String
enumPrefixExportMetalObjectTypeFlagBitsEXT :: String
enumPrefixExportMetalObjectTypeFlagBitsEXT = String
"EXPORT_METAL_OBJECT_TYPE_METAL_"

showTableExportMetalObjectTypeFlagBitsEXT :: [(ExportMetalObjectTypeFlagBitsEXT, String)]
showTableExportMetalObjectTypeFlagBitsEXT :: [(ExportMetalObjectTypeFlagBitsEXT, String)]
showTableExportMetalObjectTypeFlagBitsEXT =
  [
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT
    , String
"DEVICE_BIT_EXT"
    )
  ,
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT
    , String
"COMMAND_QUEUE_BIT_EXT"
    )
  ,
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT
    , String
"BUFFER_BIT_EXT"
    )
  ,
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT
    , String
"TEXTURE_BIT_EXT"
    )
  ,
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT
    , String
"IOSURFACE_BIT_EXT"
    )
  ,
    ( ExportMetalObjectTypeFlagBitsEXT
EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT
    , String
"SHARED_EVENT_BIT_EXT"
    )
  ]

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

type EXT_METAL_OBJECTS_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_METAL_OBJECTS_SPEC_VERSION"
pattern EXT_METAL_OBJECTS_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_METAL_OBJECTS_SPEC_VERSION :: forall a. Integral a => a
$mEXT_METAL_OBJECTS_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_METAL_OBJECTS_SPEC_VERSION = 1


type EXT_METAL_OBJECTS_EXTENSION_NAME = "VK_EXT_metal_objects"

-- No documentation found for TopLevel "VK_EXT_METAL_OBJECTS_EXTENSION_NAME"
pattern EXT_METAL_OBJECTS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_METAL_OBJECTS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_METAL_OBJECTS_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_METAL_OBJECTS_EXTENSION_NAME = "VK_EXT_metal_objects"


type MTLDevice_id = Ptr ()


type MTLCommandQueue_id = Ptr ()


type MTLBuffer_id = Ptr ()


type MTLTexture_id = Ptr ()


type IOSurfaceRef = Ptr ()


type MTLSharedEvent_id = Ptr ()