{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_fragment_density_map ( PhysicalDeviceFragmentDensityMapFeaturesEXT(..)
, PhysicalDeviceFragmentDensityMapPropertiesEXT(..)
, RenderPassFragmentDensityMapCreateInfoEXT(..)
, EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION
, pattern EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION
, EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME
, pattern EXT_FRAGMENT_DENSITY_MAP_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.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 Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.BaseType (bool32ToBool)
import Vulkan.Core10.BaseType (boolToBool32)
import Vulkan.Core10.Pass (AttachmentReference)
import Vulkan.Core10.BaseType (Bool32)
import Vulkan.Core10.SharedTypes (Extent2D)
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_FRAGMENT_DENSITY_MAP_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT))
data PhysicalDeviceFragmentDensityMapFeaturesEXT = PhysicalDeviceFragmentDensityMapFeaturesEXT
{
PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMap :: Bool
,
PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMapDynamic :: Bool
,
PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMapNonSubsampledImages :: Bool
}
deriving (Typeable)
deriving instance Show PhysicalDeviceFragmentDensityMapFeaturesEXT
instance ToCStruct PhysicalDeviceFragmentDensityMapFeaturesEXT where
withCStruct :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentDensityMapFeaturesEXT
x f :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p -> Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p PhysicalDeviceFragmentDensityMapFeaturesEXT
x (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b
f Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p)
pokeCStruct :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p PhysicalDeviceFragmentDensityMapFeaturesEXT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> 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 PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMap))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMapDynamic))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMapNonSubsampledImages))
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> 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 PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> 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 PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> 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))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceFragmentDensityMapFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT
peekCStruct p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p = do
Bool32
fragmentDensityMap <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
Bool32
fragmentDensityMapDynamic <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32))
Bool32
fragmentDensityMapNonSubsampledImages <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32))
PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT)
-> PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> Bool -> PhysicalDeviceFragmentDensityMapFeaturesEXT
PhysicalDeviceFragmentDensityMapFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityMap) (Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityMapDynamic) (Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityMapNonSubsampledImages)
instance Storable PhysicalDeviceFragmentDensityMapFeaturesEXT where
sizeOf :: PhysicalDeviceFragmentDensityMapFeaturesEXT -> Int
sizeOf ~PhysicalDeviceFragmentDensityMapFeaturesEXT
_ = 32
alignment :: PhysicalDeviceFragmentDensityMapFeaturesEXT -> Int
alignment ~PhysicalDeviceFragmentDensityMapFeaturesEXT
_ = 8
peek :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT
peek = Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> IO PhysicalDeviceFragmentDensityMapFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO ()
poke ptr :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
ptr poked :: PhysicalDeviceFragmentDensityMapFeaturesEXT
poked = Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceFragmentDensityMapFeaturesEXT where
zero :: PhysicalDeviceFragmentDensityMapFeaturesEXT
zero = Bool -> Bool -> Bool -> PhysicalDeviceFragmentDensityMapFeaturesEXT
PhysicalDeviceFragmentDensityMapFeaturesEXT
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data PhysicalDeviceFragmentDensityMapPropertiesEXT = PhysicalDeviceFragmentDensityMapPropertiesEXT
{
PhysicalDeviceFragmentDensityMapPropertiesEXT -> Extent2D
minFragmentDensityTexelSize :: Extent2D
,
PhysicalDeviceFragmentDensityMapPropertiesEXT -> Extent2D
maxFragmentDensityTexelSize :: Extent2D
,
PhysicalDeviceFragmentDensityMapPropertiesEXT -> Bool
fragmentDensityInvocations :: Bool
}
deriving (Typeable)
deriving instance Show PhysicalDeviceFragmentDensityMapPropertiesEXT
instance ToCStruct PhysicalDeviceFragmentDensityMapPropertiesEXT where
withCStruct :: PhysicalDeviceFragmentDensityMapPropertiesEXT
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentDensityMapPropertiesEXT
x f :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p -> Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p PhysicalDeviceFragmentDensityMapPropertiesEXT
x (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b
f Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p)
pokeCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p PhysicalDeviceFragmentDensityMapPropertiesEXT{..} 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 PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_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 PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
minFragmentDensityTexelSize) (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
$ ())
((() -> 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 Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) (Extent2D
maxFragmentDensityTexelSize) (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
$ ())
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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityInvocations))
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 = 40
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
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 PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_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 PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero) (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
$ ())
((() -> 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 Extent2D -> Extent2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero) (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
$ ())
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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
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 PhysicalDeviceFragmentDensityMapPropertiesEXT where
peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
peekCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p = do
Extent2D
minFragmentDensityTexelSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
Extent2D
maxFragmentDensityTexelSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D))
Bool32
fragmentDensityInvocations <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32))
PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT)
-> PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
forall a b. (a -> b) -> a -> b
$ Extent2D
-> Extent2D
-> Bool
-> PhysicalDeviceFragmentDensityMapPropertiesEXT
PhysicalDeviceFragmentDensityMapPropertiesEXT
Extent2D
minFragmentDensityTexelSize Extent2D
maxFragmentDensityTexelSize (Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityInvocations)
instance Zero PhysicalDeviceFragmentDensityMapPropertiesEXT where
zero :: PhysicalDeviceFragmentDensityMapPropertiesEXT
zero = Extent2D
-> Extent2D
-> Bool
-> PhysicalDeviceFragmentDensityMapPropertiesEXT
PhysicalDeviceFragmentDensityMapPropertiesEXT
Extent2D
forall a. Zero a => a
zero
Extent2D
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data RenderPassFragmentDensityMapCreateInfoEXT = RenderPassFragmentDensityMapCreateInfoEXT
{
RenderPassFragmentDensityMapCreateInfoEXT -> AttachmentReference
fragmentDensityMapAttachment :: AttachmentReference }
deriving (Typeable)
deriving instance Show RenderPassFragmentDensityMapCreateInfoEXT
instance ToCStruct RenderPassFragmentDensityMapCreateInfoEXT where
withCStruct :: RenderPassFragmentDensityMapCreateInfoEXT
-> (Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b) -> IO b
withCStruct x :: RenderPassFragmentDensityMapCreateInfoEXT
x f :: Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b
f = Int
-> Int
-> (Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b) -> IO b)
-> (Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
p -> Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> RenderPassFragmentDensityMapCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderPassFragmentDensityMapCreateInfoEXT
p RenderPassFragmentDensityMapCreateInfoEXT
x (Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b
f Ptr RenderPassFragmentDensityMapCreateInfoEXT
p)
pokeCStruct :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> RenderPassFragmentDensityMapCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
p RenderPassFragmentDensityMapCreateInfoEXT{..} 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 RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_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 RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 AttachmentReference -> AttachmentReference -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr AttachmentReference
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AttachmentReference)) (AttachmentReference
fragmentDensityMapAttachment) (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
$ ())
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 = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr RenderPassFragmentDensityMapCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
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 RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_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 RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 AttachmentReference -> AttachmentReference -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr AttachmentReference
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AttachmentReference)) (AttachmentReference
forall a. Zero a => a
zero) (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
$ ())
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 RenderPassFragmentDensityMapCreateInfoEXT where
peekCStruct :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> IO RenderPassFragmentDensityMapCreateInfoEXT
peekCStruct p :: Ptr RenderPassFragmentDensityMapCreateInfoEXT
p = do
AttachmentReference
fragmentDensityMapAttachment <- Ptr AttachmentReference -> IO AttachmentReference
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AttachmentReference ((Ptr RenderPassFragmentDensityMapCreateInfoEXT
p Ptr RenderPassFragmentDensityMapCreateInfoEXT
-> Int -> Ptr AttachmentReference
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AttachmentReference))
RenderPassFragmentDensityMapCreateInfoEXT
-> IO RenderPassFragmentDensityMapCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RenderPassFragmentDensityMapCreateInfoEXT
-> IO RenderPassFragmentDensityMapCreateInfoEXT)
-> RenderPassFragmentDensityMapCreateInfoEXT
-> IO RenderPassFragmentDensityMapCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ AttachmentReference -> RenderPassFragmentDensityMapCreateInfoEXT
RenderPassFragmentDensityMapCreateInfoEXT
AttachmentReference
fragmentDensityMapAttachment
instance Zero RenderPassFragmentDensityMapCreateInfoEXT where
zero :: RenderPassFragmentDensityMapCreateInfoEXT
zero = AttachmentReference -> RenderPassFragmentDensityMapCreateInfoEXT
RenderPassFragmentDensityMapCreateInfoEXT
AttachmentReference
forall a. Zero a => a
zero
type EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION = 1
pattern EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: a
$mEXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION = 1
type EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME = "VK_EXT_fragment_density_map"
pattern EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: a
$mEXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME = "VK_EXT_fragment_density_map"