{-# language CPP #-}
-- | = Name
--
-- VK_KHR_map_memory2 - device extension
--
-- = VK_KHR_map_memory2
--
-- [__Name String__]
--     @VK_KHR_map_memory2@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     272
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     None
--
-- [__Contact__]
--
--     -   Faith Ekstrand
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_map_memory2] @gfxstrand%0A*Here describe the issue or question you have about the VK_KHR_map_memory2 extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_map_memory2.adoc VK_KHR_map_memory2>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2023-03-14
--
-- [__Interactions and External Dependencies__]
--
--     -   None
--
-- [__Contributors__]
--
--     -   Faith Ekstrand, Collabora
--
--     -   Tobias Hector, AMD
--
-- == Description
--
-- This extension provides extensible versions of the Vulkan memory map and
-- unmap commands. The new commands are functionally identical to the core
-- commands, except that their parameters are specified using extensible
-- structures that can be used to pass extension-specific information.
--
-- == New Commands
--
-- -   'mapMemory2KHR'
--
-- -   'unmapMemory2KHR'
--
-- == New Structures
--
-- -   'MemoryMapInfoKHR'
--
-- -   'MemoryUnmapInfoKHR'
--
-- == New Enums
--
-- -   'MemoryUnmapFlagBitsKHR'
--
-- == New Bitmasks
--
-- -   'MemoryUnmapFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_MAP_MEMORY_2_EXTENSION_NAME'
--
-- -   'KHR_MAP_MEMORY_2_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR'
--
-- == Version History
--
-- -   Revision 0, 2022-08-03 (Faith Ekstrand)
--
--     -   Internal revisions
--
-- -   Revision 1, 2023-03-14
--
--     -   Public release
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_map_memory2 Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_map_memory2  ( mapMemory2KHR
                                             , unmapMemory2KHR
                                             , MemoryMapInfoKHR(..)
                                             , MemoryUnmapInfoKHR(..)
                                             , MemoryUnmapFlagsKHR
                                             , MemoryUnmapFlagBitsKHR( MEMORY_UNMAP_RESERVE_BIT_EXT
                                                                     , ..
                                                                     )
                                             , KHR_MAP_MEMORY_2_SPEC_VERSION
                                             , pattern KHR_MAP_MEMORY_2_SPEC_VERSION
                                             , KHR_MAP_MEMORY_2_EXTENSION_NAME
                                             , pattern KHR_MAP_MEMORY_2_EXTENSION_NAME
                                             ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (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.NamedType ((:::))
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(pVkMapMemory2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkUnmapMemory2KHR))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.MemoryMapFlagBits (MemoryMapFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_map_memory_placed (MemoryMapPlacedInfoEXT)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkMapMemory2KHR
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct MemoryMapInfoKHR) -> Ptr (Ptr ()) -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct MemoryMapInfoKHR) -> Ptr (Ptr ()) -> IO Result

-- | vkMapMemory2KHR - Map a memory object into application address space
--
-- = Description
--
-- This function behaves identically to 'Vulkan.Core10.Memory.mapMemory'
-- except that it gets its parameters via an extensible structure pointer
-- rather than directly as function arguments.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_MEMORY_MAP_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_map_memory2 VK_KHR_map_memory2>,
-- 'Vulkan.Core10.Handles.Device', 'MemoryMapInfoKHR'
mapMemory2KHR :: forall a io
               . (Extendss MemoryMapInfoKHR a, PokeChain a, MonadIO io)
              => -- | @device@ is the logical device that owns the memory.
                 --
                 -- #VUID-vkMapMemory2KHR-device-parameter# @device@ /must/ be a valid
                 -- 'Vulkan.Core10.Handles.Device' handle
                 Device
              -> -- | @pMemoryMapInfo@ is a pointer to a 'MemoryMapInfoKHR' structure
                 -- describing parameters of the map.
                 --
                 -- #VUID-vkMapMemory2KHR-pMemoryMapInfo-parameter# @pMemoryMapInfo@ /must/
                 -- be a valid pointer to a valid 'MemoryMapInfoKHR' structure
                 (MemoryMapInfoKHR a)
              -> io (("data" ::: Ptr ()))
