{-# language CPP #-}
-- | = Name
--
-- VK_VALVE_descriptor_set_host_mapping - device extension
--
-- == VK_VALVE_descriptor_set_host_mapping
--
-- [__Name String__]
--     @VK_VALVE_descriptor_set_host_mapping@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     421
--
-- [__Revision__]
--     1
--
-- [__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>
--
-- [__Special Use__]
--
--     -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#extendingvulkan-compatibility-specialuse D3D support>
--
-- [__Contact__]
--
--     -   Hans-Kristian Arntzen
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_VALVE_descriptor_set_host_mapping] @HansKristian-Work%0A*Here describe the issue or question you have about the VK_VALVE_descriptor_set_host_mapping extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-02-22
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Hans-Kristian Arntzen, Valve
--
-- == Description
--
-- This extension allows applications to directly query a host pointer for
-- a 'Vulkan.Core10.Handles.DescriptorSet' which /can/ be used to copy
-- descriptors between descriptor sets without the use of an API command.
-- Memory offsets and sizes for descriptors /can/ be queried from a
-- 'Vulkan.Core10.Handles.DescriptorSetLayout' as well.
--
-- Note
--
-- There is currently no specification language written for this extension.
-- The links to APIs defined by the extension are to stubs that only
-- include generated content such as API declarations and implicit valid
-- usage statements.
--
-- Note
--
-- This extension is only intended for use in specific embedded
-- environments with known implementation details, and is therefore
-- undocumented.
--
-- == New Commands
--
-- -   'getDescriptorSetHostMappingVALVE'
--
-- -   'getDescriptorSetLayoutHostMappingInfoVALVE'
--
-- == New Structures
--
-- -   'DescriptorSetBindingReferenceVALVE'
--
-- -   'DescriptorSetLayoutHostMappingInfoVALVE'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE'
--
-- == New Enum Constants
--
-- -   'VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME'
--
-- -   'VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE'
--
-- == Stub API References
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_VALVE_descriptor_set_host_mapping
-- > void vkGetDescriptorSetLayoutHostMappingInfoVALVE(
-- >     VkDevice                                    device,
-- >     const VkDescriptorSetBindingReferenceVALVE* pBindingReference,
-- >     VkDescriptorSetLayoutHostMappingInfoVALVE*  pHostMapping);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pBindingReference-parameter#
--     @pBindingReference@ /must/ be a valid pointer to a valid
--     'DescriptorSetBindingReferenceVALVE' structure
--
-- -   #VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pHostMapping-parameter#
--     @pHostMapping@ /must/ be a valid pointer to a
--     'DescriptorSetLayoutHostMappingInfoVALVE' structure
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_VALVE_descriptor_set_host_mapping
-- > void vkGetDescriptorSetHostMappingVALVE(
-- >     VkDevice                                    device,
-- >     VkDescriptorSet                             descriptorSet,
-- >     void**                                      ppData);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkGetDescriptorSetHostMappingVALVE-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDescriptorSetHostMappingVALVE-descriptorSet-parameter#
--     @descriptorSet@ /must/ be a valid
--     'Vulkan.Core10.Handles.DescriptorSet' handle
--
-- -   #VUID-vkGetDescriptorSetHostMappingVALVE-ppData-parameter# @ppData@
--     /must/ be a valid pointer to a pointer value
--
-- -   #VUID-vkGetDescriptorSetHostMappingVALVE-descriptorSet-parent#
--     @descriptorSet@ /must/ have been created, allocated, or retrieved
--     from @device@
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_VALVE_descriptor_set_host_mapping
-- > typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE {
-- >     VkStructureType    sType;
-- >     void*              pNext;
-- >     VkBool32           descriptorSetHostMapping;
-- > } VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE'
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_VALVE_descriptor_set_host_mapping
-- > typedef struct VkDescriptorSetBindingReferenceVALVE {
-- >     VkStructureType          sType;
-- >     const void*              pNext;
-- >     VkDescriptorSetLayout    descriptorSetLayout;
-- >     uint32_t                 binding;
-- > } VkDescriptorSetBindingReferenceVALVE;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkDescriptorSetBindingReferenceVALVE-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE'
--
-- -   #VUID-VkDescriptorSetBindingReferenceVALVE-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkDescriptorSetBindingReferenceVALVE-descriptorSetLayout-parameter#
--     @descriptorSetLayout@ /must/ be a valid
--     'Vulkan.Core10.Handles.DescriptorSetLayout' handle
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_VALVE_descriptor_set_host_mapping
-- > typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE {
-- >     VkStructureType    sType;
-- >     void*              pNext;
-- >     size_t             descriptorOffset;
-- >     uint32_t           descriptorSize;
-- > } VkDescriptorSetLayoutHostMappingInfoVALVE;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE'
--
-- -   #VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- == Version History
--
-- -   Revision 1, 2022-02-22 (Hans-Kristian Arntzen)
--
--     -   Initial specification
--
-- == See Also
--
-- 'DescriptorSetBindingReferenceVALVE',
-- 'DescriptorSetLayoutHostMappingInfoVALVE',
-- 'PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE',
-- 'getDescriptorSetHostMappingVALVE',
-- 'getDescriptorSetLayoutHostMappingInfoVALVE'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_VALVE_descriptor_set_host_mapping  ( getDescriptorSetLayoutHostMappingInfoVALVE
                                                               , getDescriptorSetHostMappingVALVE
                                                               , PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE(..)
                                                               , DescriptorSetBindingReferenceVALVE(..)
                                                               , DescriptorSetLayoutHostMappingInfoVALVE(..)
                                                               , VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION
                                                               , pattern VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION
                                                               , VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME
                                                               , pattern VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME
                                                               ) 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 (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.Coerce (coerce)
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.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
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.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (DescriptorSet)
import Vulkan.Core10.Handles (DescriptorSet(..))
import Vulkan.Core10.Handles (DescriptorSetLayout)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetDescriptorSetHostMappingVALVE))
import Vulkan.Dynamic (DeviceCmds(pVkGetDescriptorSetLayoutHostMappingInfoVALVE))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDescriptorSetLayoutHostMappingInfoVALVE
  :: FunPtr (Ptr Device_T -> Ptr DescriptorSetBindingReferenceVALVE -> Ptr DescriptorSetLayoutHostMappingInfoVALVE -> IO ()) -> Ptr Device_T -> Ptr DescriptorSetBindingReferenceVALVE -> Ptr DescriptorSetLayoutHostMappingInfoVALVE -> IO ()

