{-# language CPP #-}
-- | = Name
--
-- VK_EXT_private_data - device extension
--
-- == VK_EXT_private_data
--
-- [__Name String__]
--     @VK_EXT_private_data@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     296
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
-- [__Contact__]
--
--     -   Matthew Rusch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_EXT_private_data:%20&body=@mattruschnv%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2020-03-25
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Matthew Rusch, NVIDIA
--
--     -   Nuno Subtil, NVIDIA
--
--     -   Piers Daniell, NVIDIA
--
--     -   Jeff Bolz, NVIDIA
--
-- == Description
--
-- The \'VK_EXT_private_data\' extension is a device extension which
-- enables attaching arbitrary payloads to Vulkan objects. It introduces
-- the idea of private data slots as a means of storing a 64-bit unsigned
-- integer of application defined data. Private data slots can be created
-- or destroyed any time an associated device is available. Private data
-- slots can be reserved at device creation time, and limiting use to the
-- amount reserved will allow the extension to exhibit better performance
-- characteristics.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.PrivateDataSlotEXT'
--
-- == New Commands
--
-- -   'createPrivateDataSlotEXT'
--
-- -   'destroyPrivateDataSlotEXT'
--
-- -   'getPrivateDataEXT'
--
-- -   'setPrivateDataEXT'
--
-- == New Structures
--
-- -   'PrivateDataSlotCreateInfoEXT'
--
-- -   Extending 'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'DevicePrivateDataCreateInfoEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDevicePrivateDataFeaturesEXT'
--
-- == New Enums
--
-- -   'PrivateDataSlotCreateFlagBitsEXT'
--
-- == New Bitmasks
--
-- -   'PrivateDataSlotCreateFlagsEXT'
--
-- == New Enum Constants
--
-- -   'EXT_PRIVATE_DATA_EXTENSION_NAME'
--
-- -   'EXT_PRIVATE_DATA_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT'
--
-- == Examples
--
-- -   In progress
--
-- == Version History
--
-- -   Revision 1, 2020-01-15 (Matthew Rusch)
--
--     -   Initial draft
--
-- = See Also
--
-- 'DevicePrivateDataCreateInfoEXT',
-- 'PhysicalDevicePrivateDataFeaturesEXT',
-- 'PrivateDataSlotCreateFlagBitsEXT', 'PrivateDataSlotCreateFlagsEXT',
-- 'PrivateDataSlotCreateInfoEXT',
-- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT',
-- 'createPrivateDataSlotEXT', 'destroyPrivateDataSlotEXT',
-- 'getPrivateDataEXT', 'setPrivateDataEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_private_data 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_private_data  ( createPrivateDataSlotEXT
                                              , withPrivateDataSlotEXT
                                              , destroyPrivateDataSlotEXT
                                              , setPrivateDataEXT
                                              , getPrivateDataEXT
                                              , DevicePrivateDataCreateInfoEXT(..)
                                              , PrivateDataSlotCreateInfoEXT(..)
                                              , PhysicalDevicePrivateDataFeaturesEXT(..)
                                              , PrivateDataSlotCreateFlagsEXT
                                              , PrivateDataSlotCreateFlagBitsEXT(..)
                                              , EXT_PRIVATE_DATA_SPEC_VERSION
                                              , pattern EXT_PRIVATE_DATA_SPEC_VERSION
                                              , EXT_PRIVATE_DATA_EXTENSION_NAME
                                              , pattern EXT_PRIVATE_DATA_EXTENSION_NAME
                                              , PrivateDataSlotEXT(..)
                                              ) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Dynamic (DeviceCmds(pVkCreatePrivateDataSlotEXT))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyPrivateDataSlotEXT))
