{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_maintenance4"
module Vulkan.Core13.Promoted_From_VK_KHR_maintenance4  ( getDeviceBufferMemoryRequirements
                                                        , getDeviceImageMemoryRequirements
                                                        , getDeviceImageSparseMemoryRequirements
                                                        , DeviceBufferMemoryRequirements(..)
                                                        , DeviceImageMemoryRequirements(..)
                                                        , PhysicalDeviceMaintenance4Features(..)
                                                        , PhysicalDeviceMaintenance4Properties(..)
                                                        , StructureType(..)
                                                        , ImageAspectFlagBits(..)
                                                        , ImageAspectFlags
                                                        ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
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 Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Buffer (BufferCreateInfo)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceBufferMemoryRequirements))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceImageMemoryRequirements))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceImageSparseMemoryRequirements))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits)
import Vulkan.Core10.Image (ImageCreateInfo)
import Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2 (MemoryRequirements2)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2 (SparseImageMemoryRequirements2)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES))
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits(..))
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceBufferMemoryRequirements
  :: FunPtr (Ptr Device_T -> Ptr DeviceBufferMemoryRequirements -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr DeviceBufferMemoryRequirements -> Ptr (SomeStruct MemoryRequirements2) -> IO ()

-- | vkGetDeviceBufferMemoryRequirements - Returns the memory requirements
-- for specified Vulkan object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceBufferMemoryRequirements',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
getDeviceBufferMemoryRequirements :: forall a io
                                   . ( Extendss MemoryRequirements2 a
                                     , PokeChain a
                                     , PeekChain a
                                     , MonadIO io )
                                  => -- | @device@ is the logical device intended to own the buffer.
                                     --
                                     -- #VUID-vkGetDeviceBufferMemoryRequirements-device-parameter# @device@
                                     -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                     Device
                                  -> -- | @pInfo@ is a pointer to a 'DeviceBufferMemoryRequirements' structure
                                     -- containing parameters required for the memory requirements query.
                                     --
                                     -- #VUID-vkGetDeviceBufferMemoryRequirements-pInfo-parameter# @pInfo@
                                     -- /must/ be a valid pointer to a valid 'DeviceBufferMemoryRequirements'
                                     -- structure
                                     ("info" ::: DeviceBufferMemoryRequirements)
                                  -> io (MemoryRequirements2 a)
getDeviceBufferMemoryRequirements :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryRequirements2 a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device
-> DeviceBufferMemoryRequirements -> io (MemoryRequirements2 a)
getDeviceBufferMemoryRequirements Device
device DeviceBufferMemoryRequirements
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceBufferMemoryRequirementsPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceBufferMemoryRequirementsPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
      -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
      -> IO ())
pVkGetDeviceBufferMemoryRequirements (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceBufferMemoryRequirementsPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDeviceBufferMemoryRequirements is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceBufferMemoryRequirements' :: Ptr Device_T
-> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetDeviceBufferMemoryRequirements' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
mkVkGetDeviceBufferMemoryRequirements FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceBufferMemoryRequirementsPtr
  "pInfo" ::: Ptr DeviceBufferMemoryRequirements
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DeviceBufferMemoryRequirements
info)
  Ptr (MemoryRequirements2 a)
pPMemoryRequirements <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(MemoryRequirements2 _))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceBufferMemoryRequirements" (Ptr Device_T
-> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetDeviceBufferMemoryRequirements'
                                                                   (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                   "pInfo" ::: Ptr DeviceBufferMemoryRequirements
pInfo
                                                                   (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (MemoryRequirements2 a)
pPMemoryRequirements)))
  MemoryRequirements2 a
