{-# language CPP #-}
-- | = Name
--
-- VK_EXT_buffer_device_address - device extension
--
-- == VK_EXT_buffer_device_address
--
-- [__Name String__]
--     @VK_EXT_buffer_device_address@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     245
--
-- [__Revision__]
--     2
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--
-- [__Deprecation State__]
--
--     -   /Deprecated/ by @VK_KHR_buffer_device_address@ extension
--
--         -   Which in turn was /promoted/ to
--             <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.2-promotions Vulkan 1.2>
--
-- [__Contact__]
--
--     -   Jeff Bolz
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_buffer_device_address] @jeffbolznv%0A*Here describe the issue or question you have about the VK_EXT_buffer_device_address extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2019-01-06
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/EXT/SPV_EXT_physical_storage_buffer.html SPV_EXT_physical_storage_buffer>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_buffer_reference.txt GLSL_EXT_buffer_reference>
--         and
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_buffer_reference_uvec2.txt GLSL_EXT_buffer_reference_uvec2>
--
-- [__Contributors__]
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Neil Henning, AMD
--
--     -   Tobias Hector, AMD
--
--     -   Faith Ekstrand, Intel
--
--     -   Baldur Karlsson, Valve
--
-- == Description
--
-- This extension allows the application to query a 64-bit buffer device
-- address value for a buffer, which can be used to access the buffer
-- memory via the @PhysicalStorageBufferEXT@ storage class in the
-- <https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_buffer_reference.txt GL_EXT_buffer_reference>
-- GLSL extension and
-- <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/EXT/SPV_EXT_physical_storage_buffer.html SPV_EXT_physical_storage_buffer>
-- SPIR-V extension.
--
-- It also allows buffer device addresses to be provided by a trace replay
-- tool, so that it matches the address used when the trace was captured.
--
-- == New Commands
--
-- -   'getBufferDeviceAddressEXT'
--
-- == New Structures
--
-- -   'BufferDeviceAddressInfoEXT'
--
-- -   Extending 'Vulkan.Core10.Buffer.BufferCreateInfo':
--
--     -   'BufferDeviceAddressCreateInfoEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceBufferAddressFeaturesEXT'
--
--     -   'PhysicalDeviceBufferDeviceAddressFeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME'
--
-- -   'EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core10.Enums.BufferCreateFlagBits.BufferCreateFlagBits':
--
--     -   'BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BufferUsageFlagBits':
--
--     -   'BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'ERROR_INVALID_DEVICE_ADDRESS_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT'
--
--     -   'STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT'
--
--     -   'STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT'
--
-- == New SPIR-V Capabilities
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-capabilities-table-PhysicalStorageBufferAddresses PhysicalStorageBufferAddressesEXT>
--
-- == Issues
--
-- 1) Where is
-- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT and
-- VkPhysicalDeviceBufferAddressFeaturesEXT?
--
-- __RESOLVED__: They were renamed as
-- 'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT'
-- and 'PhysicalDeviceBufferDeviceAddressFeaturesEXT' accordingly for
-- consistency. Even though, the old names can still be found in the
-- generated header files for compatibility.
--
-- == Version History
--
-- -   Revision 1, 2018-11-01 (Jeff Bolz)
--
--     -   Internal revisions
--
-- -   Revision 2, 2019-01-06 (Jon Leech)
--
--     -   Minor updates to appendix for publication
--
-- == See Also
--
-- 'BufferDeviceAddressCreateInfoEXT', 'BufferDeviceAddressInfoEXT',
-- 'PhysicalDeviceBufferAddressFeaturesEXT',
-- 'PhysicalDeviceBufferDeviceAddressFeaturesEXT',
-- 'getBufferDeviceAddressEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_buffer_device_address Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_buffer_device_address  ( pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT
                                                       , pattern STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT
                                                       , pattern BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT
                                                       , pattern BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT
                                                       , pattern ERROR_INVALID_DEVICE_ADDRESS_EXT
                                                       , getBufferDeviceAddressEXT
                                                       , PhysicalDeviceBufferDeviceAddressFeaturesEXT(..)
                                                       , BufferDeviceAddressCreateInfoEXT(..)
                                                       , PhysicalDeviceBufferAddressFeaturesEXT
                                                       , BufferDeviceAddressInfoEXT
                                                       , EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION
                                                       , pattern EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION
                                                       , EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME
                                                       , pattern EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME
                                                       ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address (getBufferDeviceAddress)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address (BufferDeviceAddressInfo)
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.BufferCreateFlagBits (BufferCreateFlags)
import Vulkan.Core10.Enums.BufferCreateFlagBits (BufferCreateFlagBits(BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT))
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlags)
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlagBits(BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT))
import Vulkan.Core10.Enums.Result (Result(ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT))
-- No documentation found for TopLevel "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT"
pattern $bSTRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT :: StructureType
$mSTRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT


-- No documentation found for TopLevel "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT"
pattern $bSTRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT :: StructureType
$mSTRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO


-- No documentation found for TopLevel "VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT"
pattern $bBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT :: BufferUsageFlagBits
$mBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT :: forall {r}.
BufferUsageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT


-- No documentation found for TopLevel "VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT"
pattern $bBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT :: BufferCreateFlagBits
$mBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT :: forall {r}.
BufferCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT


-- No documentation found for TopLevel "VK_ERROR_INVALID_DEVICE_ADDRESS_EXT"
pattern $bERROR_INVALID_DEVICE_ADDRESS_EXT :: Result
$mERROR_INVALID_DEVICE_ADDRESS_EXT :: forall {r}. Result -> ((# #) -> r) -> ((# #) -> r) -> r
ERROR_INVALID_DEVICE_ADDRESS_EXT = ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS


-- No documentation found for TopLevel "vkGetBufferDeviceAddressEXT"
getBufferDeviceAddressEXT :: Device -> BufferDeviceAddressInfo -> io DeviceAddress
getBufferDeviceAddressEXT = forall (io :: * -> *).
MonadIO io =>
Device -> BufferDeviceAddressInfo -> io DeviceAddress
getBufferDeviceAddress


-- | VkPhysicalDeviceBufferDeviceAddressFeaturesEXT - Structure describing
-- buffer address features that can be supported by an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceBufferDeviceAddressFeaturesEXT' 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. 'PhysicalDeviceBufferDeviceAddressFeaturesEXT' /can/ also be
-- used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- Note
--
-- The 'PhysicalDeviceBufferDeviceAddressFeaturesEXT' structure has the
-- same members as the
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.PhysicalDeviceBufferDeviceAddressFeatures'
-- structure, but the functionality indicated by the members is expressed
-- differently. The features indicated by the
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.PhysicalDeviceBufferDeviceAddressFeatures'
-- structure requires additional flags to be passed at memory allocation
-- time, and the capture and replay mechanism is built around opaque
-- capture addresses for buffer and memory objects.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_buffer_device_address VK_EXT_buffer_device_address>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceBufferDeviceAddressFeaturesEXT = PhysicalDeviceBufferDeviceAddressFeaturesEXT
  { -- | #features-bufferDeviceAddressEXT# @bufferDeviceAddress@ indicates that
    -- the implementation supports accessing buffer memory in shaders as
    -- storage buffers via an address queried from 'getBufferDeviceAddressEXT'.
    PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
bufferDeviceAddress :: Bool
  , -- | #features-bufferDeviceAddressCaptureReplayEXT#
    -- @bufferDeviceAddressCaptureReplay@ indicates that the implementation
    -- supports saving and reusing buffer addresses, e.g. for trace capture and
    -- replay.
    PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
bufferDeviceAddressCaptureReplay :: Bool
  , -- | #features-bufferDeviceAddressMultiDeviceEXT#
    -- @bufferDeviceAddressMultiDevice@ indicates that the implementation
    -- supports the @bufferDeviceAddress@ feature for logical devices created
    -- with multiple physical devices. If this feature is not supported, buffer
    -- addresses /must/ not be queried on a logical device created with more
    -- than one physical device.
    PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
bufferDeviceAddressMultiDevice :: Bool
  }
  deriving (Typeable, PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
$c/= :: PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
== :: PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
$c== :: PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceBufferDeviceAddressFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceBufferDeviceAddressFeaturesEXT

instance ToCStruct PhysicalDeviceBufferDeviceAddressFeaturesEXT where
  withCStruct :: forall b.
PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> (Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceBufferDeviceAddressFeaturesEXT
x Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p PhysicalDeviceBufferDeviceAddressFeaturesEXT
x (Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT -> IO b
f Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> PhysicalDeviceBufferDeviceAddressFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p PhysicalDeviceBufferDeviceAddressFeaturesEXT{Bool
bufferDeviceAddressMultiDevice :: Bool
bufferDeviceAddressCaptureReplay :: Bool
bufferDeviceAddress :: Bool
$sel:bufferDeviceAddressMultiDevice:PhysicalDeviceBufferDeviceAddressFeaturesEXT :: PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
$sel:bufferDeviceAddressCaptureReplay:PhysicalDeviceBufferDeviceAddressFeaturesEXT :: PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
$sel:bufferDeviceAddress:PhysicalDeviceBufferDeviceAddressFeaturesEXT :: PhysicalDeviceBufferDeviceAddressFeaturesEXT -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT where
  peekCStruct :: Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
-> IO PhysicalDeviceBufferDeviceAddressFeaturesEXT
peekCStruct Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
p = do
    Bool32
bufferDeviceAddress <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 PhysicalDeviceBufferDeviceAddressFeaturesEXT
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 -> PhysicalDeviceBufferDeviceAddressFeaturesEXT
PhysicalDeviceBufferDeviceAddressFeaturesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
bufferDeviceAddress)
             (Bool32 -> Bool
bool32ToBool Bool32
bufferDeviceAddressCaptureReplay)
             (Bool32 -> Bool
bool32ToBool Bool32
bufferDeviceAddressMultiDevice)

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

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


-- | VkBufferDeviceAddressCreateInfoEXT - Request a specific address for a
-- buffer
--
-- = Description
--
-- If @deviceAddress@ is zero, no specific address is requested.
--
-- If @deviceAddress@ is not zero, then it /must/ be an address retrieved
-- from an identically created buffer on the same implementation. The
-- buffer /must/ also be bound to an identically created
-- 'Vulkan.Core10.Handles.DeviceMemory' object.
--
-- If this structure is not present, it is as if @deviceAddress@ is zero.
--
-- Apps /should/ avoid creating buffers with app-provided addresses and
-- implementation-provided addresses in the same process, to reduce the
-- likelihood of 'ERROR_INVALID_DEVICE_ADDRESS_EXT' errors.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_buffer_device_address VK_EXT_buffer_device_address>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferDeviceAddressCreateInfoEXT = BufferDeviceAddressCreateInfoEXT
  { -- | @deviceAddress@ is the device address requested for the buffer.
    BufferDeviceAddressCreateInfoEXT -> DeviceAddress
deviceAddress :: DeviceAddress }
  deriving (Typeable, BufferDeviceAddressCreateInfoEXT
-> BufferDeviceAddressCreateInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferDeviceAddressCreateInfoEXT
-> BufferDeviceAddressCreateInfoEXT -> Bool
$c/= :: BufferDeviceAddressCreateInfoEXT
-> BufferDeviceAddressCreateInfoEXT -> Bool
== :: BufferDeviceAddressCreateInfoEXT
-> BufferDeviceAddressCreateInfoEXT -> Bool
$c== :: BufferDeviceAddressCreateInfoEXT
-> BufferDeviceAddressCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferDeviceAddressCreateInfoEXT)
#endif
deriving instance Show BufferDeviceAddressCreateInfoEXT

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

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

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

instance Zero BufferDeviceAddressCreateInfoEXT where
  zero :: BufferDeviceAddressCreateInfoEXT
zero = DeviceAddress -> BufferDeviceAddressCreateInfoEXT
BufferDeviceAddressCreateInfoEXT
           forall a. Zero a => a
zero


-- No documentation found for TopLevel "VkPhysicalDeviceBufferAddressFeaturesEXT"
type PhysicalDeviceBufferAddressFeaturesEXT = PhysicalDeviceBufferDeviceAddressFeaturesEXT


-- No documentation found for TopLevel "VkBufferDeviceAddressInfoEXT"
type BufferDeviceAddressInfoEXT = BufferDeviceAddressInfo


type EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION = 2

-- No documentation found for TopLevel "VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION"
pattern EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION :: forall a. Integral a => a
$mEXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION = 2


type EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME = "VK_EXT_buffer_device_address"

-- No documentation found for TopLevel "VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME"
pattern EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME = "VK_EXT_buffer_device_address"