mapMemory2KHR :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryMapInfoKHR a, PokeChain a, MonadIO io) =>
Device -> MemoryMapInfoKHR a -> io ("data" ::: Ptr ())
mapMemory2KHR Device
device MemoryMapInfoKHR a
memoryMapInfo = IO ("data" ::: Ptr ()) -> io ("data" ::: Ptr ())
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("data" ::: Ptr ()) -> io ("data" ::: Ptr ()))
-> (ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
    -> IO ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
-> io ("data" ::: Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
-> IO ("data" ::: Ptr ())
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
 -> io ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
-> io ("data" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ do
  let vkMapMemory2KHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> IO Result)
vkMapMemory2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct MemoryMapInfoKHR)
      -> Ptr ("data" ::: Ptr ())
      -> IO Result)
pVkMapMemory2KHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT ("data" ::: Ptr ()) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("data" ::: Ptr ()) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("data" ::: Ptr ()) IO ())
-> IO () -> ContT ("data" ::: Ptr ()) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> IO Result)
vkMapMemory2KHRPtr FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct MemoryMapInfoKHR)
      -> Ptr ("data" ::: Ptr ())
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> 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 String
"" String
"The function pointer for vkMapMemory2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkMapMemory2KHR' :: Ptr Device_T
-> Ptr (SomeStruct MemoryMapInfoKHR)
-> Ptr ("data" ::: Ptr ())
-> IO Result
vkMapMemory2KHR' = FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct MemoryMapInfoKHR)
-> Ptr ("data" ::: Ptr ())
-> IO Result
mkVkMapMemory2KHR FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct MemoryMapInfoKHR)
   -> Ptr ("data" ::: Ptr ())
   -> IO Result)
vkMapMemory2KHRPtr
  Ptr (MemoryMapInfoKHR a)
pMemoryMapInfo <- ((Ptr (MemoryMapInfoKHR a) -> IO ("data" ::: Ptr ()))
 -> IO ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO (Ptr (MemoryMapInfoKHR a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (MemoryMapInfoKHR a) -> IO ("data" ::: Ptr ()))
  -> IO ("data" ::: Ptr ()))
 -> ContT ("data" ::: Ptr ()) IO (Ptr (MemoryMapInfoKHR a)))
-> ((Ptr (MemoryMapInfoKHR a) -> IO ("data" ::: Ptr ()))
    -> IO ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO (Ptr (MemoryMapInfoKHR a))
forall a b. (a -> b) -> a -> b
$ MemoryMapInfoKHR a
-> (Ptr (MemoryMapInfoKHR a) -> IO ("data" ::: Ptr ()))
-> IO ("data" ::: Ptr ())
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
MemoryMapInfoKHR a -> (Ptr (MemoryMapInfoKHR a) -> IO b) -> IO b
withCStruct (MemoryMapInfoKHR a
memoryMapInfo)
  Ptr ("data" ::: Ptr ())
pPpData <- ((Ptr ("data" ::: Ptr ()) -> IO ("data" ::: Ptr ()))
 -> IO ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO (Ptr ("data" ::: Ptr ()))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("data" ::: Ptr ()) -> IO ("data" ::: Ptr ()))
  -> IO ("data" ::: Ptr ()))
 -> ContT ("data" ::: Ptr ()) IO (Ptr ("data" ::: Ptr ())))
-> ((Ptr ("data" ::: Ptr ()) -> IO ("data" ::: Ptr ()))
    -> IO ("data" ::: Ptr ()))