pMemoryRequirements <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(MemoryRequirements2 _) Ptr (MemoryRequirements2 a)
pPMemoryRequirements
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryRequirements2 a
pMemoryRequirements)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceImageMemoryRequirements
  :: FunPtr (Ptr Device_T -> Ptr DeviceImageMemoryRequirements -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr DeviceImageMemoryRequirements -> Ptr (SomeStruct MemoryRequirements2) -> IO ()

-- | vkGetDeviceImageMemoryRequirements - Returns the memory requirements for
-- specified Vulkan object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceImageMemoryRequirements',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
getDeviceImageMemoryRequirements :: forall a io
                                  . ( Extendss MemoryRequirements2 a
                                    , PokeChain a
                                    , PeekChain a
                                    , MonadIO io )
                                 => -- | @device@ is the logical device intended to own the image.
                                    --
                                    -- #VUID-vkGetDeviceImageMemoryRequirements-device-parameter# @device@
                                    -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                    Device
                                 -> -- | @pInfo@ is a pointer to a 'DeviceImageMemoryRequirements' structure
                                    -- containing parameters required for the memory requirements query.
                                    --
                                    -- #VUID-vkGetDeviceImageMemoryRequirements-pInfo-parameter# @pInfo@ /must/
                                    -- be a valid pointer to a valid 'DeviceImageMemoryRequirements' structure
                                    ("info" ::: DeviceImageMemoryRequirements)
                                 -> io (MemoryRequirements2 a)
getDeviceImageMemoryRequirements :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryRequirements2 a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device
-> DeviceImageMemoryRequirements -> io (MemoryRequirements2 a)
getDeviceImageMemoryRequirements Device
device DeviceImageMemoryRequirements
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceImageMemoryRequirementsPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceImageMemoryRequirementsPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
      -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
      -> IO ())
pVkGetDeviceImageMemoryRequirements (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceImageMemoryRequirementsPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDeviceImageMemoryRequirements is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceImageMemoryRequirements' :: Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetDeviceImageMemoryRequirements' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
mkVkGetDeviceImageMemoryRequirements FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetDeviceImageMemoryRequirementsPtr
  "pInfo" ::: Ptr DeviceImageMemoryRequirements
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DeviceImageMemoryRequirements
info)
  Ptr (MemoryRequirements2 a)
pPMemoryRequirements <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(MemoryRequirements2 _))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceImageMemoryRequirements" (Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetDeviceImageMemoryRequirements'
                                                                  (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                  "pInfo" ::: Ptr DeviceImageMemoryRequirements
pInfo
                                                                  (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (MemoryRequirements2 a)
pPMemoryRequirements)))
  MemoryRequirements2 a
pMemoryRequirements <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(MemoryRequirements2 _) Ptr (MemoryRequirements2 a)
pPMemoryRequirements
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryRequirements2 a
pMemoryRequirements)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceImageSparseMemoryRequirements
  :: FunPtr (Ptr Device_T -> Ptr DeviceImageMemoryRequirements -> Ptr Word32 -> Ptr SparseImageMemoryRequirements2 -> IO ()) -> Ptr Device_T -> Ptr DeviceImageMemoryRequirements -> Ptr Word32 -> Ptr SparseImageMemoryRequirements2 -> IO ()

-- | vkGetDeviceImageSparseMemoryRequirements - Query the memory requirements
-- for a sparse image
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDeviceImageSparseMemoryRequirements-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDeviceImageSparseMemoryRequirements-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'DeviceImageMemoryRequirements' structure
--
-- -   #VUID-vkGetDeviceImageSparseMemoryRequirements-pSparseMemoryRequirementCount-parameter#
--     @pSparseMemoryRequirementCount@ /must/ be a valid pointer to a
--     @uint32_t@ value
--
-- -   #VUID-vkGetDeviceImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter#
--     If the value referenced by @pSparseMemoryRequirementCount@ is not
--     @0@, and @pSparseMemoryRequirements@ is not @NULL@,
--     @pSparseMemoryRequirements@ /must/ be a valid pointer to an array of
--     @pSparseMemoryRequirementCount@
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.SparseImageMemoryRequirements2'
--     structures
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceImageMemoryRequirements',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.SparseImageMemoryRequirements2'
getDeviceImageSparseMemoryRequirements :: forall io
                                        . (MonadIO io)
                                       => -- | @device@ is the logical device intended to own the image.
                                          Device
                                       -> -- | @pInfo@ is a pointer to a 'DeviceImageMemoryRequirements' structure
                                          -- containing parameters required for the memory requirements query.
                                          ("info" ::: DeviceImageMemoryRequirements)
                                       -> io (("sparseMemoryRequirements" ::: Vector SparseImageMemoryRequirements2))
