{-# 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 (allocaBytes)
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 Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.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.Core10.Enums.StructureType (StructureType)
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
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 :: forall b.
VertexInputBindingDivisorDescriptionEXT
-> (Ptr VertexInputBindingDivisorDescriptionEXT -> IO b) -> IO b
withCStruct VertexInputBindingDivisorDescriptionEXT
x Ptr VertexInputBindingDivisorDescriptionEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
8 forall a b. (a -> b) -> a -> b
$ \Ptr VertexInputBindingDivisorDescriptionEXT
p -> 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 :: forall b.
Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDivisorDescriptionEXT
p VertexInputBindingDivisorDescriptionEXT{Word32
divisor :: Word32
binding :: Word32
$sel:divisor:VertexInputBindingDivisorDescriptionEXT :: VertexInputBindingDivisorDescriptionEXT -> Word32
$sel:binding:VertexInputBindingDivisorDescriptionEXT :: VertexInputBindingDivisorDescriptionEXT -> Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
binding)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Word32
divisor)
IO b
f
cStructSize :: Int
cStructSize = Int
8
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: forall b.
Ptr VertexInputBindingDivisorDescriptionEXT -> IO b -> IO b
pokeZeroCStruct Ptr VertexInputBindingDivisorDescriptionEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputBindingDivisorDescriptionEXT where
peekCStruct :: Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
peekCStruct Ptr VertexInputBindingDivisorDescriptionEXT
p = do
Word32
binding <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Word32
divisor <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDivisorDescriptionEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> Word32 -> VertexInputBindingDivisorDescriptionEXT
VertexInputBindingDivisorDescriptionEXT
Word32
binding Word32
divisor
instance Storable VertexInputBindingDivisorDescriptionEXT where
sizeOf :: VertexInputBindingDivisorDescriptionEXT -> Int
sizeOf ~VertexInputBindingDivisorDescriptionEXT
_ = Int
8
alignment :: VertexInputBindingDivisorDescriptionEXT -> Int
alignment ~VertexInputBindingDivisorDescriptionEXT
_ = Int
4
peek :: Ptr VertexInputBindingDivisorDescriptionEXT
-> IO VertexInputBindingDivisorDescriptionEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputBindingDivisorDescriptionEXT
-> VertexInputBindingDivisorDescriptionEXT -> IO ()
poke Ptr VertexInputBindingDivisorDescriptionEXT
ptr VertexInputBindingDivisorDescriptionEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDivisorDescriptionEXT
ptr VertexInputBindingDivisorDescriptionEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputBindingDivisorDescriptionEXT where
zero :: VertexInputBindingDivisorDescriptionEXT
zero = Word32 -> Word32 -> VertexInputBindingDivisorDescriptionEXT
VertexInputBindingDivisorDescriptionEXT
forall a. Zero a => a
zero
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 :: forall b.
PipelineVertexInputDivisorStateCreateInfoEXT
-> (Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b)
-> IO b
withCStruct PipelineVertexInputDivisorStateCreateInfoEXT
x Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p -> 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 :: forall b.
Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> PipelineVertexInputDivisorStateCreateInfoEXT -> IO b -> IO b
pokeCStruct Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p PipelineVertexInputDivisorStateCreateInfoEXT{Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors :: Vector VertexInputBindingDivisorDescriptionEXT
$sel:vertexBindingDivisors:PipelineVertexInputDivisorStateCreateInfoEXT :: PipelineVertexInputDivisorStateCreateInfoEXT
-> Vector VertexInputBindingDivisorDescriptionEXT
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
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 -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT)
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 -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
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 -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((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
$ (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)) :: Word32))
Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' <- 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 @VertexInputBindingDivisorDescriptionEXT ((forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)) forall a. Num a => a -> a -> a
* Int
8)
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 VertexInputBindingDivisorDescriptionEXT
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDivisorDescriptionEXT) (VertexInputBindingDivisorDescriptionEXT
e)) (Vector VertexInputBindingDivisorDescriptionEXT
vertexBindingDivisors)
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 -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDivisorDescriptionEXT))) (Ptr VertexInputBindingDivisorDescriptionEXT
pPVertexBindingDivisors')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PipelineVertexInputDivisorStateCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct PipelineVertexInputDivisorStateCreateInfoEXT where
peekCStruct :: Ptr PipelineVertexInputDivisorStateCreateInfoEXT
-> IO PipelineVertexInputDivisorStateCreateInfoEXT
peekCStruct Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p = do
Word32
vertexBindingDivisorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Ptr VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputBindingDivisorDescriptionEXT) ((Ptr PipelineVertexInputDivisorStateCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDivisorDescriptionEXT)))
Vector VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
vertexBindingDivisorCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputBindingDivisorDescriptionEXT ((Ptr VertexInputBindingDivisorDescriptionEXT
pVertexBindingDivisors forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDivisorDescriptionEXT)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
forall a. Monoid a => a
mempty
data PhysicalDeviceVertexAttributeDivisorPropertiesEXT = PhysicalDeviceVertexAttributeDivisorPropertiesEXT
{
PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Word32
maxVertexAttribDivisor :: Word32 }
deriving (Typeable, PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Bool
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 :: forall b.
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> (Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT
x Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p -> 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 :: forall b.
Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p PhysicalDeviceVertexAttributeDivisorPropertiesEXT{Word32
maxVertexAttribDivisor :: Word32
$sel:maxVertexAttribDivisor:PhysicalDeviceVertexAttributeDivisorPropertiesEXT :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
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 PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
maxVertexAttribDivisor)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
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 PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
peekCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
peekCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p = do
Word32
maxVertexAttribDivisor <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
Word32
maxVertexAttribDivisor
instance Storable PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
sizeOf :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Int
sizeOf ~PhysicalDeviceVertexAttributeDivisorPropertiesEXT
_ = Int
24
alignment :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> Int
alignment ~PhysicalDeviceVertexAttributeDivisorPropertiesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> IO PhysicalDeviceVertexAttributeDivisorPropertiesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
-> PhysicalDeviceVertexAttributeDivisorPropertiesEXT -> IO ()
poke Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
ptr PhysicalDeviceVertexAttributeDivisorPropertiesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVertexAttributeDivisorPropertiesEXT where
zero :: PhysicalDeviceVertexAttributeDivisorPropertiesEXT
zero = Word32 -> PhysicalDeviceVertexAttributeDivisorPropertiesEXT
PhysicalDeviceVertexAttributeDivisorPropertiesEXT
forall a. Zero a => a
zero
data PhysicalDeviceVertexAttributeDivisorFeaturesEXT = PhysicalDeviceVertexAttributeDivisorFeaturesEXT
{
PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
vertexAttributeInstanceRateDivisor :: Bool
,
PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
vertexAttributeInstanceRateZeroDivisor :: Bool
}
deriving (Typeable, PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
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 :: forall b.
PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> (Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT
x Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p -> 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 :: forall b.
Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p PhysicalDeviceVertexAttributeDivisorFeaturesEXT{Bool
vertexAttributeInstanceRateZeroDivisor :: Bool
vertexAttributeInstanceRateDivisor :: Bool
$sel:vertexAttributeInstanceRateZeroDivisor:PhysicalDeviceVertexAttributeDivisorFeaturesEXT :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
$sel:vertexAttributeInstanceRateDivisor:PhysicalDeviceVertexAttributeDivisorFeaturesEXT :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
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 PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexAttributeInstanceRateDivisor))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexAttributeInstanceRateZeroDivisor))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
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 PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
peekCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p = do
Bool32
vertexAttributeInstanceRateDivisor <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
vertexAttributeInstanceRateZeroDivisor <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
_ = Int
24
alignment :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> Int
alignment ~PhysicalDeviceVertexAttributeDivisorFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> IO PhysicalDeviceVertexAttributeDivisorFeaturesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
-> PhysicalDeviceVertexAttributeDivisorFeaturesEXT -> IO ()
poke Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
ptr PhysicalDeviceVertexAttributeDivisorFeaturesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVertexAttributeDivisorFeaturesEXT where
zero :: PhysicalDeviceVertexAttributeDivisorFeaturesEXT
zero = Bool -> Bool -> PhysicalDeviceVertexAttributeDivisorFeaturesEXT
PhysicalDeviceVertexAttributeDivisorFeaturesEXT
forall a. Zero a => a
zero
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 :: forall a. Integral a => a
$mEXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> 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 :: forall a. (Eq a, IsString a) => a
$mEXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME = "VK_EXT_vertex_attribute_divisor"