import Vulkan.Dynamic (DeviceCmds(pVkGetPrivateDataEXT))
import Vulkan.Dynamic (DeviceCmds(pVkSetPrivateDataEXT))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.ObjectType (ObjectType)
import Vulkan.Core10.Enums.ObjectType (ObjectType(..))
import Vulkan.Extensions.Handles (PrivateDataSlotEXT)
import Vulkan.Extensions.Handles (PrivateDataSlotEXT(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (PrivateDataSlotEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreatePrivateDataSlotEXT
  :: FunPtr (Ptr Device_T -> Ptr PrivateDataSlotCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr PrivateDataSlotEXT -> IO Result) -> Ptr Device_T -> Ptr PrivateDataSlotCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr PrivateDataSlotEXT -> IO Result

-- | vkCreatePrivateDataSlotEXT - Create a slot for private data storage
--
-- == Valid Usage
--
-- -   #VUID-vkCreatePrivateDataSlotEXT-privateData-04564# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-privateData privateData>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreatePrivateDataSlotEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreatePrivateDataSlotEXT-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'PrivateDataSlotCreateInfoEXT' structure
--
-- -   #VUID-vkCreatePrivateDataSlotEXT-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreatePrivateDataSlotEXT-pPrivateDataSlot-parameter#
--     @pPrivateDataSlot@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.PrivateDataSlotEXT' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'PrivateDataSlotCreateInfoEXT',
-- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT'
createPrivateDataSlotEXT :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device associated with the creation of the
                            -- object(s) holding the private data slot.
                            Device
                         -> -- | @pCreateInfo@ is a pointer to a 'PrivateDataSlotCreateInfoEXT'
                            PrivateDataSlotCreateInfoEXT
                         -> -- | @pAllocator@ controls host memory allocation as described in the
                            -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                            -- chapter.
                            ("allocator" ::: Maybe AllocationCallbacks)
                         -> io (PrivateDataSlotEXT)
createPrivateDataSlotEXT :: Device
-> PrivateDataSlotCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io PrivateDataSlotEXT
createPrivateDataSlotEXT device :: Device
device createInfo :: PrivateDataSlotCreateInfoEXT
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO PrivateDataSlotEXT -> io PrivateDataSlotEXT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PrivateDataSlotEXT -> io PrivateDataSlotEXT)
-> (ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
    -> IO PrivateDataSlotEXT)
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
-> io PrivateDataSlotEXT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
-> IO PrivateDataSlotEXT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
 -> io PrivateDataSlotEXT)
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
-> io PrivateDataSlotEXT
forall a b. (a -> b) -> a -> b
$ do
  let vkCreatePrivateDataSlotEXTPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
vkCreatePrivateDataSlotEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
      -> IO Result)
pVkCreatePrivateDataSlotEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT PrivateDataSlotEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT PrivateDataSlotEXT IO ())
-> IO () -> ContT PrivateDataSlotEXT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
vkCreatePrivateDataSlotEXTPtr FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreatePrivateDataSlotEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreatePrivateDataSlotEXT' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
-> IO Result
vkCreatePrivateDataSlotEXT' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
-> IO Result
mkVkCreatePrivateDataSlotEXT FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO Result)
vkCreatePrivateDataSlotEXTPtr
  "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
pCreateInfo <- ((("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
  -> IO PrivateDataSlotEXT)
 -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT
     IO
     ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
   -> IO PrivateDataSlotEXT)
  -> IO PrivateDataSlotEXT)
 -> ContT
      PrivateDataSlotEXT
      IO
      ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT))
-> ((("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
     -> IO PrivateDataSlotEXT)
    -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT
     IO
     ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
forall a b. (a -> b) -> a -> b
$ PrivateDataSlotCreateInfoEXT
-> (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
    -> IO PrivateDataSlotEXT)
-> IO PrivateDataSlotEXT
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PrivateDataSlotCreateInfoEXT
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
     PrivateDataSlotEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
  -> IO PrivateDataSlotEXT)
 -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO PrivateDataSlotEXT)
  -> IO PrivateDataSlotEXT)
 -> ContT
      PrivateDataSlotEXT IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
     -> IO PrivateDataSlotEXT)
    -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
    -> IO PrivateDataSlotEXT)
-> IO PrivateDataSlotEXT
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT
pPPrivateDataSlot <- ((("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
  -> IO PrivateDataSlotEXT)
 -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT
     IO
     ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
   -> IO PrivateDataSlotEXT)
  -> IO PrivateDataSlotEXT)
 -> ContT
      PrivateDataSlotEXT
      IO
      ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT))
-> ((("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
     -> IO PrivateDataSlotEXT)
    -> IO PrivateDataSlotEXT)
-> ContT
     PrivateDataSlotEXT
     IO
     ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
forall a b. (a -> b) -> a -> b
$ IO ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
-> (("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT) -> IO ())
-> (("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
    -> IO PrivateDataSlotEXT)
-> IO PrivateDataSlotEXT
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
forall a. Int -> IO (Ptr a)
callocBytes @PrivateDataSlotEXT 8) ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT PrivateDataSlotEXT IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT PrivateDataSlotEXT IO Result)
-> IO Result -> ContT PrivateDataSlotEXT IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreatePrivateDataSlotEXT" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
-> IO Result
vkCreatePrivateDataSlotEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT
pPPrivateDataSlot))
  IO () -> ContT PrivateDataSlotEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT PrivateDataSlotEXT IO ())
-> IO () -> ContT PrivateDataSlotEXT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  PrivateDataSlotEXT
pPrivateDataSlot <- IO PrivateDataSlotEXT
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO PrivateDataSlotEXT
 -> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT)