getDeviceImageSparseMemoryRequirements :: forall (io :: * -> *).
MonadIO io =>
Device
-> DeviceImageMemoryRequirements
-> io
     ("sparseMemoryRequirements"
      ::: Vector SparseImageMemoryRequirements2)
getDeviceImageSparseMemoryRequirements Device
device DeviceImageMemoryRequirements
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceImageSparseMemoryRequirementsPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
   -> ("pSparseMemoryRequirements"
       ::: Ptr SparseImageMemoryRequirements2)
   -> IO ())
vkGetDeviceImageSparseMemoryRequirementsPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
      -> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
      -> ("pSparseMemoryRequirements"
          ::: Ptr SparseImageMemoryRequirements2)
      -> IO ())
pVkGetDeviceImageSparseMemoryRequirements (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
   -> ("pSparseMemoryRequirements"
       ::: Ptr SparseImageMemoryRequirements2)
   -> IO ())
vkGetDeviceImageSparseMemoryRequirementsPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDeviceImageSparseMemoryRequirements is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceImageSparseMemoryRequirements' :: Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
-> ("pSparseMemoryRequirements"
    ::: Ptr SparseImageMemoryRequirements2)
-> IO ()
vkGetDeviceImageSparseMemoryRequirements' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
   -> ("pSparseMemoryRequirements"
       ::: Ptr SparseImageMemoryRequirements2)
   -> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
-> ("pSparseMemoryRequirements"
    ::: Ptr SparseImageMemoryRequirements2)
-> IO ()
mkVkGetDeviceImageSparseMemoryRequirements FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
   -> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
   -> ("pSparseMemoryRequirements"
       ::: Ptr SparseImageMemoryRequirements2)
   -> IO ())
vkGetDeviceImageSparseMemoryRequirementsPtr
  let device' :: Ptr Device_T
device' = Device -> Ptr Device_T
deviceHandle (Device
device)
  "pInfo" ::: Ptr DeviceImageMemoryRequirements
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DeviceImageMemoryRequirements
info)
  "pSparseMemoryRequirementCount" ::: Ptr Word32
pPSparseMemoryRequirementCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceImageSparseMemoryRequirements" (Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
-> ("pSparseMemoryRequirements"
    ::: Ptr SparseImageMemoryRequirements2)
-> IO ()
vkGetDeviceImageSparseMemoryRequirements'
                                                                        Ptr Device_T
device'
                                                                        "pInfo" ::: Ptr DeviceImageMemoryRequirements
pInfo
                                                                        ("pSparseMemoryRequirementCount" ::: Ptr Word32
pPSparseMemoryRequirementCount)
                                                                        (forall a. Ptr a
nullPtr))
  Word32
pSparseMemoryRequirementCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSparseMemoryRequirementCount" ::: Ptr Word32
pPSparseMemoryRequirementCount
  "pSparseMemoryRequirements" ::: Ptr SparseImageMemoryRequirements2
pPSparseMemoryRequirements <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @SparseImageMemoryRequirements2 ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pSparseMemoryRequirementCount)) forall a. Num a => a -> a -> a
* Int
64)) forall a. Ptr a -> IO ()
free
  [()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pSparseMemoryRequirements" ::: Ptr SparseImageMemoryRequirements2
pPSparseMemoryRequirements forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
64) :: Ptr SparseImageMemoryRequirements2) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pSparseMemoryRequirementCount)) forall a. Num a => a -> a -> a
- Int
1]
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceImageSparseMemoryRequirements" (Ptr Device_T
-> ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> ("pSparseMemoryRequirementCount" ::: Ptr Word32)
-> ("pSparseMemoryRequirements"
    ::: Ptr SparseImageMemoryRequirements2)