-- | vkGetDescriptorSetLayoutHostMappingInfoVALVE - Stub description of
-- vkGetDescriptorSetLayoutHostMappingInfoVALVE
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping VK_VALVE_descriptor_set_host_mapping>,
-- 'DescriptorSetBindingReferenceVALVE',
-- 'DescriptorSetLayoutHostMappingInfoVALVE',
-- 'Vulkan.Core10.Handles.Device'
getDescriptorSetLayoutHostMappingInfoVALVE :: forall io
                                            . (MonadIO io)
                                           => -- | #VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-device-parameter#
                                              -- @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                              Device
                                           -> -- | #VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pBindingReference-parameter#
                                              -- @pBindingReference@ /must/ be a valid pointer to a valid
                                              -- 'DescriptorSetBindingReferenceVALVE' structure
                                              DescriptorSetBindingReferenceVALVE
                                           -> io (DescriptorSetLayoutHostMappingInfoVALVE)
getDescriptorSetLayoutHostMappingInfoVALVE :: forall (io :: * -> *).
MonadIO io =>
Device
-> DescriptorSetBindingReferenceVALVE
-> io DescriptorSetLayoutHostMappingInfoVALVE
getDescriptorSetLayoutHostMappingInfoVALVE Device
device
                                             DescriptorSetBindingReferenceVALVE
bindingReference = 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 vkGetDescriptorSetLayoutHostMappingInfoVALVEPtr :: FunPtr
  (Ptr Device_T
   -> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
   -> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
   -> IO ())
vkGetDescriptorSetLayoutHostMappingInfoVALVEPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
      -> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
      -> IO ())
pVkGetDescriptorSetLayoutHostMappingInfoVALVE (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
   -> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
   -> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
   -> IO ())
