{-# language CPP #-}
module Vulkan.Extensions.VK_QCOM_fragment_density_map_offset ( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM(..)
, PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM(..)
, SubpassFragmentDensityMapOffsetEndInfoQCOM(..)
, QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION
, pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION
, QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME
, pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_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.FundamentalTypes (Extent2D)
import Vulkan.Core10.FundamentalTypes (Offset2D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM))
data PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM = PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
{
PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
fragmentDensityMapOffset :: Bool }
deriving (Typeable, PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
$c/= :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
== :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
$c== :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
instance ToCStruct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM where
withCStruct :: forall b.
PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> (Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> IO b)
-> IO b
withCStruct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
x Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
x (Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> IO b
f Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM{Bool
fragmentDensityMapOffset :: Bool
$sel:fragmentDensityMapOffset:PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMapOffset))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM where
peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> IO PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
peekCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
p = do
Bool32
fragmentDensityMapOffset <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
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 -> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
(Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityMapOffset)
instance Storable PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM where
sizeOf :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Int
sizeOf ~PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
_ = Int
24
alignment :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Int
alignment ~PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
_ = Int
8
peek :: Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> IO PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> IO ()
poke Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
ptr PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM where
zero :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
zero = Bool -> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
forall a. Zero a => a
zero
data PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM = PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
{
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Extent2D
fragmentDensityOffsetGranularity :: Extent2D }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
instance ToCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
withCStruct :: forall b.
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> (Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO b)
-> IO b
withCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
x Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
x (Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> IO b
f Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM{Extent2D
fragmentDensityOffsetGranularity :: Extent2D
$sel:fragmentDensityOffsetGranularity:PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Extent2D
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (Extent2D
fragmentDensityOffsetGranularity)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
peekCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p = do
Extent2D
fragmentDensityOffsetGranularity <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Extent2D -> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
Extent2D
fragmentDensityOffsetGranularity
instance Storable PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
sizeOf :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Int
sizeOf ~PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
_ = Int
24
alignment :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Int
alignment ~PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
_ = Int
8
peek :: Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> IO ()
poke Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
zero :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
zero = Extent2D -> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
forall a. Zero a => a
zero
data SubpassFragmentDensityMapOffsetEndInfoQCOM = SubpassFragmentDensityMapOffsetEndInfoQCOM
{
SubpassFragmentDensityMapOffsetEndInfoQCOM -> Vector Offset2D
fragmentDensityOffsets :: Vector Offset2D }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassFragmentDensityMapOffsetEndInfoQCOM)
#endif
deriving instance Show SubpassFragmentDensityMapOffsetEndInfoQCOM
instance ToCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM where
withCStruct :: forall b.
SubpassFragmentDensityMapOffsetEndInfoQCOM
-> (Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b) -> IO b
withCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM
x Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p SubpassFragmentDensityMapOffsetEndInfoQCOM
x (Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b
f Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p)
pokeCStruct :: forall b.
Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
-> SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b -> IO b
pokeCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p SubpassFragmentDensityMapOffsetEndInfoQCOM{Vector Offset2D
fragmentDensityOffsets :: Vector Offset2D
$sel:fragmentDensityOffsets:SubpassFragmentDensityMapOffsetEndInfoQCOM :: SubpassFragmentDensityMapOffsetEndInfoQCOM -> Vector Offset2D
..} 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 SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM)
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 SubpassFragmentDensityMapOffsetEndInfoQCOM
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 SubpassFragmentDensityMapOffsetEndInfoQCOM
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 Offset2D
fragmentDensityOffsets)) :: Word32))
Ptr Offset2D
pPFragmentDensityOffsets' <- 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 @Offset2D ((forall a. Vector a -> Int
Data.Vector.length (Vector Offset2D
fragmentDensityOffsets)) 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 Offset2D
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset2D
pPFragmentDensityOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Offset2D) (Offset2D
e)) (Vector Offset2D
fragmentDensityOffsets)
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 SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Offset2D))) (Ptr Offset2D
pPFragmentDensityOffsets')
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 SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b -> IO b
pokeZeroCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM where
peekCStruct :: Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
-> IO SubpassFragmentDensityMapOffsetEndInfoQCOM
peekCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p = do
Word32
fragmentDensityOffsetCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Ptr Offset2D
pFragmentDensityOffsets <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Offset2D) ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Offset2D)))
Vector Offset2D
pFragmentDensityOffsets' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
fragmentDensityOffsetCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset2D ((Ptr Offset2D
pFragmentDensityOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Offset2D)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector Offset2D -> SubpassFragmentDensityMapOffsetEndInfoQCOM
SubpassFragmentDensityMapOffsetEndInfoQCOM
Vector Offset2D
pFragmentDensityOffsets'
instance Zero SubpassFragmentDensityMapOffsetEndInfoQCOM where
zero :: SubpassFragmentDensityMapOffsetEndInfoQCOM
zero = Vector Offset2D -> SubpassFragmentDensityMapOffsetEndInfoQCOM
SubpassFragmentDensityMapOffsetEndInfoQCOM
forall a. Monoid a => a
mempty
type QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION = 1
pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall a . Integral a => a
pattern $bQCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall a. Integral a => a
$mQCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION = 1
type QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME = "VK_QCOM_fragment_density_map_offset"
pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bQCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mQCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME = "VK_QCOM_fragment_density_map_offset"