-> IO PrivateDataSlotEXT
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
forall a b. (a -> b) -> a -> b
$ ("pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT)
-> IO PrivateDataSlotEXT
forall a. Storable a => Ptr a -> IO a
peek @PrivateDataSlotEXT "pPrivateDataSlot" ::: Ptr PrivateDataSlotEXT
pPPrivateDataSlot
  PrivateDataSlotEXT
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PrivateDataSlotEXT
 -> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT)
-> PrivateDataSlotEXT
-> ContT PrivateDataSlotEXT IO PrivateDataSlotEXT
forall a b. (a -> b) -> a -> b
$ (PrivateDataSlotEXT
pPrivateDataSlot)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createPrivateDataSlotEXT' and 'destroyPrivateDataSlotEXT'
--
-- To ensure that 'destroyPrivateDataSlotEXT' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withPrivateDataSlotEXT :: forall io r . MonadIO io => Device -> PrivateDataSlotCreateInfoEXT -> Maybe AllocationCallbacks -> (io PrivateDataSlotEXT -> (PrivateDataSlotEXT -> io ()) -> r) -> r
withPrivateDataSlotEXT :: Device
-> PrivateDataSlotCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io PrivateDataSlotEXT -> (PrivateDataSlotEXT -> io ()) -> r)
-> r
withPrivateDataSlotEXT device :: Device
device pCreateInfo :: PrivateDataSlotCreateInfoEXT
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io PrivateDataSlotEXT -> (PrivateDataSlotEXT -> io ()) -> r
b =
  io PrivateDataSlotEXT -> (PrivateDataSlotEXT -> io ()) -> r
b (Device
-> PrivateDataSlotCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io PrivateDataSlotEXT
forall (io :: * -> *).
MonadIO io =>
Device
-> PrivateDataSlotCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io PrivateDataSlotEXT
createPrivateDataSlotEXT Device
device PrivateDataSlotCreateInfoEXT
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(PrivateDataSlotEXT
o0) -> Device
-> PrivateDataSlotEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> PrivateDataSlotEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyPrivateDataSlotEXT Device
device PrivateDataSlotEXT
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyPrivateDataSlotEXT
  :: FunPtr (Ptr Device_T -> PrivateDataSlotEXT -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> PrivateDataSlotEXT -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyPrivateDataSlotEXT - Destroy a private data slot
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-privateDataSlot-04062# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @privateDataSlot@ was created, a compatible set of
--     callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-privateDataSlot-04063# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @privateDataSlot@ was created, @pAllocator@ /must/ be
--     @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-privateDataSlot-parameter# If
--     @privateDataSlot@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @privateDataSlot@ /must/ be a valid
--     'Vulkan.Extensions.Handles.PrivateDataSlotEXT' handle
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyPrivateDataSlotEXT-privateDataSlot-parent# If
--     @privateDataSlot@ is a valid handle, it /must/ have been created,
--     allocated, or retrieved from @device@
--
-- == Host Synchronization
--
-- -   Host access to @privateDataSlot@ /must/ be externally synchronized
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT'
destroyPrivateDataSlotEXT :: forall io
                           . (MonadIO io)
                          => -- | @device@ is the logical device associated with the creation of the
                             -- object(s) holding the private data slot.
                             Device
                          -> -- | @privateDataSlot@ is the private data slot to destroy.
                             PrivateDataSlotEXT
                          -> -- | @pAllocator@ controls host memory allocation as described in the
                             -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                             -- chapter.
                             ("allocator" ::: Maybe AllocationCallbacks)
                          -> io ()
destroyPrivateDataSlotEXT :: Device
-> PrivateDataSlotEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyPrivateDataSlotEXT device :: Device
device privateDataSlot :: PrivateDataSlotEXT
privateDataSlot allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyPrivateDataSlotEXTPtr :: FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyPrivateDataSlotEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> PrivateDataSlotEXT
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyPrivateDataSlotEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyPrivateDataSlotEXTPtr FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> PrivateDataSlotEXT
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkDestroyPrivateDataSlotEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyPrivateDataSlotEXT' :: Ptr Device_T
-> PrivateDataSlotEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyPrivateDataSlotEXT' = FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> PrivateDataSlotEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyPrivateDataSlotEXT FunPtr
  (Ptr Device_T
   -> PrivateDataSlotEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyPrivateDataSlotEXTPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
 -> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkDestroyPrivateDataSlotEXT" (Ptr Device_T
-> PrivateDataSlotEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyPrivateDataSlotEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) (PrivateDataSlotEXT
privateDataSlot) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkSetPrivateDataEXT
  :: FunPtr (Ptr Device_T -> ObjectType -> Word64 -> PrivateDataSlotEXT -> Word64 -> IO Result) -> Ptr Device_T -> ObjectType -> Word64 -> PrivateDataSlotEXT -> Word64 -> IO Result

-- | vkSetPrivateDataEXT - Associate data with a Vulkan object
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Core10.Enums.ObjectType.ObjectType',
-- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT'
setPrivateDataEXT :: forall io
                   . (MonadIO io)
                  => -- | @device@ is the device that created the object.
                     --
                     -- #VUID-vkSetPrivateDataEXT-device-parameter# @device@ /must/ be a valid
                     -- 'Vulkan.Core10.Handles.Device' handle
                     Device
                  -> -- | @objectType@ is a 'Vulkan.Core10.Enums.ObjectType.ObjectType' specifying
                     -- the type of object to associate data with.
                     --
                     -- #VUID-vkSetPrivateDataEXT-objectType-parameter# @objectType@ /must/ be a
                     -- valid 'Vulkan.Core10.Enums.ObjectType.ObjectType' value
                     ObjectType
                  -> -- | @objectHandle@ is a handle to the object to associate data with.
                     --
                     -- #VUID-vkSetPrivateDataEXT-objectHandle-04016# @objectHandle@ /must/ be
                     -- @device@ or a child of @device@
                     --
                     -- #VUID-vkSetPrivateDataEXT-objectHandle-04017# @objectHandle@ /must/ be a
                     -- valid handle to an object of type @objectType@
                     ("objectHandle" ::: Word64)
                  -> -- | @privateDataSlot@ is a handle to a
                     -- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT' specifying location of
                     -- private data storage.
                     --
                     -- #VUID-vkSetPrivateDataEXT-privateDataSlot-parameter# @privateDataSlot@
                     -- /must/ be a valid 'Vulkan.Extensions.Handles.PrivateDataSlotEXT' handle
                     --
                     -- #VUID-vkSetPrivateDataEXT-privateDataSlot-parent# @privateDataSlot@
                     -- /must/ have been created, allocated, or retrieved from @device@
                     PrivateDataSlotEXT
                  -> -- | @data@ is user defined data to associate the object with. This data will
                     -- be stored at @privateDataSlot@.
                     ("data" ::: Word64)
                  -> io ()
setPrivateDataEXT :: Device
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("objectHandle" ::: Word64)
-> io ()
setPrivateDataEXT device :: Device
device objectType :: ObjectType
objectType objectHandle :: "objectHandle" ::: Word64
objectHandle privateDataSlot :: PrivateDataSlotEXT
privateDataSlot data' :: "objectHandle" ::: Word64
data' = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkSetPrivateDataEXTPtr :: FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
vkSetPrivateDataEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ObjectType
      -> ("objectHandle" ::: Word64)
      -> PrivateDataSlotEXT
      -> ("objectHandle" ::: Word64)
      -> IO Result)
pVkSetPrivateDataEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
vkSetPrivateDataEXTPtr FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ObjectType
      -> ("objectHandle" ::: Word64)
      -> PrivateDataSlotEXT
      -> ("objectHandle" ::: Word64)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkSetPrivateDataEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkSetPrivateDataEXT' :: Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("objectHandle" ::: Word64)
-> IO Result
vkSetPrivateDataEXT' = FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
-> Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("objectHandle" ::: Word64)
-> IO Result
mkVkSetPrivateDataEXT FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("objectHandle" ::: Word64)
   -> IO Result)
