{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_buffer_device_address"
module Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address  ( getBufferOpaqueCaptureAddress
                                                                 , getBufferDeviceAddress
                                                                 , getDeviceMemoryOpaqueCaptureAddress
                                                                 , PhysicalDeviceBufferDeviceAddressFeatures(..)
                                                                 , BufferDeviceAddressInfo(..)
                                                                 , BufferOpaqueCaptureAddressCreateInfo(..)
                                                                 , MemoryOpaqueCaptureAddressAllocateInfo(..)
                                                                 , DeviceMemoryOpaqueCaptureAddressInfo(..)
                                                                 , StructureType(..)
                                                                 , Result(..)
                                                                 , BufferUsageFlagBits(..)
                                                                 , BufferUsageFlags
                                                                 , BufferCreateFlagBits(..)
                                                                 , BufferCreateFlags
                                                                 , MemoryAllocateFlagBits(..)
                                                                 , MemoryAllocateFlags
                                                                 ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
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 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 (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkGetBufferDeviceAddress))
import Vulkan.Dynamic (DeviceCmds(pVkGetBufferOpaqueCaptureAddress))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceMemoryOpaqueCaptureAddress))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES))
import Vulkan.Core10.Enums.BufferCreateFlagBits (BufferCreateFlagBits(..))
import Vulkan.Core10.Enums.BufferCreateFlagBits (BufferCreateFlags)
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlagBits(..))
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlags)
import Vulkan.Core11.Enums.MemoryAllocateFlagBits (MemoryAllocateFlagBits(..))
import Vulkan.Core11.Enums.MemoryAllocateFlagBits (MemoryAllocateFlags)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetBufferOpaqueCaptureAddress
  :: FunPtr (Ptr Device_T -> Ptr BufferDeviceAddressInfo -> IO Word64) -> Ptr Device_T -> Ptr BufferDeviceAddressInfo -> IO Word64

-- | vkGetBufferOpaqueCaptureAddress - Query an opaque capture address of a
-- buffer
--
-- = Description
--
-- The 64-bit return value is an opaque capture address of the start of
-- @pInfo->buffer@.
--
-- If the buffer was created with a non-zero value of
-- 'BufferOpaqueCaptureAddressCreateInfo'::@opaqueCaptureAddress@ the
-- return value /must/ be the same address.
--
-- == Valid Usage
--
-- -   #VUID-vkGetBufferOpaqueCaptureAddress-None-03326# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddress bufferDeviceAddress>
--     feature /must/ be enabled
--
-- -   #VUID-vkGetBufferOpaqueCaptureAddress-device-03327# If @device@ was
--     created with multiple physical devices, then the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetBufferOpaqueCaptureAddress-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetBufferOpaqueCaptureAddress-pInfo-parameter# @pInfo@
--     /must/ be a valid pointer to a valid 'BufferDeviceAddressInfo'
--     structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'BufferDeviceAddressInfo', 'Vulkan.Core10.Handles.Device'
getBufferOpaqueCaptureAddress :: forall io
                               . (MonadIO io)
                              => -- | @device@ is the logical device that the buffer was created on.
                                 Device
                              -> -- | @pInfo@ is a pointer to a 'BufferDeviceAddressInfo' structure specifying
                                 -- the buffer to retrieve an address for.
                                 BufferDeviceAddressInfo
                              -> io (Word64)