-> ContT ("data" ::: Ptr ()) IO (Ptr ("data" ::: Ptr ()))
forall a b. (a -> b) -> a -> b
$ IO (Ptr ("data" ::: Ptr ()))
-> (Ptr ("data" ::: Ptr ()) -> IO ())
-> (Ptr ("data" ::: Ptr ()) -> IO ("data" ::: Ptr ()))
-> IO ("data" ::: Ptr ())
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @(Ptr ()) Int
8) Ptr ("data" ::: Ptr ()) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT ("data" ::: Ptr ()) IO Result
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("data" ::: Ptr ()) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("data" ::: Ptr ()) IO Result)
-> IO Result -> ContT ("data" ::: Ptr ()) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkMapMemory2KHR" (Ptr Device_T
-> Ptr (SomeStruct MemoryMapInfoKHR)
-> Ptr ("data" ::: Ptr ())
-> IO Result
vkMapMemory2KHR'
                                                    (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                    (Ptr (MemoryMapInfoKHR a) -> Ptr (SomeStruct MemoryMapInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (MemoryMapInfoKHR a)
pMemoryMapInfo)
                                                    (Ptr ("data" ::: Ptr ())
pPpData))
  IO () -> ContT ("data" ::: Ptr ()) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("data" ::: Ptr ()) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("data" ::: Ptr ()) IO ())
-> IO () -> ContT ("data" ::: Ptr ()) 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))
  "data" ::: Ptr ()
ppData <- IO ("data" ::: Ptr ())
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("data" ::: Ptr ()) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("data" ::: Ptr ())
 -> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ()))
-> IO ("data" ::: Ptr ())
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) Ptr ("data" ::: Ptr ())
pPpData
  ("data" ::: Ptr ())
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
forall a. a -> ContT ("data" ::: Ptr ()) IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("data" ::: Ptr ())
 -> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ()))
-> ("data" ::: Ptr ())
-> ContT ("data" ::: Ptr ()) IO ("data" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ ("data" ::: Ptr ()
ppData)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkUnmapMemory2KHR
  :: FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result) -> Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result

-- | vkUnmapMemory2KHR - Unmap a previously mapped memory object
--
-- = Description
--
-- This function behaves identically to 'Vulkan.Core10.Memory.unmapMemory'
-- except that it gets its parameters via an extensible structure pointer
-- rather than directly as function arguments.
--
-- == 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_MEMORY_MAP_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_map_memory2 VK_KHR_map_memory2>,
-- 'Vulkan.Core10.Handles.Device', 'MemoryUnmapInfoKHR'
unmapMemory2KHR :: forall io
                 . (MonadIO io)
                => -- | @device@ is the logical device that owns the memory.
                   --
                   -- #VUID-vkUnmapMemory2KHR-device-parameter# @device@ /must/ be a valid
                   -- 'Vulkan.Core10.Handles.Device' handle
                   Device
                -> -- | @pMemoryUnmapInfo@ is a pointer to a 'MemoryUnmapInfoKHR' structure
                   -- describing parameters of the unmap.
                   --
                   -- #VUID-vkUnmapMemory2KHR-pMemoryUnmapInfo-parameter# @pMemoryUnmapInfo@
                   -- /must/ be a valid pointer to a valid 'MemoryUnmapInfoKHR' structure
                   MemoryUnmapInfoKHR
                -> io ()
unmapMemory2KHR :: forall (io :: * -> *).
MonadIO io =>
Device -> MemoryUnmapInfoKHR -> io ()
unmapMemory2KHR Device
device MemoryUnmapInfoKHR
memoryUnmapInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkUnmapMemory2KHRPtr :: FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
vkUnmapMemory2KHRPtr = DeviceCmds
-> FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
pVkUnmapMemory2KHR (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
vkUnmapMemory2KHRPtr FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
-> FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> 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 String
"" String
"The function pointer for vkUnmapMemory2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkUnmapMemory2KHR' :: Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result
vkUnmapMemory2KHR' = FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
-> Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result
mkVkUnmapMemory2KHR FunPtr (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result)
vkUnmapMemory2KHRPtr
  Ptr MemoryUnmapInfoKHR
pMemoryUnmapInfo <- ((Ptr MemoryUnmapInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr MemoryUnmapInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr MemoryUnmapInfoKHR -> IO ()) -> IO ())
 -> ContT () IO (Ptr MemoryUnmapInfoKHR))