vkSetPrivateDataEXTPtr
  Result
r <- String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkSetPrivateDataEXT" (Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("objectHandle" ::: Word64)
-> IO Result
vkSetPrivateDataEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) (ObjectType
objectType) ("objectHandle" ::: Word64
objectHandle) (PrivateDataSlotEXT
privateDataSlot) ("objectHandle" ::: Word64
data'))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPrivateDataEXT
  :: FunPtr (Ptr Device_T -> ObjectType -> Word64 -> PrivateDataSlotEXT -> Ptr Word64 -> IO ()) -> Ptr Device_T -> ObjectType -> Word64 -> PrivateDataSlotEXT -> Ptr Word64 -> IO ()

-- | vkGetPrivateDataEXT - Retrieve data associated with a Vulkan object
--
-- = Description
--
-- Note
--
-- Due to platform details on Android, implementations might not be able to
-- reliably return @0@ from calls to 'getPrivateDataEXT' for
-- 'Vulkan.Extensions.Handles.SwapchainKHR' objects on which
-- 'setPrivateDataEXT' has not previously been called. This erratum is
-- exclusive to the Android platform and objects of type
-- 'Vulkan.Extensions.Handles.SwapchainKHR'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Core10.Enums.ObjectType.ObjectType',
-- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT'
getPrivateDataEXT :: forall io
                   . (MonadIO io)
                  => -- | @device@ is the device that created the object
                     --
                     -- #VUID-vkGetPrivateDataEXT-device-parameter# @device@ /must/ be a valid
                     -- 'Vulkan.Core10.Handles.Device' handle
                     Device
                  -> -- | @objectType@ is a 'Vulkan.Core10.Enums.ObjectType.ObjectType' specifying
                     -- the type of object data is associated with.
                     --
                     -- #VUID-vkGetPrivateDataEXT-objectType-04018# @objectType@ /must/ be
                     -- 'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_DEVICE', or an object type
                     -- whose parent is 'Vulkan.Core10.Handles.Device'
                     --
                     -- #VUID-vkGetPrivateDataEXT-objectType-parameter# @objectType@ /must/ be a
                     -- valid 'Vulkan.Core10.Enums.ObjectType.ObjectType' value
                     ObjectType
                  -> -- | @objectHandle@ is a handle to the object data is associated with.
                     ("objectHandle" ::: Word64)
                  -> -- | @privateDataSlot@ is a handle to a
                     -- 'Vulkan.Extensions.Handles.PrivateDataSlotEXT' specifying location of
                     -- private data pointer storage.
                     --
                     -- #VUID-vkGetPrivateDataEXT-privateDataSlot-parameter# @privateDataSlot@
                     -- /must/ be a valid 'Vulkan.Extensions.Handles.PrivateDataSlotEXT' handle
                     --
                     -- #VUID-vkGetPrivateDataEXT-privateDataSlot-parent# @privateDataSlot@
                     -- /must/ have been created, allocated, or retrieved from @device@
                     PrivateDataSlotEXT
                  -> io (("data" ::: Word64))
getPrivateDataEXT :: Device
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> io ("objectHandle" ::: Word64)
getPrivateDataEXT device :: Device
device objectType :: ObjectType
objectType objectHandle :: "objectHandle" ::: Word64
objectHandle privateDataSlot :: PrivateDataSlotEXT
privateDataSlot = IO ("objectHandle" ::: Word64) -> io ("objectHandle" ::: Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("objectHandle" ::: Word64) -> io ("objectHandle" ::: Word64))
-> (ContT
      ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
    -> IO ("objectHandle" ::: Word64))
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
-> io ("objectHandle" ::: Word64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
-> IO ("objectHandle" ::: Word64)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
 -> io ("objectHandle" ::: Word64))
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
-> io ("objectHandle" ::: Word64)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPrivateDataEXTPtr :: FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
vkGetPrivateDataEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ObjectType
      -> ("objectHandle" ::: Word64)
      -> PrivateDataSlotEXT
      -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
      -> IO ())
pVkGetPrivateDataEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT ("objectHandle" ::: Word64) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("objectHandle" ::: Word64) IO ())
-> IO () -> ContT ("objectHandle" ::: Word64) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
vkGetPrivateDataEXTPtr FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> ObjectType
      -> ("objectHandle" ::: Word64)
      -> PrivateDataSlotEXT
      -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetPrivateDataEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPrivateDataEXT' :: Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("pData" ::: Ptr ("objectHandle" ::: Word64))
-> IO ()
vkGetPrivateDataEXT' = FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
-> Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("pData" ::: Ptr ("objectHandle" ::: Word64))
-> IO ()
mkVkGetPrivateDataEXT FunPtr
  (Ptr Device_T
   -> ObjectType
   -> ("objectHandle" ::: Word64)
   -> PrivateDataSlotEXT
   -> ("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ())
vkGetPrivateDataEXTPtr
  "pData" ::: Ptr ("objectHandle" ::: Word64)
pPData <- ((("pData" ::: Ptr ("objectHandle" ::: Word64))
  -> IO ("objectHandle" ::: Word64))
 -> IO ("objectHandle" ::: Word64))
-> ContT
     ("objectHandle" ::: Word64)
     IO
     ("pData" ::: Ptr ("objectHandle" ::: Word64))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pData" ::: Ptr ("objectHandle" ::: Word64))
   -> IO ("objectHandle" ::: Word64))
  -> IO ("objectHandle" ::: Word64))
 -> ContT
      ("objectHandle" ::: Word64)
      IO
      ("pData" ::: Ptr ("objectHandle" ::: Word64)))
-> ((("pData" ::: Ptr ("objectHandle" ::: Word64))
     -> IO ("objectHandle" ::: Word64))
    -> IO ("objectHandle" ::: Word64))
-> ContT
     ("objectHandle" ::: Word64)
     IO
     ("pData" ::: Ptr ("objectHandle" ::: Word64))
forall a b. (a -> b) -> a -> b
$ IO ("pData" ::: Ptr ("objectHandle" ::: Word64))
-> (("pData" ::: Ptr ("objectHandle" ::: Word64)) -> IO ())
-> (("pData" ::: Ptr ("objectHandle" ::: Word64))
    -> IO ("objectHandle" ::: Word64))