getBufferOpaqueCaptureAddress :: forall (io :: * -> *).
MonadIO io =>
Device -> BufferDeviceAddressInfo -> io Word64
getBufferOpaqueCaptureAddress Device
device BufferDeviceAddressInfo
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 vkGetBufferOpaqueCaptureAddressPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferOpaqueCaptureAddressPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
pVkGetBufferOpaqueCaptureAddress (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 BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferOpaqueCaptureAddressPtr 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 vkGetBufferOpaqueCaptureAddress is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetBufferOpaqueCaptureAddress' :: Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64
vkGetBufferOpaqueCaptureAddress' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
-> Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo)
-> IO Word64
mkVkGetBufferOpaqueCaptureAddress FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferOpaqueCaptureAddressPtr
  "pInfo" ::: Ptr BufferDeviceAddressInfo
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 (BufferDeviceAddressInfo
info)
  Word64
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetBufferOpaqueCaptureAddress" (Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64
vkGetBufferOpaqueCaptureAddress'
                                                                    (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                    "pInfo" ::: Ptr BufferDeviceAddressInfo
pInfo)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Word64
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetBufferDeviceAddress
  :: FunPtr (Ptr Device_T -> Ptr BufferDeviceAddressInfo -> IO DeviceAddress) -> Ptr Device_T -> Ptr BufferDeviceAddressInfo -> IO DeviceAddress

-- | vkGetBufferDeviceAddress - Query an address of a buffer
--
-- = Description
--
-- The 64-bit return value is an address of the start of @pInfo->buffer@.
-- The address range starting at this value and whose size is the size of
-- the buffer /can/ be used in a shader to access the memory bound to that
-- buffer, using the @SPV_KHR_physical_storage_buffer@ extension or the
-- equivalent @SPV_EXT_physical_storage_buffer@ extension and the
-- @PhysicalStorageBuffer@ storage class. For example, this value /can/ be
-- stored in a uniform buffer, and the shader /can/ read the value from the
-- uniform buffer and use it to do a dependent read\/write to this buffer.
-- A value of zero is reserved as a “null” pointer and /must/ not be
-- returned as a valid buffer device address. All loads, stores, and
-- atomics in a shader through @PhysicalStorageBuffer@ pointers /must/
-- access addresses in the address range of some buffer.
--
-- If the buffer was created with a non-zero value of
-- 'BufferOpaqueCaptureAddressCreateInfo'::@opaqueCaptureAddress@ or
-- 'Vulkan.Extensions.VK_EXT_buffer_device_address.BufferDeviceAddressCreateInfoEXT'::@deviceAddress@,
-- the return value will be the same address that was returned at capture
-- time.
--
-- The returned address /must/ satisfy the alignment requirement specified
-- by 'Vulkan.Core10.MemoryManagement.MemoryRequirements'::@alignment@ for
-- the buffer in 'BufferDeviceAddressInfo'::@buffer@.
--
-- If multiple 'Vulkan.Core10.Handles.Buffer' objects are bound to
-- overlapping ranges of 'Vulkan.Core10.Handles.DeviceMemory',
-- implementations /may/ return address ranges which overlap. In this case,
-- it is ambiguous which 'Vulkan.Core10.Handles.Buffer' is associated with
-- any given device address. For purposes of valid usage, if multiple
-- 'Vulkan.Core10.Handles.Buffer' objects /can/ be attributed to a device
-- address, a 'Vulkan.Core10.Handles.Buffer' is selected such that valid
-- usage passes, if it exists.
--
-- == Valid Usage
--
-- -   #VUID-vkGetBufferDeviceAddress-bufferDeviceAddress-03324# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddress bufferDeviceAddress>
--     or
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddressEXT ::bufferDeviceAddress>
--     feature /must/ be enabled
--
-- -   #VUID-vkGetBufferDeviceAddress-device-03325# If @device@ was created
--     with multiple physical devices, then the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     or
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDeviceEXT ::bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetBufferDeviceAddress-device-parameter# @device@ /must/ be
--     a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetBufferDeviceAddress-pInfo-parameter# @pInfo@ /must/ be a
--     valid pointer to a valid 'BufferDeviceAddressInfo' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'BufferDeviceAddressInfo', 'Vulkan.Core10.Handles.Device'
getBufferDeviceAddress :: forall io
                        . (MonadIO io)
                       => -- | @device@ is the logical device that the buffer was created on.
                          Device
                       -> -- | @pInfo@ is a pointer to a 'BufferDeviceAddressInfo' structure specifying
                          -- the buffer to retrieve an address for.
                          BufferDeviceAddressInfo
                       -> io (DeviceAddress)
