{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_vertex_input_dynamic_state ( cmdSetVertexInputEXT
, PhysicalDeviceVertexInputDynamicStateFeaturesEXT(..)
, VertexInputBindingDescription2EXT(..)
, VertexInputAttributeDescription2EXT(..)
, EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION
, pattern EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION
, EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME
, pattern EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
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.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetVertexInputEXT))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.VertexInputRate (VertexInputRate)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetVertexInputEXT
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr VertexInputBindingDescription2EXT -> Word32 -> Ptr VertexInputAttributeDescription2EXT -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr VertexInputBindingDescription2EXT -> Word32 -> Ptr VertexInputAttributeDescription2EXT -> IO ()
cmdSetVertexInputEXT :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("vertexBindingDescriptions" ::: Vector VertexInputBindingDescription2EXT)
->
("vertexAttributeDescriptions" ::: Vector VertexInputAttributeDescription2EXT)
-> io ()
cmdSetVertexInputEXT :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("vertexBindingDescriptions"
::: Vector VertexInputBindingDescription2EXT)
-> ("vertexAttributeDescriptions"
::: Vector VertexInputAttributeDescription2EXT)
-> io ()
cmdSetVertexInputEXT CommandBuffer
commandBuffer
"vertexBindingDescriptions"
::: Vector VertexInputBindingDescription2EXT
vertexBindingDescriptions
"vertexAttributeDescriptions"
::: Vector VertexInputAttributeDescription2EXT
vertexAttributeDescriptions = 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 vkCmdSetVertexInputEXTPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ())
vkCmdSetVertexInputEXTPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ())
pVkCmdSetVertexInputEXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> 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 CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ())
vkCmdSetVertexInputEXTPtr 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 vkCmdSetVertexInputEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdSetVertexInputEXT' :: Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ()
vkCmdSetVertexInputEXT' = FunPtr
(Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ())
-> Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ()
mkVkCmdSetVertexInputEXT FunPtr
(Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ())
vkCmdSetVertexInputEXTPtr
"pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
pPVertexBindingDescriptions <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputBindingDescription2EXT ((forall a. Vector a -> Int
Data.Vector.length ("vertexBindingDescriptions"
::: Vector VertexInputBindingDescription2EXT
vertexBindingDescriptions)) forall a. Num a => a -> a -> a
* Int
32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputBindingDescription2EXT
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
pPVertexBindingDescriptions forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDescription2EXT) (VertexInputBindingDescription2EXT
e)) ("vertexBindingDescriptions"
::: Vector VertexInputBindingDescription2EXT
vertexBindingDescriptions)
"pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
pPVertexAttributeDescriptions <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputAttributeDescription2EXT ((forall a. Vector a -> Int
Data.Vector.length ("vertexAttributeDescriptions"
::: Vector VertexInputAttributeDescription2EXT
vertexAttributeDescriptions)) forall a. Num a => a -> a -> a
* Int
32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputAttributeDescription2EXT
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
pPVertexAttributeDescriptions forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputAttributeDescription2EXT) (VertexInputAttributeDescription2EXT
e)) ("vertexAttributeDescriptions"
::: Vector VertexInputAttributeDescription2EXT
vertexAttributeDescriptions)
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
"vkCmdSetVertexInputEXT" (Ptr CommandBuffer_T
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO ()
vkCmdSetVertexInputEXT'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("vertexBindingDescriptions"
::: Vector VertexInputBindingDescription2EXT
vertexBindingDescriptions)) :: Word32))
("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
pPVertexBindingDescriptions)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("vertexAttributeDescriptions"
::: Vector VertexInputAttributeDescription2EXT
vertexAttributeDescriptions)) :: Word32))
("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
pPVertexAttributeDescriptions))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data PhysicalDeviceVertexInputDynamicStateFeaturesEXT = PhysicalDeviceVertexInputDynamicStateFeaturesEXT
{
PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
vertexInputDynamicState :: Bool }
deriving (Typeable, PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
$c/= :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
== :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
$c== :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceVertexInputDynamicStateFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceVertexInputDynamicStateFeaturesEXT
instance ToCStruct PhysicalDeviceVertexInputDynamicStateFeaturesEXT where
withCStruct :: forall b.
PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> (Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceVertexInputDynamicStateFeaturesEXT
x Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p PhysicalDeviceVertexInputDynamicStateFeaturesEXT
x (Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> IO b
f Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p PhysicalDeviceVertexInputDynamicStateFeaturesEXT{Bool
vertexInputDynamicState :: Bool
$sel:vertexInputDynamicState:PhysicalDeviceVertexInputDynamicStateFeaturesEXT :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
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 PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexInputDynamicState))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
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 PhysicalDeviceVertexInputDynamicStateFeaturesEXT
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 PhysicalDeviceVertexInputDynamicStateFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> IO PhysicalDeviceVertexInputDynamicStateFeaturesEXT
peekCStruct Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
p = do
Bool32
vertexInputDynamicState <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
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 -> PhysicalDeviceVertexInputDynamicStateFeaturesEXT
PhysicalDeviceVertexInputDynamicStateFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
vertexInputDynamicState)
instance Storable PhysicalDeviceVertexInputDynamicStateFeaturesEXT where
sizeOf :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Int
sizeOf ~PhysicalDeviceVertexInputDynamicStateFeaturesEXT
_ = Int
24
alignment :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> Int
alignment ~PhysicalDeviceVertexInputDynamicStateFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> IO PhysicalDeviceVertexInputDynamicStateFeaturesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
-> PhysicalDeviceVertexInputDynamicStateFeaturesEXT -> IO ()
poke Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
ptr PhysicalDeviceVertexInputDynamicStateFeaturesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVertexInputDynamicStateFeaturesEXT where
zero :: PhysicalDeviceVertexInputDynamicStateFeaturesEXT
zero = Bool -> PhysicalDeviceVertexInputDynamicStateFeaturesEXT
PhysicalDeviceVertexInputDynamicStateFeaturesEXT
forall a. Zero a => a
zero
data VertexInputBindingDescription2EXT = VertexInputBindingDescription2EXT
{
VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
binding :: Word32
,
VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
stride :: Word32
,
VertexInputBindingDescription2EXT -> VertexInputRate
inputRate :: VertexInputRate
,
VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
divisor :: Word32
}
deriving (Typeable, VertexInputBindingDescription2EXT
-> VertexInputBindingDescription2EXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VertexInputBindingDescription2EXT
-> VertexInputBindingDescription2EXT -> Bool
$c/= :: VertexInputBindingDescription2EXT
-> VertexInputBindingDescription2EXT -> Bool
== :: VertexInputBindingDescription2EXT
-> VertexInputBindingDescription2EXT -> Bool
$c== :: VertexInputBindingDescription2EXT
-> VertexInputBindingDescription2EXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VertexInputBindingDescription2EXT)
#endif
deriving instance Show VertexInputBindingDescription2EXT
instance ToCStruct VertexInputBindingDescription2EXT where
withCStruct :: forall b.
VertexInputBindingDescription2EXT
-> (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO b)
-> IO b
withCStruct VertexInputBindingDescription2EXT
x ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p VertexInputBindingDescription2EXT
x (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO b
f "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p)
pokeCStruct :: forall b.
("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> VertexInputBindingDescription2EXT -> IO b -> IO b
pokeCStruct "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p VertexInputBindingDescription2EXT{"vertexBindingDescriptionCount" ::: Word32
VertexInputRate
divisor :: "vertexBindingDescriptionCount" ::: Word32
inputRate :: VertexInputRate
stride :: "vertexBindingDescriptionCount" ::: Word32
binding :: "vertexBindingDescriptionCount" ::: Word32
$sel:divisor:VertexInputBindingDescription2EXT :: VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
$sel:inputRate:VertexInputBindingDescription2EXT :: VertexInputBindingDescription2EXT -> VertexInputRate
$sel:stride:VertexInputBindingDescription2EXT :: VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
$sel:binding:VertexInputBindingDescription2EXT :: VertexInputBindingDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
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 (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
binding)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
stride)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr VertexInputRate)) (VertexInputRate
inputRate)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
divisor)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO b -> IO b
pokeZeroCStruct "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
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 (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr VertexInputRate)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputBindingDescription2EXT where
peekCStruct :: ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO VertexInputBindingDescription2EXT
peekCStruct "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p = do
"vertexBindingDescriptionCount" ::: Word32
binding <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
"vertexBindingDescriptionCount" ::: Word32
stride <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
VertexInputRate
inputRate <- forall a. Storable a => Ptr a -> IO a
peek @VertexInputRate (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr VertexInputRate))
"vertexBindingDescriptionCount" ::: Word32
divisor <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("vertexBindingDescriptionCount" ::: Word32)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputRate
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputBindingDescription2EXT
VertexInputBindingDescription2EXT
"vertexBindingDescriptionCount" ::: Word32
binding "vertexBindingDescriptionCount" ::: Word32
stride VertexInputRate
inputRate "vertexBindingDescriptionCount" ::: Word32
divisor
instance Storable VertexInputBindingDescription2EXT where
sizeOf :: VertexInputBindingDescription2EXT -> Int
sizeOf ~VertexInputBindingDescription2EXT
_ = Int
32
alignment :: VertexInputBindingDescription2EXT -> Int
alignment ~VertexInputBindingDescription2EXT
_ = Int
8
peek :: ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> IO VertexInputBindingDescription2EXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT)
-> VertexInputBindingDescription2EXT -> IO ()
poke "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
ptr VertexInputBindingDescription2EXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pVertexBindingDescriptions"
::: Ptr VertexInputBindingDescription2EXT
ptr VertexInputBindingDescription2EXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputBindingDescription2EXT where
zero :: VertexInputBindingDescription2EXT
zero = ("vertexBindingDescriptionCount" ::: Word32)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputRate
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputBindingDescription2EXT
VertexInputBindingDescription2EXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data VertexInputAttributeDescription2EXT = VertexInputAttributeDescription2EXT
{
VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
location :: Word32
,
VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
binding :: Word32
,
VertexInputAttributeDescription2EXT -> Format
format :: Format
,
VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
offset :: Word32
}
deriving (Typeable, VertexInputAttributeDescription2EXT
-> VertexInputAttributeDescription2EXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VertexInputAttributeDescription2EXT
-> VertexInputAttributeDescription2EXT -> Bool
$c/= :: VertexInputAttributeDescription2EXT
-> VertexInputAttributeDescription2EXT -> Bool
== :: VertexInputAttributeDescription2EXT
-> VertexInputAttributeDescription2EXT -> Bool
$c== :: VertexInputAttributeDescription2EXT
-> VertexInputAttributeDescription2EXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VertexInputAttributeDescription2EXT)
#endif
deriving instance Show VertexInputAttributeDescription2EXT
instance ToCStruct VertexInputAttributeDescription2EXT where
withCStruct :: forall b.
VertexInputAttributeDescription2EXT
-> (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO b)
-> IO b
withCStruct VertexInputAttributeDescription2EXT
x ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p VertexInputAttributeDescription2EXT
x (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO b
f "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p)
pokeCStruct :: forall b.
("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> VertexInputAttributeDescription2EXT -> IO b -> IO b
pokeCStruct "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p VertexInputAttributeDescription2EXT{"vertexBindingDescriptionCount" ::: Word32
Format
offset :: "vertexBindingDescriptionCount" ::: Word32
format :: Format
binding :: "vertexBindingDescriptionCount" ::: Word32
location :: "vertexBindingDescriptionCount" ::: Word32
$sel:offset:VertexInputAttributeDescription2EXT :: VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
$sel:format:VertexInputAttributeDescription2EXT :: VertexInputAttributeDescription2EXT -> Format
$sel:binding:VertexInputAttributeDescription2EXT :: VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
$sel:location:VertexInputAttributeDescription2EXT :: VertexInputAttributeDescription2EXT
-> "vertexBindingDescriptionCount" ::: Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
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 (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
location)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
binding)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Format)) (Format
format)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("vertexBindingDescriptionCount" ::: Word32
offset)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO b -> IO b
pokeZeroCStruct "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
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 (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Format)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputAttributeDescription2EXT where
peekCStruct :: ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO VertexInputAttributeDescription2EXT
peekCStruct "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p = do
"vertexBindingDescriptionCount" ::: Word32
location <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
"vertexBindingDescriptionCount" ::: Word32
binding <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Format))
"vertexBindingDescriptionCount" ::: Word32
offset <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("vertexBindingDescriptionCount" ::: Word32)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> Format
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputAttributeDescription2EXT
VertexInputAttributeDescription2EXT
"vertexBindingDescriptionCount" ::: Word32
location "vertexBindingDescriptionCount" ::: Word32
binding Format
format "vertexBindingDescriptionCount" ::: Word32
offset
instance Storable VertexInputAttributeDescription2EXT where
sizeOf :: VertexInputAttributeDescription2EXT -> Int
sizeOf ~VertexInputAttributeDescription2EXT
_ = Int
32
alignment :: VertexInputAttributeDescription2EXT -> Int
alignment ~VertexInputAttributeDescription2EXT
_ = Int
8
peek :: ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> IO VertexInputAttributeDescription2EXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT)
-> VertexInputAttributeDescription2EXT -> IO ()
poke "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
ptr VertexInputAttributeDescription2EXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pVertexAttributeDescriptions"
::: Ptr VertexInputAttributeDescription2EXT
ptr VertexInputAttributeDescription2EXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputAttributeDescription2EXT where
zero :: VertexInputAttributeDescription2EXT
zero = ("vertexBindingDescriptionCount" ::: Word32)
-> ("vertexBindingDescriptionCount" ::: Word32)
-> Format
-> ("vertexBindingDescriptionCount" ::: Word32)
-> VertexInputAttributeDescription2EXT
VertexInputAttributeDescription2EXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
type EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION = 2
pattern EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION = 2
type EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME = "VK_EXT_vertex_input_dynamic_state"
pattern EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME = "VK_EXT_vertex_input_dynamic_state"