-> IO ()
vkGetDeviceImageSparseMemoryRequirements'
                                                                        Ptr Device_T
device'
                                                                        "pInfo" ::: Ptr DeviceImageMemoryRequirements
pInfo
                                                                        ("pSparseMemoryRequirementCount" ::: Ptr Word32
pPSparseMemoryRequirementCount)
                                                                        (("pSparseMemoryRequirements" ::: Ptr SparseImageMemoryRequirements2
pPSparseMemoryRequirements)))
  Word32
pSparseMemoryRequirementCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pSparseMemoryRequirementCount" ::: Ptr Word32
pPSparseMemoryRequirementCount
  "sparseMemoryRequirements"
::: Vector SparseImageMemoryRequirements2
pSparseMemoryRequirements' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pSparseMemoryRequirementCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SparseImageMemoryRequirements2 ((("pSparseMemoryRequirements" ::: Ptr SparseImageMemoryRequirements2
pPSparseMemoryRequirements) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SparseImageMemoryRequirements2)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("sparseMemoryRequirements"
::: Vector SparseImageMemoryRequirements2
pSparseMemoryRequirements')


-- | VkDeviceBufferMemoryRequirements - (None)
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.Buffer.BufferCreateInfo',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceBufferMemoryRequirements',
-- 'Vulkan.Extensions.VK_KHR_maintenance4.getDeviceBufferMemoryRequirementsKHR'
data DeviceBufferMemoryRequirements = DeviceBufferMemoryRequirements
  { -- | @pCreateInfo@ is a pointer to a 'Vulkan.Core10.Buffer.BufferCreateInfo'
    -- structure containing parameters affecting creation of the buffer to
    -- query.
    --
    -- #VUID-VkDeviceBufferMemoryRequirements-pCreateInfo-parameter#
    -- @pCreateInfo@ /must/ be a valid pointer to a valid
    -- 'Vulkan.Core10.Buffer.BufferCreateInfo' structure
    DeviceBufferMemoryRequirements -> SomeStruct BufferCreateInfo
createInfo :: SomeStruct BufferCreateInfo }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceBufferMemoryRequirements)
#endif
deriving instance Show DeviceBufferMemoryRequirements

instance ToCStruct DeviceBufferMemoryRequirements where
  withCStruct :: forall b.