getBufferDeviceAddress :: forall (io :: * -> *).
MonadIO io =>
Device -> BufferDeviceAddressInfo -> io Word64
getBufferDeviceAddress Device
device BufferDeviceAddressInfo
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 vkGetBufferDeviceAddressPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferDeviceAddressPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
pVkGetBufferDeviceAddress (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 BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferDeviceAddressPtr 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 vkGetBufferDeviceAddress is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetBufferDeviceAddress' :: Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64
vkGetBufferDeviceAddress' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
-> Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo)
-> IO Word64
mkVkGetBufferDeviceAddress FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64)
vkGetBufferDeviceAddressPtr
  "pInfo" ::: Ptr BufferDeviceAddressInfo
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 (BufferDeviceAddressInfo
info)
  Word64
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetBufferDeviceAddress" (Ptr Device_T
-> ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO Word64
vkGetBufferDeviceAddress'
                                                             (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                             "pInfo" ::: Ptr BufferDeviceAddressInfo
pInfo)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Word64
r)


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

-- | vkGetDeviceMemoryOpaqueCaptureAddress - Query an opaque capture address
-- of a memory object
--
-- = Description
--
-- The 64-bit return value is an opaque address representing the start of
-- @pInfo->memory@.
--
-- If the memory object was allocated with a non-zero value of
-- 'MemoryOpaqueCaptureAddressAllocateInfo'::@opaqueCaptureAddress@, the
-- return value /must/ be the same address.
--
-- Note
--
-- The expected usage for these opaque addresses is only for trace
-- capture\/replay tools to store these addresses in a trace and
-- subsequently specify them during replay.
--
-- == Valid Usage
--
-- -   #VUID-vkGetDeviceMemoryOpaqueCaptureAddress-None-03334# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddress bufferDeviceAddress>
--     feature /must/ be enabled
--
-- -   #VUID-vkGetDeviceMemoryOpaqueCaptureAddress-device-03335# If
--     @device@ was created with multiple physical devices, then the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDeviceMemoryOpaqueCaptureAddress-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDeviceMemoryOpaqueCaptureAddress-pInfo-parameter# @pInfo@
--     /must/ be a valid pointer to a valid
--     'DeviceMemoryOpaqueCaptureAddressInfo' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceMemoryOpaqueCaptureAddressInfo'
getDeviceMemoryOpaqueCaptureAddress :: forall io
                                     . (MonadIO io)
                                    => -- | @device@ is the logical device that the memory object was allocated on.
                                       Device
                                    -> -- | @pInfo@ is a pointer to a 'DeviceMemoryOpaqueCaptureAddressInfo'
                                       -- structure specifying the memory object to retrieve an address for.
                                       DeviceMemoryOpaqueCaptureAddressInfo
                                    -> io (Word64)
getDeviceMemoryOpaqueCaptureAddress :: forall (io :: * -> *).
MonadIO io =>
Device -> DeviceMemoryOpaqueCaptureAddressInfo -> io Word64
getDeviceMemoryOpaqueCaptureAddress Device
device DeviceMemoryOpaqueCaptureAddressInfo
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 vkGetDeviceMemoryOpaqueCaptureAddressPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
   -> IO Word64)
vkGetDeviceMemoryOpaqueCaptureAddressPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
      -> IO Word64)
pVkGetDeviceMemoryOpaqueCaptureAddress (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 DeviceMemoryOpaqueCaptureAddressInfo)
   -> IO Word64)
vkGetDeviceMemoryOpaqueCaptureAddressPtr 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 vkGetDeviceMemoryOpaqueCaptureAddress is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceMemoryOpaqueCaptureAddress' :: Ptr Device_T
-> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
-> IO Word64
vkGetDeviceMemoryOpaqueCaptureAddress' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
   -> IO Word64)
-> Ptr Device_T
-> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
-> IO Word64
mkVkGetDeviceMemoryOpaqueCaptureAddress FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
   -> IO Word64)