vkGetDescriptorSetLayoutHostMappingInfoVALVEPtr 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 vkGetDescriptorSetLayoutHostMappingInfoVALVE is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDescriptorSetLayoutHostMappingInfoVALVE' :: Ptr Device_T
-> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
-> IO ()
vkGetDescriptorSetLayoutHostMappingInfoVALVE' = FunPtr
  (Ptr Device_T
   -> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
   -> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
   -> IO ())
-> Ptr Device_T
-> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
-> IO ()
mkVkGetDescriptorSetLayoutHostMappingInfoVALVE FunPtr
  (Ptr Device_T
   -> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
   -> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
   -> IO ())
vkGetDescriptorSetLayoutHostMappingInfoVALVEPtr
  "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
pBindingReference <- 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 (DescriptorSetBindingReferenceVALVE
bindingReference)
  "pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
pPHostMapping <- 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 @DescriptorSetLayoutHostMappingInfoVALVE)
  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
"vkGetDescriptorSetLayoutHostMappingInfoVALVE" (Ptr Device_T
-> ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
-> IO ()
vkGetDescriptorSetLayoutHostMappingInfoVALVE'
                                                                            (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                            "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
pBindingReference
                                                                            ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
pPHostMapping))
  DescriptorSetLayoutHostMappingInfoVALVE
pHostMapping <- 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 @DescriptorSetLayoutHostMappingInfoVALVE "pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
pPHostMapping
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DescriptorSetLayoutHostMappingInfoVALVE
pHostMapping)


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

-- | vkGetDescriptorSetHostMappingVALVE - Stub description of
-- vkGetDescriptorSetHostMappingVALVE
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping VK_VALVE_descriptor_set_host_mapping>,
-- 'Vulkan.Core10.Handles.DescriptorSet', 'Vulkan.Core10.Handles.Device'
getDescriptorSetHostMappingVALVE :: forall io
                                  . (MonadIO io)
                                 => -- | #VUID-vkGetDescriptorSetHostMappingVALVE-device-parameter# @device@
                                    -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                    Device
                                 -> -- | #VUID-vkGetDescriptorSetHostMappingVALVE-descriptorSet-parameter#
                                    -- @descriptorSet@ /must/ be a valid 'Vulkan.Core10.Handles.DescriptorSet'
                                    -- handle
                                    --
                                    -- #VUID-vkGetDescriptorSetHostMappingVALVE-descriptorSet-parent#
                                    -- @descriptorSet@ /must/ have been created, allocated, or retrieved from
                                    -- @device@
                                    DescriptorSet
                                 -> io (("data" ::: Ptr ()))
getDescriptorSetHostMappingVALVE :: forall (io :: * -> *).
MonadIO io =>
Device -> DescriptorSet -> io ("data" ::: Ptr ())
getDescriptorSetHostMappingVALVE Device
device DescriptorSet
descriptorSet = 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 vkGetDescriptorSetHostMappingVALVEPtr :: FunPtr
  (Ptr Device_T
   -> DescriptorSet
   -> ("ppData" ::: Ptr ("data" ::: Ptr ()))
   -> IO ())
vkGetDescriptorSetHostMappingVALVEPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> DescriptorSet
      -> ("ppData" ::: Ptr ("data" ::: Ptr ()))
      -> IO ())
pVkGetDescriptorSetHostMappingVALVE (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
   -> DescriptorSet
   -> ("ppData" ::: Ptr ("data" ::: Ptr ()))
   -> IO ())
vkGetDescriptorSetHostMappingVALVEPtr 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 vkGetDescriptorSetHostMappingVALVE is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDescriptorSetHostMappingVALVE' :: Ptr Device_T
-> DescriptorSet -> ("ppData" ::: Ptr ("data" ::: Ptr ())) -> IO ()
vkGetDescriptorSetHostMappingVALVE' = FunPtr
  (Ptr Device_T
   -> DescriptorSet
   -> ("ppData" ::: Ptr ("data" ::: Ptr ()))
   -> IO ())
-> Ptr Device_T
-> DescriptorSet
-> ("ppData" ::: Ptr ("data" ::: Ptr ()))
-> IO ()
mkVkGetDescriptorSetHostMappingVALVE FunPtr
  (Ptr Device_T
   -> DescriptorSet
   -> ("ppData" ::: Ptr ("data" ::: Ptr ()))
   -> IO ())