-> ((Ptr MemoryUnmapInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr MemoryUnmapInfoKHR)
forall a b. (a -> b) -> a -> b
$ MemoryUnmapInfoKHR -> (Ptr MemoryUnmapInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
MemoryUnmapInfoKHR -> (Ptr MemoryUnmapInfoKHR -> IO b) -> IO b
withCStruct (MemoryUnmapInfoKHR
memoryUnmapInfo)
  Result
r <- IO Result -> ContT () IO Result
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkUnmapMemory2KHR" (Ptr Device_T -> Ptr MemoryUnmapInfoKHR -> IO Result
vkUnmapMemory2KHR'
                                                      (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                      Ptr MemoryUnmapInfoKHR
pMemoryUnmapInfo)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
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))


-- | VkMemoryMapInfoKHR - Structure containing parameters of a memory map
-- operation
--
-- == Valid Usage
--
-- -   #VUID-VkMemoryMapInfoKHR-memory-07958# @memory@ /must/ not be
--     currently host mapped
--
-- -   #VUID-VkMemoryMapInfoKHR-offset-07959# @offset@ /must/ be less than
--     the size of @memory@
--
-- -   #VUID-VkMemoryMapInfoKHR-size-07960# If @size@ is not equal to
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE', @size@ /must/ be greater
--     than @0@
--
-- -   #VUID-VkMemoryMapInfoKHR-size-07961# If @size@ is not equal to
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE', @size@ /must/ be less than
--     or equal to the size of the @memory@ minus @offset@
--
-- -   #VUID-VkMemoryMapInfoKHR-memory-07962# @memory@ /must/ have been
--     created with a memory type that reports
--     'Vulkan.Core10.Enums.MemoryPropertyFlagBits.MEMORY_PROPERTY_HOST_VISIBLE_BIT'
--
-- -   #VUID-VkMemoryMapInfoKHR-memory-07963# @memory@ /must/ not have been
--     allocated with multiple instances
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09569# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@, the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-memoryMapPlaced memoryMapPlaced>
--     feature /must/ be enabled
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09570# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@, the @pNext@ chain /must/ include a
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.MemoryMapPlacedInfoEXT'
--     structure and
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.MemoryMapPlacedInfoEXT'::@pPlacedAddress@
--     /must/ not be @NULL@
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09571# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@ and the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-memoryMapRangePlaced memoryMapRangePlaced>
--     feature is not enabled, @offset@ /must/ be zero
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09572# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@ and the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-memoryMapRangePlaced memoryMapRangePlaced>
--     feature is not enabled, @size@ /must/ be
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE' or
--     'Vulkan.Core10.Memory.MemoryAllocateInfo'::@allocationSize@
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09573# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@ and the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-memoryMapRangePlaced memoryMapRangePlaced>
--     feature is enabled, @offset@ /must/ be aligned to an integer
--     multiple of
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.PhysicalDeviceMapMemoryPlacedPropertiesEXT'::@minPlacedMemoryMapAlignment@
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09574# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@ and @size@ is not
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE', @size@ /must/ be aligned to
--     an integer multiple of
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.PhysicalDeviceMapMemoryPlacedPropertiesEXT'::@minPlacedMemoryMapAlignment@
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09651# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@ and @size@ is
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE',
--     'Vulkan.Core10.Memory.MemoryAllocateInfo'::@allocationSize@ /must/
--     be aligned to an integer multiple of
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.PhysicalDeviceMapMemoryPlacedPropertiesEXT'::@minPlacedMemoryMapAlignment@
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-09575# If
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT' is
--     set in @flags@, the memory object /must/ not have been imported from
--     a handle type of
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT'
--     or
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkMemoryMapInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR'
--
-- -   #VUID-VkMemoryMapInfoKHR-pNext-pNext# @pNext@ /must/ be @NULL@ or a
--     pointer to a valid instance of
--     'Vulkan.Extensions.VK_EXT_map_memory_placed.MemoryMapPlacedInfoEXT'
--
-- -   #VUID-VkMemoryMapInfoKHR-sType-unique# The @sType@ value of each
--     struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkMemoryMapInfoKHR-flags-parameter# @flags@ /must/ be a valid
--     combination of
--     'Vulkan.Core10.Enums.MemoryMapFlagBits.MemoryMapFlagBits' values
--
-- -   #VUID-VkMemoryMapInfoKHR-memory-parameter# @memory@ /must/ be a
--     valid 'Vulkan.Core10.Handles.DeviceMemory' handle
--
-- == Host Synchronization
--
-- -   Host access to @memory@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_map_memory2 VK_KHR_map_memory2>,
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.MemoryMapFlagBits.MemoryMapFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'mapMemory2KHR'
data MemoryMapInfoKHR (es :: [Type]) = MemoryMapInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). MemoryMapInfoKHR es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.MemoryMapFlagBits.MemoryMapFlagBits' specifying
    -- additional parameters of the memory map operation.
    forall (es :: [*]). MemoryMapInfoKHR es -> MemoryMapFlags