vkGetDeviceMemoryOpaqueCaptureAddressPtr
  "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
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 (DeviceMemoryOpaqueCaptureAddressInfo
info)
  Word64
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceMemoryOpaqueCaptureAddress" (Ptr Device_T
-> ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
-> IO Word64
vkGetDeviceMemoryOpaqueCaptureAddress'
                                                                          (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                          "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
pInfo)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Word64
r)


-- | VkPhysicalDeviceBufferDeviceAddressFeatures - Structure describing
-- buffer address features that can be supported by an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- Note
--
-- @bufferDeviceAddressMultiDevice@ exists to allow certain legacy
-- platforms to be able to support @bufferDeviceAddress@ without needing to
-- support shared GPU virtual addresses for multi-device configurations.
--
-- See 'getBufferDeviceAddress' for more information.
--
-- If the 'PhysicalDeviceBufferDeviceAddressFeatures' 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. 'PhysicalDeviceBufferDeviceAddressFeatures' /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_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceBufferDeviceAddressFeatures = PhysicalDeviceBufferDeviceAddressFeatures
  { -- | #extension-features-bufferDeviceAddress# @bufferDeviceAddress@ indicates
    -- that the implementation supports accessing buffer memory in shaders as
    -- storage buffers via an address queried from 'getBufferDeviceAddress'.
    PhysicalDeviceBufferDeviceAddressFeatures -> Bool
bufferDeviceAddress :: Bool
  , -- | #extension-features-bufferDeviceAddressCaptureReplay#
    -- @bufferDeviceAddressCaptureReplay@ indicates that the implementation
    -- supports saving and reusing buffer and device addresses, e.g. for trace
    -- capture and replay.
    PhysicalDeviceBufferDeviceAddressFeatures -> Bool
bufferDeviceAddressCaptureReplay :: Bool
  , -- | #extension-features-bufferDeviceAddressMultiDevice#
    -- @bufferDeviceAddressMultiDevice@ indicates that the implementation
    -- supports the @bufferDeviceAddress@ , @rayTracingPipeline@ and @rayQuery@
    -- features for logical devices created with multiple physical devices. If
    -- this feature is not supported, buffer and acceleration structure
    -- addresses /must/ not be queried on a logical device created with more
    -- than one physical device.
    PhysicalDeviceBufferDeviceAddressFeatures -> Bool
bufferDeviceAddressMultiDevice :: Bool
  }
  deriving (Typeable, PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> Bool
$c/= :: PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> Bool
== :: PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> Bool
$c== :: PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceBufferDeviceAddressFeatures)
#endif
deriving instance Show PhysicalDeviceBufferDeviceAddressFeatures

instance ToCStruct PhysicalDeviceBufferDeviceAddressFeatures where
  withCStruct :: forall b.
PhysicalDeviceBufferDeviceAddressFeatures
-> (Ptr PhysicalDeviceBufferDeviceAddressFeatures -> IO b) -> IO b
withCStruct PhysicalDeviceBufferDeviceAddressFeatures
x Ptr PhysicalDeviceBufferDeviceAddressFeatures -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceBufferDeviceAddressFeatures
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBufferDeviceAddressFeatures
p PhysicalDeviceBufferDeviceAddressFeatures
x (Ptr PhysicalDeviceBufferDeviceAddressFeatures -> IO b
f Ptr PhysicalDeviceBufferDeviceAddressFeatures
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceBufferDeviceAddressFeatures
-> PhysicalDeviceBufferDeviceAddressFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBufferDeviceAddressFeatures
p PhysicalDeviceBufferDeviceAddressFeatures{Bool
bufferDeviceAddressMultiDevice :: Bool
bufferDeviceAddressCaptureReplay :: Bool
bufferDeviceAddress :: Bool
$sel:bufferDeviceAddressMultiDevice:PhysicalDeviceBufferDeviceAddressFeatures :: PhysicalDeviceBufferDeviceAddressFeatures -> Bool
$sel:bufferDeviceAddressCaptureReplay:PhysicalDeviceBufferDeviceAddressFeatures :: PhysicalDeviceBufferDeviceAddressFeatures -> Bool
$sel:bufferDeviceAddress:PhysicalDeviceBufferDeviceAddressFeatures :: PhysicalDeviceBufferDeviceAddressFeatures -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
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 PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
bufferDeviceAddress))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
bufferDeviceAddressCaptureReplay))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
bufferDeviceAddressMultiDevice))
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceBufferDeviceAddressFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceBufferDeviceAddressFeatures
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
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 PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    IO b
f

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

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

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