-> IO ("objectHandle" ::: Word64)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pData" ::: Ptr ("objectHandle" ::: Word64))
forall a. Int -> IO (Ptr a)
callocBytes @Word64 8) ("pData" ::: Ptr ("objectHandle" ::: Word64)) -> IO ()
forall a. Ptr a -> IO ()
free
  IO () -> ContT ("objectHandle" ::: Word64) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("objectHandle" ::: Word64) IO ())
-> IO () -> ContT ("objectHandle" ::: Word64) IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPrivateDataEXT" (Ptr Device_T
-> ObjectType
-> ("objectHandle" ::: Word64)
-> PrivateDataSlotEXT
-> ("pData" ::: Ptr ("objectHandle" ::: Word64))
-> IO ()
vkGetPrivateDataEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) (ObjectType
objectType) ("objectHandle" ::: Word64
objectHandle) (PrivateDataSlotEXT
privateDataSlot) ("pData" ::: Ptr ("objectHandle" ::: Word64)
pPData))
  "objectHandle" ::: Word64
pData <- IO ("objectHandle" ::: Word64)
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("objectHandle" ::: Word64)
 -> ContT
      ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64))
-> IO ("objectHandle" ::: Word64)
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
forall a b. (a -> b) -> a -> b
$ ("pData" ::: Ptr ("objectHandle" ::: Word64))
-> IO ("objectHandle" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @Word64 "pData" ::: Ptr ("objectHandle" ::: Word64)
pPData
  ("objectHandle" ::: Word64)
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("objectHandle" ::: Word64)
 -> ContT
      ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64))
-> ("objectHandle" ::: Word64)
-> ContT ("objectHandle" ::: Word64) IO ("objectHandle" ::: Word64)
forall a b. (a -> b) -> a -> b
$ ("objectHandle" ::: Word64
pData)


-- | VkDevicePrivateDataCreateInfoEXT - Reserve private data slots
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DevicePrivateDataCreateInfoEXT = DevicePrivateDataCreateInfoEXT
  { -- | @privateDataSlotRequestCount@ is the amount of slots to reserve.
    DevicePrivateDataCreateInfoEXT -> Word32
privateDataSlotRequestCount :: Word32 }
  deriving (Typeable, DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> Bool
(DevicePrivateDataCreateInfoEXT
 -> DevicePrivateDataCreateInfoEXT -> Bool)
-> (DevicePrivateDataCreateInfoEXT
    -> DevicePrivateDataCreateInfoEXT -> Bool)
-> Eq DevicePrivateDataCreateInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> Bool
$c/= :: DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> Bool
== :: DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> Bool
$c== :: DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DevicePrivateDataCreateInfoEXT)
#endif
deriving instance Show DevicePrivateDataCreateInfoEXT

instance ToCStruct DevicePrivateDataCreateInfoEXT where
  withCStruct :: DevicePrivateDataCreateInfoEXT
-> (Ptr DevicePrivateDataCreateInfoEXT -> IO b) -> IO b
withCStruct x :: DevicePrivateDataCreateInfoEXT
x f :: Ptr DevicePrivateDataCreateInfoEXT -> IO b
f = Int -> Int -> (Ptr DevicePrivateDataCreateInfoEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr DevicePrivateDataCreateInfoEXT -> IO b) -> IO b)
-> (Ptr DevicePrivateDataCreateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DevicePrivateDataCreateInfoEXT
p -> Ptr DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DevicePrivateDataCreateInfoEXT
p DevicePrivateDataCreateInfoEXT
x (Ptr DevicePrivateDataCreateInfoEXT -> IO b
f Ptr DevicePrivateDataCreateInfoEXT
p)
  pokeCStruct :: Ptr DevicePrivateDataCreateInfoEXT
-> DevicePrivateDataCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr DevicePrivateDataCreateInfoEXT
p DevicePrivateDataCreateInfoEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
privateDataSlotRequestCount)
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr DevicePrivateDataCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr DevicePrivateDataCreateInfoEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePrivateDataCreateInfoEXT
p Ptr DevicePrivateDataCreateInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

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

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

instance Zero DevicePrivateDataCreateInfoEXT where
  zero :: DevicePrivateDataCreateInfoEXT
zero = Word32 -> DevicePrivateDataCreateInfoEXT
DevicePrivateDataCreateInfoEXT
           Word32
forall a. Zero a => a
zero


