{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_vertex_attribute_divisor ( VertexInputBindingDivisorDescriptionEXT(..)
, PipelineVertexInputDivisorStateCreateInfoEXT(..)
, PhysicalDeviceVertexAttributeDivisorPropertiesEXT(..)
, PhysicalDeviceVertexAttributeDivisorFeaturesEXT(..)
, EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION
, pattern EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION
, EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME
, pattern EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT))
data VertexInputBindingDivisorDescriptionEXT = VertexInputBindingDivisorDescriptionEXT
{
VertexInputBindingDivisorDescriptionEXT -> Word32
binding :: Word32
,
VertexInputBindingDivisorDescriptionEXT -> Word32
divisor :: Word32
}
deriving (Typeable, VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool
(VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool)
-> (VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool)
-> Eq VertexInputBindingDivisorDescriptionEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool
$c/= :: VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool
== :: VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool
$c== :: VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VertexInputBindingDivisorDescriptionEXT)
#endif
deriving instance Show VertexInputBindingDivisorDescriptionEXT
instance ToCStruct VertexInputBindingDivisorDescriptionEXT where
withCStruct :: VertexInputBindingDivisorDescriptionEXT
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b
withCStruct x :: VertexInputBindingDivisorDescriptionEXT
x f :: Ptr VertexInputBindingDivisorDescriptionEXT -> IO b
f = Int
-> Int
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 8 4 ((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr VertexInputBindingDivisorDescriptionEXT
p -> Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDivisorDescriptionEXT
p VertexInputBindingDivisorDescriptionEXT
x (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b
f Ptr VertexInputBindingDivisorDescriptionEXT
p)
pokeCStruct :: Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
pokeCStruct p :: Ptr VertexInputBindingDivisorDescriptionEXT
p VertexInputBindingDivisorDescriptionEXT{..} f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
binding)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
divisor)
IO b
f
cStructSize :: Int
cStructSize = 8
cStructAlignment :: Int
cStructAlignment = 4
pokeZeroCStruct :: Ptr VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr VertexInputBindingDivisorDescriptionEXT
p f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputBindingDivisorDescriptionEXT where
peekCStruct :: Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
peekCStruct p :: Ptr VertexInputBindingDivisorDescriptionEXT
p = do
Word32
binding <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
Word32
divisor <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDivisorDescriptionEXT
p Ptr VertexInputBindingDivisorDescriptionEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT)
-> VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
forall a b. (a -> b) -> a -> b
$ Word32 -> Word32 -> VertexInputBindingDivisorDescriptionEXT
VertexInputBindingDivisorDescriptionEXT
Word32
binding Word32
divisor
instance Storable VertexInputBindingDivisorDescriptionEXT where
sizeOf :: VertexInputBindingDivisorDescriptionEXT -> Int
sizeOf ~VertexInputBindingDivisorDescriptionEXT
_ = 8
alignment :: VertexInputBindingDivisorDescriptionEXT -> Int
alignment ~VertexInputBindingDivisorDescriptionEXT
_ = 4
peek :: Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
peek = Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO ()
poke ptr :: Ptr VertexInputBindingDivisorDescriptionEXT
ptr poked :: VertexInputBindingDivisorDescriptionEXT
poked = Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDivisorDescriptionEXT
ptr VertexInputBindingDivisorDescriptionEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputBindingDivisorDescriptionEXT where
zero :: VertexInputBindingDivisorDescriptionEXT
zero = Word32 -> Word32 -> VertexInputBindingDivisorDescriptionEXT
VertexInputBindingDivisorDescriptionEXT
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
data PipelineVertexInputDivisorStateCreateInfoEXT = PipelineVertexInputDivisorStateCreateInfoEXT
{
PipelineVertexInputDivisorStateCreateInfoEXT
-> Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors :: Vector VertexInputBindingDivisorDescriptionEXT }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineVertexInputDivisorStateCreateInfoEXT)
#endif
deriving instance Show PipelineVertexInputDivisorStateCreateInfoEXT
instance ToCStruct PipelineVertexInputDivisorStateCreateInfoEXT where
withCStruct :: PipelineVertexInputDivisorStateCreateInfoEXT
-> (Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b)
-> IO b
withCStruct x :: PipelineVertexInputDivisorStateCreateInfoEXT
x f :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b
f = Int
-> Int
-> (Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b)
-> IO b)
-> (Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p -> Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> PipelineVertexInputDivisorStateCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p PipelineVertexInputDivisorStateCreateInfoEXT
x (Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b
f Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p)
pokeCStruct :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> PipelineVertexInputDivisorStateCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p PipelineVertexInputDivisorStateCreateInfoEXT{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector VertexInputBindingDivisorDescriptionEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDivisorDescriptionEXT -> Int)
-> Vector VertexInputBindingDivisorDescriptionEXT -> Int
forall a b. (a -> b) -> a -> b
$ (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)) :: Word32))
Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' <- ((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT))
-> ((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @VertexInputBindingDivisorDescriptionEXT ((Vector VertexInputBindingDivisorDescriptionEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 4
(Int -> VertexInputBindingDivisorDescriptionEXT -> ContT b IO ())
-> Vector VertexInputBindingDivisorDescriptionEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: VertexInputBindingDivisorDescriptionEXT
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' Ptr VertexInputBindingDivisorDescriptionEXT
-> Int -> Ptr VertexInputBindingDivisorDescriptionEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDivisorDescriptionEXT) (VertexInputBindingDivisorDescriptionEXT
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
-> Ptr VertexInputBindingDivisorDescriptionEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr VertexInputBindingDivisorDescriptionEXT))) (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' <- ((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT))
-> ((Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @VertexInputBindingDivisorDescriptionEXT ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 4
(Int -> VertexInputBindingDivisorDescriptionEXT -> ContT b IO ())
-> Vector VertexInputBindingDivisorDescriptionEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: VertexInputBindingDivisorDescriptionEXT
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' Ptr VertexInputBindingDivisorDescriptionEXT
-> Int -> Ptr VertexInputBindingDivisorDescriptionEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDivisorDescriptionEXT) (VertexInputBindingDivisorDescriptionEXT
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector VertexInputBindingDivisorDescriptionEXT
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
-> Ptr VertexInputBindingDivisorDescriptionEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr VertexInputBindingDivisorDescriptionEXT))) (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance FromCStruct PipelineVertexInputDivisorStateCreateInfoEXT where
peekCStruct :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> IO PipelineVertexInputDivisorStateCreateInfoEXT
peekCStruct p :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p = do
Word32
vertexBindingDivisorCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
Ptr VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors <- Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
-> IO (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputBindingDivisorDescriptionEXT) ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> Int -> Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)))
Vector VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors' <- Int
-> (Int -> IO VertexInputBindingDivisorDescriptionEXT)
-> IO (Vector VertexInputBindingDivisorDescriptionEXT)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
vertexBindingDivisorCount) (\i :: Int
i -> Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputBindingDivisorDescriptionEXT ((Ptr VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors Ptr VertexInputBindingDivisorDescriptionEXT
-> Int -> Ptr VertexInputBindingDivisorDescriptionEXT
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDivisorDescriptionEXT)))
PipelineVertexInputDivisorStateCreateInfoEXT
-> IO PipelineVertexInputDivisorStateCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineVertexInputDivisorStateCreateInfoEXT
-> IO PipelineVertexInputDivisorStateCreateInfoEXT)
-> PipelineVertexInputDivisorStateCreateInfoEXT
-> IO PipelineVertexInputDivisorStateCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ Vector VertexInputBindingDivisorDescriptionEXT
-> PipelineVertexInputDivisorStateCreateInfoEXT
PipelineVertexInputDivisorStateCreateInfoEXT
Vector VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors'
instance Zero PipelineVertexInputDivisorStateCreateInfoEXT where
zero :: PipelineVertexInputDivisorStateCreateInfoEXT
zero = Vector VertexInputBindingDivisorDescriptionEXT
-> PipelineVertexInputDivisorStateCreateInfoEXT
PipelineVertexInputDivisorStateCreateInfoEXT
Vector VertexInputBindingDivisorDescriptionEXT
forall a. Monoid a => a
mempty
data PhysicalDeviceVertexAttributeDivisorPropertiesEXT = PhysicalDeviceVertexAttributeDivisorPropertiesEXT
{
PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Word32
maxVertexAttribDivisor :: Word32 }
deriving (Typeable, PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
(PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool)
-> (PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool)
-> Eq PhysicalDeviceVertexAttributeDivisorPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
$c/= :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
== :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
$c== :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceVertexAttributeDivisorPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceVertexAttributeDivisorPropertiesEXT
instance ToCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
withCStruct :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> (Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
x f :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p -> Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p PhysicalDeviceVertexAttributeDivisorPropertiesEXT
x (Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b
f Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p)
pokeCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO b
-> IO b
pokeCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p PhysicalDeviceVertexAttributeDivisorPropertiesEXT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
maxVertexAttribDivisor)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
peekCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
peekCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p = do
Word32
maxVertexAttribDivisor <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT)
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
forall a b. (a -> b) -> a -> b
$ Word32 -> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
Word32
maxVertexAttribDivisor
instance Storable PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
sizeOf :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Int
sizeOf ~PhysicalDeviceVertexAttributeDivisorPropertiesEXT
_ = 24
alignment :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Int
alignment ~PhysicalDeviceVertexAttributeDivisorPropertiesEXT
_ = 8
peek :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
peek = Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO ()
poke ptr :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
ptr poked :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
poked = Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
zero :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
zero = Word32 -> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
Word32
forall a. Zero a => a
zero
data PhysicalDeviceVertexAttributeDivisorFeaturesEXT = PhysicalDeviceVertexAttributeDivisorFeaturesEXT
{
PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
vertexAttributeInstanceRateDivisor :: Bool
,
PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
vertexAttributeInstanceRateZeroDivisor :: Bool
}
deriving (Typeable, PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
(PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool)
-> (PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool)
-> Eq PhysicalDeviceVertexAttributeDivisorFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
$c/= :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
== :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
$c== :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceVertexAttributeDivisorFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceVertexAttributeDivisorFeaturesEXT
instance ToCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
withCStruct :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> (Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
x f :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p -> Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p PhysicalDeviceVertexAttributeDivisorFeaturesEXT
x (Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b
f Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p)
pokeCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p PhysicalDeviceVertexAttributeDivisorFeaturesEXT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexAttributeInstanceRateDivisor))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexAttributeInstanceRateZeroDivisor))
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
peekCStruct p :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p = do
Bool32
vertexAttributeInstanceRateDivisor <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
Bool32
vertexAttributeInstanceRateZeroDivisor <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32))
PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT)
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> PhysicalDeviceVertexAttributeDivisorFeaturesEXT
PhysicalDeviceVertexAttributeDivisorFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
vertexAttributeInstanceRateDivisor) (Bool32 -> Bool
bool32ToBool Bool32
vertexAttributeInstanceRateZeroDivisor)
instance Storable PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
sizeOf :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Int
sizeOf ~PhysicalDeviceVertexAttributeDivisorFeaturesEXT
_ = 24
alignment :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Int
alignment ~PhysicalDeviceVertexAttributeDivisorFeaturesEXT
_ = 8
peek :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
peek = Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO ()
poke ptr :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
ptr poked :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
poked = Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
zero :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
zero = Bool -> Bool -> PhysicalDeviceVertexAttributeDivisorFeaturesEXT
PhysicalDeviceVertexAttributeDivisorFeaturesEXT
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
type EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION = 3
pattern EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION :: a
$mEXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION = 3
type EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME = "VK_EXT_vertex_attribute_divisor"
pattern EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME :: a
$mEXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME = "VK_EXT_vertex_attribute_divisor"