-- | VkBufferDeviceAddressInfo - Structure specifying the buffer to query an
-- address for
--
-- == Valid Usage
--
-- -   #VUID-VkBufferDeviceAddressInfo-buffer-02600# If @buffer@ is
--     non-sparse and was not created with the
--     'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT'
--     flag, then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkBufferDeviceAddressInfo-buffer-02601# @buffer@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBufferDeviceAddressInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO'
--
-- -   #VUID-VkBufferDeviceAddressInfo-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkBufferDeviceAddressInfo-buffer-parameter# @buffer@ /must/ be
--     a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getBufferDeviceAddress',
-- 'Vulkan.Extensions.VK_EXT_buffer_device_address.getBufferDeviceAddressEXT',
-- 'Vulkan.Extensions.VK_KHR_buffer_device_address.getBufferDeviceAddressKHR',
-- 'getBufferOpaqueCaptureAddress',
-- 'Vulkan.Extensions.VK_KHR_buffer_device_address.getBufferOpaqueCaptureAddressKHR'
data BufferDeviceAddressInfo = BufferDeviceAddressInfo
  { -- | @buffer@ specifies the buffer whose address is being queried.
    BufferDeviceAddressInfo -> Buffer
buffer :: Buffer }
  deriving (Typeable, BufferDeviceAddressInfo -> BufferDeviceAddressInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferDeviceAddressInfo -> BufferDeviceAddressInfo -> Bool
$c/= :: BufferDeviceAddressInfo -> BufferDeviceAddressInfo -> Bool
== :: BufferDeviceAddressInfo -> BufferDeviceAddressInfo -> Bool
$c== :: BufferDeviceAddressInfo -> BufferDeviceAddressInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferDeviceAddressInfo)
#endif
deriving instance Show BufferDeviceAddressInfo

instance ToCStruct BufferDeviceAddressInfo where
  withCStruct :: forall b.