DeviceBufferMemoryRequirements
-> (("pInfo" ::: Ptr DeviceBufferMemoryRequirements) -> IO b)
-> IO b
withCStruct DeviceBufferMemoryRequirements
x ("pInfo" ::: Ptr DeviceBufferMemoryRequirements) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \"pInfo" ::: Ptr DeviceBufferMemoryRequirements
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceBufferMemoryRequirements
p DeviceBufferMemoryRequirements
x (("pInfo" ::: Ptr DeviceBufferMemoryRequirements) -> IO b
f "pInfo" ::: Ptr DeviceBufferMemoryRequirements
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
-> DeviceBufferMemoryRequirements -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceBufferMemoryRequirements
p DeviceBufferMemoryRequirements{SomeStruct BufferCreateInfo
createInfo :: SomeStruct BufferCreateInfo
$sel:createInfo:DeviceBufferMemoryRequirements :: DeviceBufferMemoryRequirements -> SomeStruct BufferCreateInfo
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    Ptr (BufferCreateInfo '[])
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (BufferCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (BufferCreateInfo '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @BufferCreateInfo (SomeStruct BufferCreateInfo
createInfo) (Ptr (BufferCreateInfo '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (BufferCreateInfo _)))) Ptr (BufferCreateInfo '[])
pCreateInfo''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pInfo" ::: Ptr DeviceBufferMemoryRequirements) -> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr DeviceBufferMemoryRequirements
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    Ptr (BufferCreateInfo '[])
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (BufferCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (BufferCreateInfo '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @BufferCreateInfo ((forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)) (Ptr (BufferCreateInfo '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (BufferCreateInfo _)))) Ptr (BufferCreateInfo '[])
pCreateInfo''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct DeviceBufferMemoryRequirements where
  peekCStruct :: ("pInfo" ::: Ptr DeviceBufferMemoryRequirements)
-> IO DeviceBufferMemoryRequirements
peekCStruct "pInfo" ::: Ptr DeviceBufferMemoryRequirements
p = do
    SomeStruct BufferCreateInfo
pCreateInfo <- forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall a. Storable a => Ptr a -> IO a
peek (("pInfo" ::: Ptr DeviceBufferMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (BufferCreateInfo _))))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SomeStruct BufferCreateInfo -> DeviceBufferMemoryRequirements
DeviceBufferMemoryRequirements
             SomeStruct BufferCreateInfo
pCreateInfo

instance Zero DeviceBufferMemoryRequirements where
  zero :: DeviceBufferMemoryRequirements
zero = SomeStruct BufferCreateInfo -> DeviceBufferMemoryRequirements
DeviceBufferMemoryRequirements
           (forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)


-- | VkDeviceImageMemoryRequirements - (None)
--
-- == Valid Usage
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-06416# The
--     @pCreateInfo@::@pNext@ chain /must/ not contain a
--     'Vulkan.Extensions.VK_KHR_swapchain.ImageSwapchainCreateInfoKHR'
--     structure
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-06776# The
--     @pCreateInfo@::@pNext@ chain /must/ not contain a
--     'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierExplicitCreateInfoEXT'
--     structure
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pNext-06996# Applications also
--     /must/ not call 'getDeviceImageMemoryRequirements' with a
--     'Vulkan.Core10.Image.ImageCreateInfo' whose @pNext@ chain includes a
--     'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID'
--     structure with non-zero @externalFormat@
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pNext-08962# Applications also
--     /must/ not call 'getDeviceImageMemoryRequirements' with a
--     'Vulkan.Core10.Image.ImageCreateInfo' whose @pNext@ chain includes a
--     'Vulkan.Extensions.VK_QNX_external_memory_screen_buffer.ExternalFormatQNX'
--     structure with non-zero @externalFormat@
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-06417# If
--     @pCreateInfo@::@format@ specifies a /multi-planar/ format and
--     @pCreateInfo@::@flags@ has
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_DISJOINT_BIT'
--     set then @planeAspect@ /must/ not be
--     'Vulkan.Extensions.VK_KHR_maintenance4.IMAGE_ASPECT_NONE_KHR'
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-06419# If
--     @pCreateInfo@::@flags@ has
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_DISJOINT_BIT'
--     set and if the @pCreateInfo@::@tiling@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' or
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL', then
--     @planeAspect@ /must/ be a single valid
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-planes-image-aspect multi-planar aspect mask>
--     bit
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-06420# If
--     @pCreateInfo@::@tiling@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT',
--     then @planeAspect@ /must/ be a single valid /memory plane/ for the
--     image (that is, @aspectMask@ /must/ specify a plane index that is
--     less than the
--     'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.DrmFormatModifierPropertiesEXT'::@drmFormatModifierPlaneCount@
--     associated with the image’s @format@ and
--     'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierPropertiesEXT'::@drmFormatModifier@)
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDeviceImageMemoryRequirements-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS'
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkDeviceImageMemoryRequirements-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.Image.ImageCreateInfo' structure
--
-- -   #VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter# If
--     @planeAspect@ is not @0@, @planeAspect@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits',
-- 'Vulkan.Core10.Image.ImageCreateInfo',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceImageMemoryRequirements',
-- 'Vulkan.Extensions.VK_KHR_maintenance4.getDeviceImageMemoryRequirementsKHR',
-- 'getDeviceImageSparseMemoryRequirements',
-- 'Vulkan.Extensions.VK_KHR_maintenance4.getDeviceImageSparseMemoryRequirementsKHR'
data DeviceImageMemoryRequirements = DeviceImageMemoryRequirements
  { -- | @pCreateInfo@ is a pointer to a 'Vulkan.Core10.Image.ImageCreateInfo'
    -- structure containing parameters affecting creation of the image to
    -- query.
    DeviceImageMemoryRequirements -> SomeStruct ImageCreateInfo
createInfo :: SomeStruct ImageCreateInfo
  , -- | @planeAspect@ is a
    -- 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits' value
    -- specifying the aspect corresponding to the image plane to query. This
    -- parameter is ignored unless @pCreateInfo@::@tiling@ is
    -- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT',
    -- or @pCreateInfo@::@flags@ has
    -- 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_DISJOINT_BIT' set.
    DeviceImageMemoryRequirements -> ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceImageMemoryRequirements)
#endif
deriving instance Show DeviceImageMemoryRequirements

instance ToCStruct DeviceImageMemoryRequirements where
  withCStruct :: forall b.
DeviceImageMemoryRequirements
-> (("pInfo" ::: Ptr DeviceImageMemoryRequirements) -> IO b)
-> IO b
withCStruct DeviceImageMemoryRequirements
x ("pInfo" ::: Ptr DeviceImageMemoryRequirements) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pInfo" ::: Ptr DeviceImageMemoryRequirements
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceImageMemoryRequirements
p DeviceImageMemoryRequirements
x (("pInfo" ::: Ptr DeviceImageMemoryRequirements) -> IO b
f "pInfo" ::: Ptr DeviceImageMemoryRequirements
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> DeviceImageMemoryRequirements -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceImageMemoryRequirements
p DeviceImageMemoryRequirements{ImageAspectFlagBits
SomeStruct ImageCreateInfo
planeAspect :: ImageAspectFlagBits
createInfo :: SomeStruct ImageCreateInfo
$sel:planeAspect:DeviceImageMemoryRequirements :: DeviceImageMemoryRequirements -> ImageAspectFlagBits
$sel:createInfo:DeviceImageMemoryRequirements :: DeviceImageMemoryRequirements -> SomeStruct ImageCreateInfo
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    Ptr (ImageCreateInfo '[])
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (ImageCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (ImageCreateInfo '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @ImageCreateInfo (SomeStruct ImageCreateInfo
createInfo) (Ptr (ImageCreateInfo '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (ImageCreateInfo _)))) Ptr (ImageCreateInfo '[])
pCreateInfo''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
planeAspect)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pInfo" ::: Ptr DeviceImageMemoryRequirements) -> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr DeviceImageMemoryRequirements
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    Ptr (ImageCreateInfo '[])
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (ImageCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (ImageCreateInfo '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @ImageCreateInfo ((forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)) (Ptr (ImageCreateInfo '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (ImageCreateInfo _)))) Ptr (ImageCreateInfo '[])
pCreateInfo''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct DeviceImageMemoryRequirements where
  peekCStruct :: ("pInfo" ::: Ptr DeviceImageMemoryRequirements)
-> IO DeviceImageMemoryRequirements
peekCStruct "pInfo" ::: Ptr DeviceImageMemoryRequirements
p = do
    SomeStruct ImageCreateInfo
pCreateInfo <- forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall a. Storable a => Ptr a -> IO a
peek (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (ImageCreateInfo _))))
    ImageAspectFlagBits
planeAspect <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits (("pInfo" ::: Ptr DeviceImageMemoryRequirements
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageAspectFlagBits))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SomeStruct ImageCreateInfo
-> ImageAspectFlagBits -> DeviceImageMemoryRequirements
DeviceImageMemoryRequirements
             SomeStruct ImageCreateInfo
pCreateInfo ImageAspectFlagBits
planeAspect

instance Zero DeviceImageMemoryRequirements where
  zero :: DeviceImageMemoryRequirements
zero = SomeStruct ImageCreateInfo
-> ImageAspectFlagBits -> DeviceImageMemoryRequirements
DeviceImageMemoryRequirements
           (forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)
           forall a. Zero a => a
zero


-- | VkPhysicalDeviceMaintenance4Features - Structure describing whether the
-- implementation supports maintenance4 functionality
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance4Features' structure is included in the
-- @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceMaintenance4Features' /can/ also be used in
-- the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance4Features = PhysicalDeviceMaintenance4Features
  { -- | #extension-features-maintenance4# @maintenance4@ indicates that the
    -- implementation supports the following:
    --
    -- -   The application /may/ destroy a
    --     'Vulkan.Core10.Handles.PipelineLayout' object immediately after
    --     using it to create another object.
    --
    -- -   @LocalSizeId@ /can/ be used as an alternative to @LocalSize@ to
    --     specify the local workgroup size with specialization constants.
    --
    -- -   Images created with identical creation parameters will always have
    --     the same alignment requirements.
    --
    -- -   The size memory requirement of a buffer or image is never greater
    --     than that of another buffer or image created with a greater or equal
    --     size.
    --
    -- -   Push constants do not have to be initialized before they are
    --     dynamically accessed.
    --
    -- -   The interface matching rules allow a larger output vector to match
    --     with a smaller input vector, with additional values being discarded.
    PhysicalDeviceMaintenance4Features -> Bool
maintenance4 :: Bool }
  deriving (Typeable, PhysicalDeviceMaintenance4Features
-> PhysicalDeviceMaintenance4Features -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceMaintenance4Features
-> PhysicalDeviceMaintenance4Features -> Bool
$c/= :: PhysicalDeviceMaintenance4Features
-> PhysicalDeviceMaintenance4Features -> Bool
== :: PhysicalDeviceMaintenance4Features
-> PhysicalDeviceMaintenance4Features -> Bool
$c== :: PhysicalDeviceMaintenance4Features
-> PhysicalDeviceMaintenance4Features -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance4Features)
#endif
deriving instance Show PhysicalDeviceMaintenance4Features

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

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

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

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


-- | VkPhysicalDeviceMaintenance4Properties - Structure describing various
-- implementation-defined properties introduced with VK_KHR_maintenance4
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance4Properties' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance4 VK_KHR_maintenance4>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_3 VK_VERSION_1_3>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance4Properties = PhysicalDeviceMaintenance4Properties
  { -- | #extension-limits-maxBufferSize# @maxBufferSize@ is the maximum size
    -- 'Vulkan.Core10.Handles.Buffer' that /can/ be created.
    PhysicalDeviceMaintenance4Properties -> DeviceSize
maxBufferSize :: DeviceSize }
  deriving (Typeable, PhysicalDeviceMaintenance4Properties
-> PhysicalDeviceMaintenance4Properties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceMaintenance4Properties
-> PhysicalDeviceMaintenance4Properties -> Bool
$c/= :: PhysicalDeviceMaintenance4Properties
-> PhysicalDeviceMaintenance4Properties -> Bool
== :: PhysicalDeviceMaintenance4Properties
-> PhysicalDeviceMaintenance4Properties -> Bool
$c== :: PhysicalDeviceMaintenance4Properties
-> PhysicalDeviceMaintenance4Properties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance4Properties)
#endif
deriving instance Show PhysicalDeviceMaintenance4Properties

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

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

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

instance Zero PhysicalDeviceMaintenance4Properties where
  zero :: PhysicalDeviceMaintenance4Properties
zero = DeviceSize -> PhysicalDeviceMaintenance4Properties
PhysicalDeviceMaintenance4Properties
           forall a. Zero a => a
zero