flags :: MemoryMapFlags
  , -- | @memory@ is the 'Vulkan.Core10.Handles.DeviceMemory' object to be
    -- mapped.
    forall (es :: [*]). MemoryMapInfoKHR es -> DeviceMemory
memory :: DeviceMemory
  , -- | @offset@ is a zero-based byte offset from the beginning of the memory
    -- object.
    forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
offset :: DeviceSize
  , -- | @size@ is the size of the memory range to map, or
    -- 'Vulkan.Core10.APIConstants.WHOLE_SIZE' to map from @offset@ to the end
    -- of the allocation.
    forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
size :: DeviceSize
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryMapInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (MemoryMapInfoKHR es)

instance Extensible MemoryMapInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"MemoryMapInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
MemoryMapInfoKHR ds -> Chain es -> MemoryMapInfoKHR es
setNext MemoryMapInfoKHR{DeviceSize
MemoryMapFlags
DeviceMemory
Chain ds
$sel:next:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> Chain es
$sel:flags:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> MemoryMapFlags
$sel:memory:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceMemory
$sel:offset:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
$sel:size:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
next :: Chain ds
flags :: MemoryMapFlags
memory :: DeviceMemory
offset :: DeviceSize
size :: DeviceSize
..} Chain es
next' = MemoryMapInfoKHR{$sel:next:MemoryMapInfoKHR :: Chain es
next = Chain es
next', DeviceSize
MemoryMapFlags
DeviceMemory
$sel:flags:MemoryMapInfoKHR :: MemoryMapFlags
$sel:memory:MemoryMapInfoKHR :: DeviceMemory
$sel:offset:MemoryMapInfoKHR :: DeviceSize
$sel:size:MemoryMapInfoKHR :: DeviceSize
flags :: MemoryMapFlags
memory :: DeviceMemory
offset :: DeviceSize
size :: DeviceSize
..}
  getNext :: forall (es :: [*]). MemoryMapInfoKHR es -> Chain es
getNext MemoryMapInfoKHR{DeviceSize
MemoryMapFlags
DeviceMemory
Chain es
$sel:next:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> Chain es
$sel:flags:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> MemoryMapFlags
$sel:memory:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceMemory
$sel:offset:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
$sel:size:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
next :: Chain es
flags :: MemoryMapFlags
memory :: DeviceMemory
offset :: DeviceSize
size :: DeviceSize
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends MemoryMapInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends MemoryMapInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends MemoryMapInfoKHR e => b
f
    | Just e :~: MemoryMapPlacedInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MemoryMapPlacedInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends MemoryMapInfoKHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss MemoryMapInfoKHR es
         , PokeChain es ) => ToCStruct (MemoryMapInfoKHR es) where
  withCStruct :: forall b.
