{-# language CPP #-}
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 ()
getDescriptorSetLayoutHostMappingInfoVALVE :: forall io
. (MonadIO io)
=>
Device
->
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 ()
getDescriptorSetHostMappingVALVE :: forall io
. (MonadIO io)
=>
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)
data PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE = PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE
{
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
data DescriptorSetBindingReferenceVALVE = DescriptorSetBindingReferenceVALVE
{
DescriptorSetBindingReferenceVALVE -> DescriptorSetLayout
descriptorSetLayout :: DescriptorSetLayout
,
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
data DescriptorSetLayoutHostMappingInfoVALVE = DescriptorSetLayoutHostMappingInfoVALVE
{
DescriptorSetLayoutHostMappingInfoVALVE -> Word64
descriptorOffset :: Word64
,
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
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"
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"