-- | VkPrivateDataSlotCreateInfoEXT - Structure specifying the parameters of
-- private data slot construction
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'PrivateDataSlotCreateFlagsEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createPrivateDataSlotEXT'
data PrivateDataSlotCreateInfoEXT = PrivateDataSlotCreateInfoEXT
  { -- | @flags@ is a bitmask of 'PrivateDataSlotCreateFlagsEXT' specifying
    -- additional parameters of the new private data slot
    --
    -- #VUID-VkPrivateDataSlotCreateInfoEXT-flags-zerobitmask# @flags@ /must/
    -- be @0@
    PrivateDataSlotCreateInfoEXT -> PrivateDataSlotCreateFlagsEXT
flags :: PrivateDataSlotCreateFlagsEXT }
  deriving (Typeable, PrivateDataSlotCreateInfoEXT
-> PrivateDataSlotCreateInfoEXT -> Bool
(PrivateDataSlotCreateInfoEXT
 -> PrivateDataSlotCreateInfoEXT -> Bool)
-> (PrivateDataSlotCreateInfoEXT
    -> PrivateDataSlotCreateInfoEXT -> Bool)
-> Eq PrivateDataSlotCreateInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrivateDataSlotCreateInfoEXT
-> PrivateDataSlotCreateInfoEXT -> Bool
$c/= :: PrivateDataSlotCreateInfoEXT
-> PrivateDataSlotCreateInfoEXT -> Bool
== :: PrivateDataSlotCreateInfoEXT
-> PrivateDataSlotCreateInfoEXT -> Bool
$c== :: PrivateDataSlotCreateInfoEXT
-> PrivateDataSlotCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PrivateDataSlotCreateInfoEXT)
#endif
deriving instance Show PrivateDataSlotCreateInfoEXT

instance ToCStruct PrivateDataSlotCreateInfoEXT where
  withCStruct :: PrivateDataSlotCreateInfoEXT
-> (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b)
-> IO b
withCStruct x :: PrivateDataSlotCreateInfoEXT
x f :: ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p -> ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> PrivateDataSlotCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p PrivateDataSlotCreateInfoEXT
x (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT) -> IO b
f "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> PrivateDataSlotCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p PrivateDataSlotCreateInfoEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr PrivateDataSlotCreateFlagsEXT
-> PrivateDataSlotCreateFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr PrivateDataSlotCreateFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PrivateDataSlotCreateFlagsEXT)) (PrivateDataSlotCreateFlagsEXT
flags)
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr PrivateDataSlotCreateFlagsEXT
-> PrivateDataSlotCreateFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT
p ("pCreateInfo" ::: Ptr PrivateDataSlotCreateInfoEXT)
-> Int -> Ptr PrivateDataSlotCreateFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PrivateDataSlotCreateFlagsEXT)) (PrivateDataSlotCreateFlagsEXT
forall a. Zero a => a
zero)
    IO b
f

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

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

instance Zero PrivateDataSlotCreateInfoEXT where
  zero :: PrivateDataSlotCreateInfoEXT
zero = PrivateDataSlotCreateFlagsEXT -> PrivateDataSlotCreateInfoEXT
PrivateDataSlotCreateInfoEXT
           PrivateDataSlotCreateFlagsEXT
forall a. Zero a => a
zero


-- | VkPhysicalDevicePrivateDataFeaturesEXT - Structure specifying physical
-- device support
--
-- = Members
--
-- The members of the 'PhysicalDevicePrivateDataFeaturesEXT' structure
-- describe the following features:
--
-- = Description
--
-- If the 'PhysicalDevicePrivateDataFeaturesEXT' structure is included in
-- the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether the feature is supported.
-- 'PhysicalDevicePrivateDataFeaturesEXT' /can/ also be used in the @pNext@
-- chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable the features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePrivateDataFeaturesEXT = PhysicalDevicePrivateDataFeaturesEXT
  { -- | #features-privateData# @privateData@ indicates whether the
    -- implementation supports private data. See
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#private-data Private Data>.
    PhysicalDevicePrivateDataFeaturesEXT -> Bool
privateData :: Bool }
  deriving (Typeable, PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> Bool
(PhysicalDevicePrivateDataFeaturesEXT
 -> PhysicalDevicePrivateDataFeaturesEXT -> Bool)
-> (PhysicalDevicePrivateDataFeaturesEXT
    -> PhysicalDevicePrivateDataFeaturesEXT -> Bool)
-> Eq PhysicalDevicePrivateDataFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> Bool
$c/= :: PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> Bool
== :: PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> Bool
$c== :: PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePrivateDataFeaturesEXT)
#endif
deriving instance Show PhysicalDevicePrivateDataFeaturesEXT

instance ToCStruct PhysicalDevicePrivateDataFeaturesEXT where
  withCStruct :: PhysicalDevicePrivateDataFeaturesEXT