MemoryMapInfoKHR es -> (Ptr (MemoryMapInfoKHR es) -> IO b) -> IO b
withCStruct MemoryMapInfoKHR es
x Ptr (MemoryMapInfoKHR es) -> IO b
f = Int -> (Ptr (MemoryMapInfoKHR es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (MemoryMapInfoKHR es) -> IO b) -> IO b)
-> (Ptr (MemoryMapInfoKHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (MemoryMapInfoKHR es)
p -> Ptr (MemoryMapInfoKHR es) -> MemoryMapInfoKHR es -> IO b -> IO b
forall b.
Ptr (MemoryMapInfoKHR es) -> MemoryMapInfoKHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (MemoryMapInfoKHR es)
p MemoryMapInfoKHR es
x (Ptr (MemoryMapInfoKHR es) -> IO b
f Ptr (MemoryMapInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (MemoryMapInfoKHR es) -> MemoryMapInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (MemoryMapInfoKHR es)
p MemoryMapInfoKHR{DeviceSize
MemoryMapFlags
DeviceMemory
Chain es
$sel:next:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> Chain es
$sel:flags:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> MemoryMapFlags
$sel:memory:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceMemory
$sel:offset:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
$sel:size:MemoryMapInfoKHR :: forall (es :: [*]). MemoryMapInfoKHR es -> DeviceSize
next :: Chain es
flags :: MemoryMapFlags
memory :: DeviceMemory
offset :: DeviceSize
size :: DeviceSize
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR)
    "data" ::: Ptr ()
pNext'' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b)
 -> ContT b IO ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext''
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr MemoryMapFlags -> MemoryMapFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr MemoryMapFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr MemoryMapFlags)) (MemoryMapFlags
flags)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceMemory -> DeviceMemory -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceMemory
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (DeviceMemory
memory)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (DeviceSize
offset)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) (DeviceSize
size)
    IO b -> ContT b IO b
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (MemoryMapInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (MemoryMapInfoKHR es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR)
    "data" ::: Ptr ()
pNext' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b)
 -> ContT b IO ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext'
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceMemory -> DeviceMemory -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceMemory
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (DeviceMemory
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss MemoryMapInfoKHR es
         , PeekChain es ) => FromCStruct (MemoryMapInfoKHR es) where
  peekCStruct :: Ptr (MemoryMapInfoKHR es) -> IO (MemoryMapInfoKHR es)
peekCStruct Ptr (MemoryMapInfoKHR es)
p = do
    "data" ::: Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (("data" ::: Ptr ()) -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr "data" ::: Ptr ()
pNext)
    MemoryMapFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @MemoryMapFlags ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr MemoryMapFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr MemoryMapFlags))
    DeviceMemory
memory <- forall a. Storable a => Ptr a -> IO a
peek @DeviceMemory ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceMemory
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory))
    DeviceSize
offset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
    DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (MemoryMapInfoKHR es)
p Ptr (MemoryMapInfoKHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize))
    MemoryMapInfoKHR es -> IO (MemoryMapInfoKHR es)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MemoryMapInfoKHR es -> IO (MemoryMapInfoKHR es))