vkGetDescriptorSetHostMappingVALVEPtr
  "ppData" ::: Ptr ("data" ::: Ptr ())
pPpData <- 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 @(Ptr ()) Int
8) 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
"vkGetDescriptorSetHostMappingVALVE" (Ptr Device_T
-> DescriptorSet -> ("ppData" ::: Ptr ("data" ::: Ptr ())) -> IO ()
vkGetDescriptorSetHostMappingVALVE'
                                                                  (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                  (DescriptorSet
descriptorSet)
                                                                  ("ppData" ::: Ptr ("data" ::: Ptr ())
pPpData))
  "data" ::: Ptr ()
ppData <- 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 @(Ptr ()) "ppData" ::: Ptr ("data" ::: Ptr ())
pPpData
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("data" ::: Ptr ()
ppData)


-- | VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE - Stub description
-- of VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping VK_VALVE_descriptor_set_host_mapping>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE = PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
  { -- No documentation found for Nested "VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE" "descriptorSetHostMapping"
    PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
descriptorSetHostMapping :: Bool }
  deriving (Typeable, PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
$c/= :: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
== :: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
$c== :: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE)
#endif
deriving instance Show PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE

instance ToCStruct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE where
  withCStruct :: forall b.
PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> (Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
    -> IO b)
-> IO b
withCStruct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
x Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
x (Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> IO b
f Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE{Bool
descriptorSetHostMapping :: Bool
$sel:descriptorSetHostMapping:PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE :: PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
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 PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
descriptorSetHostMapping))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
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 PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
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 PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE where
  peekCStruct :: Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
-> IO PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
peekCStruct Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
p = do
    Bool32
descriptorSetHostMapping <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
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 -> PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
             (Bool32 -> Bool
bool32ToBool Bool32
descriptorSetHostMapping)

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

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


-- | VkDescriptorSetBindingReferenceVALVE - Stub description of
-- VkDescriptorSetBindingReferenceVALVE
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping VK_VALVE_descriptor_set_host_mapping>,
-- 'Vulkan.Core10.Handles.DescriptorSetLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDescriptorSetLayoutHostMappingInfoVALVE'
data DescriptorSetBindingReferenceVALVE = DescriptorSetBindingReferenceVALVE
  { -- | #VUID-VkDescriptorSetBindingReferenceVALVE-descriptorSetLayout-parameter#
    -- @descriptorSetLayout@ /must/ be a valid
    -- 'Vulkan.Core10.Handles.DescriptorSetLayout' handle
    DescriptorSetBindingReferenceVALVE -> DescriptorSetLayout
descriptorSetLayout :: DescriptorSetLayout
  , -- No documentation found for Nested "VkDescriptorSetBindingReferenceVALVE" "binding"
    DescriptorSetBindingReferenceVALVE -> Word32
binding :: Word32
  }
  deriving (Typeable, DescriptorSetBindingReferenceVALVE
-> DescriptorSetBindingReferenceVALVE -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescriptorSetBindingReferenceVALVE
-> DescriptorSetBindingReferenceVALVE -> Bool
$c/= :: DescriptorSetBindingReferenceVALVE
-> DescriptorSetBindingReferenceVALVE -> Bool
== :: DescriptorSetBindingReferenceVALVE
-> DescriptorSetBindingReferenceVALVE -> Bool
$c== :: DescriptorSetBindingReferenceVALVE
-> DescriptorSetBindingReferenceVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DescriptorSetBindingReferenceVALVE)
#endif
deriving instance Show DescriptorSetBindingReferenceVALVE

instance ToCStruct DescriptorSetBindingReferenceVALVE where
  withCStruct :: forall b.
DescriptorSetBindingReferenceVALVE
-> (("pBindingReference"
     ::: Ptr DescriptorSetBindingReferenceVALVE)
    -> IO b)
-> IO b
withCStruct DescriptorSetBindingReferenceVALVE
x ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p DescriptorSetBindingReferenceVALVE
x (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> IO b
f "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p)
  pokeCStruct :: forall b.
("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> DescriptorSetBindingReferenceVALVE -> IO b -> IO b
pokeCStruct "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p DescriptorSetBindingReferenceVALVE{Word32
DescriptorSetLayout
binding :: Word32
descriptorSetLayout :: DescriptorSetLayout
$sel:binding:DescriptorSetBindingReferenceVALVE :: DescriptorSetBindingReferenceVALVE -> Word32
$sel:descriptorSetLayout:DescriptorSetBindingReferenceVALVE :: DescriptorSetBindingReferenceVALVE -> DescriptorSetLayout
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
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 (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DescriptorSetLayout)) (DescriptorSetLayout
descriptorSetLayout)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
binding)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> IO b -> IO b
pokeZeroCStruct "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
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 (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DescriptorSetLayout)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DescriptorSetBindingReferenceVALVE where
  peekCStruct :: ("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE)
-> IO DescriptorSetBindingReferenceVALVE
peekCStruct "pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p = do
    DescriptorSetLayout
descriptorSetLayout <- forall a. Storable a => Ptr a -> IO a
peek @DescriptorSetLayout (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DescriptorSetLayout))
    Word32
binding <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pBindingReference" ::: Ptr DescriptorSetBindingReferenceVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DescriptorSetLayout -> Word32 -> DescriptorSetBindingReferenceVALVE
DescriptorSetBindingReferenceVALVE
             DescriptorSetLayout
descriptorSetLayout Word32
binding

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

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


-- | VkDescriptorSetLayoutHostMappingInfoVALVE - Stub description of
-- VkDescriptorSetLayoutHostMappingInfoVALVE
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_descriptor_set_host_mapping VK_VALVE_descriptor_set_host_mapping>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDescriptorSetLayoutHostMappingInfoVALVE'
data DescriptorSetLayoutHostMappingInfoVALVE = DescriptorSetLayoutHostMappingInfoVALVE
  { -- No documentation found for Nested "VkDescriptorSetLayoutHostMappingInfoVALVE" "descriptorOffset"
    DescriptorSetLayoutHostMappingInfoVALVE -> Word64
descriptorOffset :: Word64
  , -- No documentation found for Nested "VkDescriptorSetLayoutHostMappingInfoVALVE" "descriptorSize"
    DescriptorSetLayoutHostMappingInfoVALVE -> Word32
descriptorSize :: Word32
  }
  deriving (Typeable, DescriptorSetLayoutHostMappingInfoVALVE
-> DescriptorSetLayoutHostMappingInfoVALVE -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescriptorSetLayoutHostMappingInfoVALVE
-> DescriptorSetLayoutHostMappingInfoVALVE -> Bool
$c/= :: DescriptorSetLayoutHostMappingInfoVALVE
-> DescriptorSetLayoutHostMappingInfoVALVE -> Bool
== :: DescriptorSetLayoutHostMappingInfoVALVE
-> DescriptorSetLayoutHostMappingInfoVALVE -> Bool
$c== :: DescriptorSetLayoutHostMappingInfoVALVE
-> DescriptorSetLayoutHostMappingInfoVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DescriptorSetLayoutHostMappingInfoVALVE)
#endif
deriving instance Show DescriptorSetLayoutHostMappingInfoVALVE

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

instance FromCStruct DescriptorSetLayoutHostMappingInfoVALVE where
  peekCStruct :: ("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE)
-> IO DescriptorSetLayoutHostMappingInfoVALVE
peekCStruct "pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
p = do
    CSize
descriptorOffset <- forall a. Storable a => Ptr a -> IO a
peek @CSize (("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize))
    Word32
descriptorSize <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pHostMapping" ::: Ptr DescriptorSetLayoutHostMappingInfoVALVE
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word64 -> Word32 -> DescriptorSetLayoutHostMappingInfoVALVE
DescriptorSetLayoutHostMappingInfoVALVE
             (coerce :: forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
descriptorOffset) Word32
descriptorSize

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

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


type VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION"
pattern VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION :: forall a . Integral a => a
pattern $bVALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION :: forall a. Integral a => a
$mVALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION = 1


type VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME = "VK_VALVE_descriptor_set_host_mapping"

-- No documentation found for TopLevel "VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME"
pattern VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bVALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mVALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME = "VK_VALVE_descriptor_set_host_mapping"