-> (Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b) -> IO b
withCStruct x :: PhysicalDevicePrivateDataFeaturesEXT
x f :: Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDevicePrivateDataFeaturesEXT
p -> Ptr PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePrivateDataFeaturesEXT
p PhysicalDevicePrivateDataFeaturesEXT
x (Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b
f Ptr PhysicalDevicePrivateDataFeaturesEXT
p)
  pokeCStruct :: Ptr PhysicalDevicePrivateDataFeaturesEXT
-> PhysicalDevicePrivateDataFeaturesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDevicePrivateDataFeaturesEXT
p PhysicalDevicePrivateDataFeaturesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
privateData))
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDevicePrivateDataFeaturesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDevicePrivateDataFeaturesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDevicePrivateDataFeaturesEXT where
  peekCStruct :: Ptr PhysicalDevicePrivateDataFeaturesEXT
-> IO PhysicalDevicePrivateDataFeaturesEXT
peekCStruct p :: Ptr PhysicalDevicePrivateDataFeaturesEXT
p = do
    Bool32
privateData <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePrivateDataFeaturesEXT
p Ptr PhysicalDevicePrivateDataFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    PhysicalDevicePrivateDataFeaturesEXT
-> IO PhysicalDevicePrivateDataFeaturesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDevicePrivateDataFeaturesEXT
 -> IO PhysicalDevicePrivateDataFeaturesEXT)
-> PhysicalDevicePrivateDataFeaturesEXT
-> IO PhysicalDevicePrivateDataFeaturesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDevicePrivateDataFeaturesEXT
PhysicalDevicePrivateDataFeaturesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
privateData)

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

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


type PrivateDataSlotCreateFlagsEXT = PrivateDataSlotCreateFlagBitsEXT

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



conNamePrivateDataSlotCreateFlagBitsEXT :: String
conNamePrivateDataSlotCreateFlagBitsEXT :: String
conNamePrivateDataSlotCreateFlagBitsEXT = "PrivateDataSlotCreateFlagBitsEXT"

enumPrefixPrivateDataSlotCreateFlagBitsEXT :: String
enumPrefixPrivateDataSlotCreateFlagBitsEXT :: String
enumPrefixPrivateDataSlotCreateFlagBitsEXT = ""

showTablePrivateDataSlotCreateFlagBitsEXT :: [(PrivateDataSlotCreateFlagBitsEXT, String)]
showTablePrivateDataSlotCreateFlagBitsEXT :: [(PrivateDataSlotCreateFlagsEXT, String)]
showTablePrivateDataSlotCreateFlagBitsEXT = []

instance Show PrivateDataSlotCreateFlagBitsEXT where
  showsPrec :: Int -> PrivateDataSlotCreateFlagsEXT -> ShowS
showsPrec = String
-> [(PrivateDataSlotCreateFlagsEXT, String)]
-> String
-> (PrivateDataSlotCreateFlagsEXT -> Word32)
-> (Word32 -> ShowS)
-> Int
-> PrivateDataSlotCreateFlagsEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixPrivateDataSlotCreateFlagBitsEXT
                            [(PrivateDataSlotCreateFlagsEXT, String)]
showTablePrivateDataSlotCreateFlagBitsEXT
                            String
conNamePrivateDataSlotCreateFlagBitsEXT
                            (\(PrivateDataSlotCreateFlagBitsEXT x :: Word32
x) -> Word32
x)
                            (\x :: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Word32
x)

instance Read PrivateDataSlotCreateFlagBitsEXT where
  readPrec :: ReadPrec PrivateDataSlotCreateFlagsEXT
readPrec = String
-> [(PrivateDataSlotCreateFlagsEXT, String)]
-> String
-> (Word32 -> PrivateDataSlotCreateFlagsEXT)
-> ReadPrec PrivateDataSlotCreateFlagsEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixPrivateDataSlotCreateFlagBitsEXT
                          [(PrivateDataSlotCreateFlagsEXT, String)]
showTablePrivateDataSlotCreateFlagBitsEXT
                          String
conNamePrivateDataSlotCreateFlagBitsEXT
                          Word32 -> PrivateDataSlotCreateFlagsEXT
PrivateDataSlotCreateFlagBitsEXT


type EXT_PRIVATE_DATA_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_PRIVATE_DATA_SPEC_VERSION"
pattern EXT_PRIVATE_DATA_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_PRIVATE_DATA_SPEC_VERSION :: a
$mEXT_PRIVATE_DATA_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_PRIVATE_DATA_SPEC_VERSION = 1


type EXT_PRIVATE_DATA_EXTENSION_NAME = "VK_EXT_private_data"

-- No documentation found for TopLevel "VK_EXT_PRIVATE_DATA_EXTENSION_NAME"
pattern EXT_PRIVATE_DATA_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_PRIVATE_DATA_EXTENSION_NAME :: a
$mEXT_PRIVATE_DATA_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_PRIVATE_DATA_EXTENSION_NAME = "VK_EXT_private_data"