-> MemoryMapInfoKHR es -> IO (MemoryMapInfoKHR es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> MemoryMapFlags
-> DeviceMemory
-> DeviceSize
-> DeviceSize
-> MemoryMapInfoKHR es
forall (es :: [*]).
Chain es
-> MemoryMapFlags
-> DeviceMemory
-> DeviceSize
-> DeviceSize
-> MemoryMapInfoKHR es
MemoryMapInfoKHR
             Chain es
next MemoryMapFlags
flags DeviceMemory
memory DeviceSize
offset DeviceSize
size

instance es ~ '[] => Zero (MemoryMapInfoKHR es) where
  zero :: MemoryMapInfoKHR es
zero = Chain es
-> MemoryMapFlags
-> DeviceMemory
-> DeviceSize
-> DeviceSize
-> MemoryMapInfoKHR es
forall (es :: [*]).
Chain es
-> MemoryMapFlags
-> DeviceMemory
-> DeviceSize
-> DeviceSize
-> MemoryMapInfoKHR es
MemoryMapInfoKHR
           ()
           MemoryMapFlags
forall a. Zero a => a
zero
           DeviceMemory
forall a. Zero a => a
zero
           DeviceSize
forall a. Zero a => a
zero
           DeviceSize
forall a. Zero a => a
zero


-- | VkMemoryUnmapInfoKHR - Structure containing parameters of a memory unmap
-- operation
--
-- == Valid Usage
--
-- -   #VUID-VkMemoryUnmapInfoKHR-memory-07964# @memory@ /must/ be
--     currently host mapped
--
-- -   #VUID-VkMemoryUnmapInfoKHR-flags-09579# If
--     'MEMORY_UNMAP_RESERVE_BIT_EXT' is set in @flags@, the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-memoryUnmapReserve memoryUnmapReserve>
--     /must/ be enabled
--
-- -   #VUID-VkMemoryUnmapInfoKHR-flags-09580# If
--     'MEMORY_UNMAP_RESERVE_BIT_EXT' is set in @flags@, the memory object
--     /must/ not have been imported from a handle type of
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT'
--     or
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkMemoryUnmapInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR'
--
-- -   #VUID-VkMemoryUnmapInfoKHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkMemoryUnmapInfoKHR-flags-parameter# @flags@ /must/ be a
--     valid combination of 'MemoryUnmapFlagBitsKHR' values
--
-- -   #VUID-VkMemoryUnmapInfoKHR-memory-parameter# @memory@ /must/ be a
--     valid 'Vulkan.Core10.Handles.DeviceMemory' handle
--
-- == Host Synchronization
--
-- -   Host access to @memory@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_map_memory2 VK_KHR_map_memory2>,
-- 'Vulkan.Core10.Handles.DeviceMemory', 'MemoryUnmapFlagsKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'unmapMemory2KHR'
data MemoryUnmapInfoKHR = MemoryUnmapInfoKHR
  { -- | @flags@ is a bitmask of 'MemoryUnmapFlagBitsKHR' specifying additional
    -- parameters of the memory map operation.
    MemoryUnmapInfoKHR -> MemoryUnmapFlagsKHR
flags :: MemoryUnmapFlagsKHR
  , -- | @memory@ is the 'Vulkan.Core10.Handles.DeviceMemory' object to be
    -- unmapped.
    MemoryUnmapInfoKHR -> DeviceMemory
memory :: DeviceMemory
  }
  deriving (Typeable, MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool
(MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool)
-> (MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool)
-> Eq MemoryUnmapInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool
== :: MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool
$c/= :: MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool
/= :: MemoryUnmapInfoKHR -> MemoryUnmapInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryUnmapInfoKHR)
#endif
deriving instance Show MemoryUnmapInfoKHR

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

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

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

instance Zero MemoryUnmapInfoKHR where
  zero :: MemoryUnmapInfoKHR
zero = MemoryUnmapFlagsKHR -> DeviceMemory -> MemoryUnmapInfoKHR
MemoryUnmapInfoKHR
           MemoryUnmapFlagsKHR
forall a. Zero a => a
zero
           DeviceMemory
forall a. Zero a => a
zero


type MemoryUnmapFlagsKHR = MemoryUnmapFlagBitsKHR

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

-- | 'MEMORY_UNMAP_RESERVE_BIT_EXT' requests that virtual address range
-- currently occupied by the memory map remain reserved after the
-- 'unmapMemory2KHR' call completes. Future system memory map operations or
-- calls to 'Vulkan.Core10.Memory.mapMemory' or 'mapMemory2KHR' will not
-- return addresses in that range unless the range has since been
-- unreserved by the application or the mapping is explicitly placed in
-- that range by calling 'mapMemory2KHR' with
-- 'Vulkan.Core10.Enums.MemoryMapFlagBits.MEMORY_MAP_PLACED_BIT_EXT', or
-- doing the system memory map equivalent. When
-- 'MEMORY_UNMAP_RESERVE_BIT_EXT' is set, the memory unmap operation /may/
-- fail, in which case the memory object will remain host mapped and
-- 'unmapMemory2KHR' will return
-- 'Vulkan.Core10.Enums.Result.ERROR_MEMORY_MAP_FAILED'.
pattern $mMEMORY_UNMAP_RESERVE_BIT_EXT :: forall {r}.
MemoryUnmapFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bMEMORY_UNMAP_RESERVE_BIT_EXT :: MemoryUnmapFlagsKHR
MEMORY_UNMAP_RESERVE_BIT_EXT = MemoryUnmapFlagBitsKHR 0x00000001

conNameMemoryUnmapFlagBitsKHR :: String
conNameMemoryUnmapFlagBitsKHR :: String
conNameMemoryUnmapFlagBitsKHR = String
"MemoryUnmapFlagBitsKHR"

enumPrefixMemoryUnmapFlagBitsKHR :: String
enumPrefixMemoryUnmapFlagBitsKHR :: String
enumPrefixMemoryUnmapFlagBitsKHR = String
"MEMORY_UNMAP_RESERVE_BIT_EXT"

showTableMemoryUnmapFlagBitsKHR :: [(MemoryUnmapFlagBitsKHR, String)]
showTableMemoryUnmapFlagBitsKHR :: [(MemoryUnmapFlagsKHR, String)]
showTableMemoryUnmapFlagBitsKHR = [(MemoryUnmapFlagsKHR
MEMORY_UNMAP_RESERVE_BIT_EXT, String
"")]

instance Show MemoryUnmapFlagBitsKHR where
  showsPrec :: Int -> MemoryUnmapFlagsKHR -> ShowS
showsPrec =
    String
-> [(MemoryUnmapFlagsKHR, String)]
-> String
-> (MemoryUnmapFlagsKHR -> Flags)
-> (Flags -> ShowS)
-> Int
-> MemoryUnmapFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixMemoryUnmapFlagBitsKHR
      [(MemoryUnmapFlagsKHR, String)]
showTableMemoryUnmapFlagBitsKHR
      String
conNameMemoryUnmapFlagBitsKHR
      (\(MemoryUnmapFlagBitsKHR Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flags -> ShowS
forall a. Integral a => a -> ShowS
showHex Flags
x)

instance Read MemoryUnmapFlagBitsKHR where
  readPrec :: ReadPrec MemoryUnmapFlagsKHR
readPrec =
    String
-> [(MemoryUnmapFlagsKHR, String)]
-> String
-> (Flags -> MemoryUnmapFlagsKHR)
-> ReadPrec MemoryUnmapFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixMemoryUnmapFlagBitsKHR
      [(MemoryUnmapFlagsKHR, String)]
showTableMemoryUnmapFlagBitsKHR
      String
conNameMemoryUnmapFlagBitsKHR
      Flags -> MemoryUnmapFlagsKHR
MemoryUnmapFlagBitsKHR

type KHR_MAP_MEMORY_2_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_MAP_MEMORY_2_SPEC_VERSION"
pattern KHR_MAP_MEMORY_2_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_MAP_MEMORY_2_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_MAP_MEMORY_2_SPEC_VERSION :: forall a. Integral a => a
KHR_MAP_MEMORY_2_SPEC_VERSION = 1


type KHR_MAP_MEMORY_2_EXTENSION_NAME = "VK_KHR_map_memory2"

-- No documentation found for TopLevel "VK_KHR_MAP_MEMORY_2_EXTENSION_NAME"
pattern KHR_MAP_MEMORY_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_MAP_MEMORY_2_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_MAP_MEMORY_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_MAP_MEMORY_2_EXTENSION_NAME = "VK_KHR_map_memory2"