BufferDeviceAddressInfo
-> (("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO b) -> IO b
withCStruct BufferDeviceAddressInfo
x ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> 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 BufferDeviceAddressInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr BufferDeviceAddressInfo
p BufferDeviceAddressInfo
x (("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO b
f "pInfo" ::: Ptr BufferDeviceAddressInfo
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr BufferDeviceAddressInfo)
-> BufferDeviceAddressInfo -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr BufferDeviceAddressInfo
p BufferDeviceAddressInfo{Buffer
buffer :: Buffer
$sel:buffer:BufferDeviceAddressInfo :: BufferDeviceAddressInfo -> Buffer
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr BufferDeviceAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr BufferDeviceAddressInfo
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 (("pInfo" ::: Ptr BufferDeviceAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (Buffer
buffer)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. ("pInfo" ::: Ptr BufferDeviceAddressInfo) -> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr BufferDeviceAddressInfo
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr BufferDeviceAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr BufferDeviceAddressInfo
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 (("pInfo" ::: Ptr BufferDeviceAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (forall a. Zero a => a
zero)
    IO b
f

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

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

instance Zero BufferDeviceAddressInfo where
  zero :: BufferDeviceAddressInfo
zero = Buffer -> BufferDeviceAddressInfo
BufferDeviceAddressInfo
           forall a. Zero a => a
zero


-- | VkBufferOpaqueCaptureAddressCreateInfo - Request a specific address for
-- a buffer
--
-- = Description
--
-- If @opaqueCaptureAddress@ is zero, no specific address is requested.
--
-- If @opaqueCaptureAddress@ is not zero, then it /should/ be an address
-- retrieved from 'getBufferOpaqueCaptureAddress' for an identically
-- created buffer on the same implementation.
--
-- If this structure is not present, it is as if @opaqueCaptureAddress@ is
-- zero.
--
-- Apps /should/ avoid creating buffers with app-provided addresses and
-- implementation-provided addresses in the same process, to reduce the
-- likelihood of
-- 'Vulkan.Core10.Enums.Result.ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS'
-- errors.
--
-- Note
--
-- The expected usage for this is that a trace capture\/replay tool will
-- add the
-- 'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT'
-- flag to all buffers that use
-- 'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT',
-- and during capture will save the queried opaque device addresses in the
-- trace. During replay, the buffers will be created specifying the
-- original address so any address values stored in the trace data will
-- remain valid.
--
-- Implementations are expected to separate such buffers in the GPU address
-- space so normal allocations will avoid using these addresses.
-- Apps\/tools should avoid mixing app-provided and implementation-provided
-- addresses for buffers created with
-- 'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT',
-- to avoid address space allocation conflicts.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferOpaqueCaptureAddressCreateInfo = BufferOpaqueCaptureAddressCreateInfo
  { -- | @opaqueCaptureAddress@ is the opaque capture address requested for the
    -- buffer.
    BufferOpaqueCaptureAddressCreateInfo -> Word64
opaqueCaptureAddress :: Word64 }
  deriving (Typeable, BufferOpaqueCaptureAddressCreateInfo
-> BufferOpaqueCaptureAddressCreateInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferOpaqueCaptureAddressCreateInfo
-> BufferOpaqueCaptureAddressCreateInfo -> Bool
$c/= :: BufferOpaqueCaptureAddressCreateInfo
-> BufferOpaqueCaptureAddressCreateInfo -> Bool
== :: BufferOpaqueCaptureAddressCreateInfo
-> BufferOpaqueCaptureAddressCreateInfo -> Bool
$c== :: BufferOpaqueCaptureAddressCreateInfo
-> BufferOpaqueCaptureAddressCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferOpaqueCaptureAddressCreateInfo)
#endif
deriving instance Show BufferOpaqueCaptureAddressCreateInfo

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

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

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

instance Zero BufferOpaqueCaptureAddressCreateInfo where
  zero :: BufferOpaqueCaptureAddressCreateInfo
zero = Word64 -> BufferOpaqueCaptureAddressCreateInfo
BufferOpaqueCaptureAddressCreateInfo
           forall a. Zero a => a
zero


-- | VkMemoryOpaqueCaptureAddressAllocateInfo - Request a specific address
-- for a memory allocation
--
-- = Description
--
-- If @opaqueCaptureAddress@ is zero, no specific address is requested.
--
-- If @opaqueCaptureAddress@ is not zero, it /should/ be an address
-- retrieved from 'getDeviceMemoryOpaqueCaptureAddress' on an identically
-- created memory allocation on the same implementation.
--
-- Note
--
-- In most cases, it is expected that a non-zero @opaqueAddress@ is an
-- address retrieved from 'getDeviceMemoryOpaqueCaptureAddress' on an
-- identically created memory allocation. If this is not the case, it is
-- likely that
-- 'Vulkan.Core10.Enums.Result.ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS' errors
-- will occur.
--
-- This is, however, not a strict requirement because trace capture\/replay
-- tools may need to adjust memory allocation parameters for imported
-- memory.
--
-- If this structure is not present, it is as if @opaqueCaptureAddress@ is
-- zero.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data MemoryOpaqueCaptureAddressAllocateInfo = MemoryOpaqueCaptureAddressAllocateInfo
  { -- | @opaqueCaptureAddress@ is the opaque capture address requested for the
    -- memory allocation.
    MemoryOpaqueCaptureAddressAllocateInfo -> Word64
opaqueCaptureAddress :: Word64 }
  deriving (Typeable, MemoryOpaqueCaptureAddressAllocateInfo
-> MemoryOpaqueCaptureAddressAllocateInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryOpaqueCaptureAddressAllocateInfo
-> MemoryOpaqueCaptureAddressAllocateInfo -> Bool
$c/= :: MemoryOpaqueCaptureAddressAllocateInfo
-> MemoryOpaqueCaptureAddressAllocateInfo -> Bool
== :: MemoryOpaqueCaptureAddressAllocateInfo
-> MemoryOpaqueCaptureAddressAllocateInfo -> Bool
$c== :: MemoryOpaqueCaptureAddressAllocateInfo
-> MemoryOpaqueCaptureAddressAllocateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryOpaqueCaptureAddressAllocateInfo)
#endif
deriving instance Show MemoryOpaqueCaptureAddressAllocateInfo

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

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

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

instance Zero MemoryOpaqueCaptureAddressAllocateInfo where
  zero :: MemoryOpaqueCaptureAddressAllocateInfo
zero = Word64 -> MemoryOpaqueCaptureAddressAllocateInfo
MemoryOpaqueCaptureAddressAllocateInfo
           forall a. Zero a => a
zero


-- | VkDeviceMemoryOpaqueCaptureAddressInfo - Structure specifying the memory
-- object to query an address for
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceMemoryOpaqueCaptureAddress',
-- 'Vulkan.Extensions.VK_KHR_buffer_device_address.getDeviceMemoryOpaqueCaptureAddressKHR'
data DeviceMemoryOpaqueCaptureAddressInfo = DeviceMemoryOpaqueCaptureAddressInfo
  { -- | @memory@ specifies the memory whose address is being queried.
    --
    -- #VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-memory-03336# @memory@
    -- /must/ have been allocated with
    -- 'Vulkan.Core11.Enums.MemoryAllocateFlagBits.MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT'
    --
    -- #VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-memory-parameter# @memory@
    -- /must/ be a valid 'Vulkan.Core10.Handles.DeviceMemory' handle
    DeviceMemoryOpaqueCaptureAddressInfo -> DeviceMemory
memory :: DeviceMemory }
  deriving (Typeable, DeviceMemoryOpaqueCaptureAddressInfo
-> DeviceMemoryOpaqueCaptureAddressInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceMemoryOpaqueCaptureAddressInfo
-> DeviceMemoryOpaqueCaptureAddressInfo -> Bool
$c/= :: DeviceMemoryOpaqueCaptureAddressInfo
-> DeviceMemoryOpaqueCaptureAddressInfo -> Bool
== :: DeviceMemoryOpaqueCaptureAddressInfo
-> DeviceMemoryOpaqueCaptureAddressInfo -> Bool
$c== :: DeviceMemoryOpaqueCaptureAddressInfo
-> DeviceMemoryOpaqueCaptureAddressInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceMemoryOpaqueCaptureAddressInfo)
#endif
deriving instance Show DeviceMemoryOpaqueCaptureAddressInfo

instance ToCStruct DeviceMemoryOpaqueCaptureAddressInfo where
  withCStruct :: forall b.
DeviceMemoryOpaqueCaptureAddressInfo
-> (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo) -> IO b)
-> IO b
withCStruct DeviceMemoryOpaqueCaptureAddressInfo
x ("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo) -> 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 DeviceMemoryOpaqueCaptureAddressInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p DeviceMemoryOpaqueCaptureAddressInfo
x (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo) -> IO b
f "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
-> DeviceMemoryOpaqueCaptureAddressInfo -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p DeviceMemoryOpaqueCaptureAddressInfo{DeviceMemory
memory :: DeviceMemory
$sel:memory:DeviceMemoryOpaqueCaptureAddressInfo :: DeviceMemoryOpaqueCaptureAddressInfo -> DeviceMemory
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
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 (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceMemory)) (DeviceMemory
memory)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo)
-> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
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 (("pInfo" ::: Ptr DeviceMemoryOpaqueCaptureAddressInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceMemory)) (forall a. Zero a => a
zero)
    IO b
f

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

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

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