{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_sample_locations ( cmdSetSampleLocationsEXT
, getPhysicalDeviceMultisamplePropertiesEXT
, SampleLocationEXT(..)
, SampleLocationsInfoEXT(..)
, AttachmentSampleLocationsEXT(..)
, SubpassSampleLocationsEXT(..)
, RenderPassSampleLocationsBeginInfoEXT(..)
, PipelineSampleLocationsStateCreateInfoEXT(..)
, PhysicalDeviceSampleLocationsPropertiesEXT(..)
, MultisamplePropertiesEXT(..)
, EXT_SAMPLE_LOCATIONS_SPEC_VERSION
, pattern EXT_SAMPLE_LOCATIONS_SPEC_VERSION
, EXT_SAMPLE_LOCATIONS_EXTENSION_NAME
, pattern EXT_SAMPLE_LOCATIONS_EXTENSION_NAME
) where
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(CFloat))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetSampleLocationsEXT))
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceMultisamplePropertiesEXT))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits(..))
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlags)
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_MULTISAMPLE_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetSampleLocationsEXT
:: FunPtr (Ptr CommandBuffer_T -> Ptr SampleLocationsInfoEXT -> IO ()) -> Ptr CommandBuffer_T -> Ptr SampleLocationsInfoEXT -> IO ()
cmdSetSampleLocationsEXT :: forall io
. (MonadIO io)
=>
CommandBuffer
->
SampleLocationsInfoEXT
-> io ()
cmdSetSampleLocationsEXT :: CommandBuffer -> SampleLocationsInfoEXT -> io ()
cmdSetSampleLocationsEXT commandBuffer :: CommandBuffer
commandBuffer sampleLocationsInfo :: SampleLocationsInfoEXT
sampleLocationsInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetSampleLocationsEXTPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
vkCmdSetSampleLocationsEXTPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
pVkCmdSetSampleLocationsEXT (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
vkCmdSetSampleLocationsEXTPtr FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdSetSampleLocationsEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdSetSampleLocationsEXT' :: Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO ()
vkCmdSetSampleLocationsEXT' = FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ()
mkVkCmdSetSampleLocationsEXT FunPtr
(Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
vkCmdSetSampleLocationsEXTPtr
"pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
pSampleLocationsInfo <- ((("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO ())
-> IO ())
-> ContT
() IO ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> IO ())
-> ContT
() IO ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT))
-> ((("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> IO ())
-> ContT
() IO ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
forall a b. (a -> b) -> a -> b
$ SampleLocationsInfoEXT
-> (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SampleLocationsInfoEXT
sampleLocationsInfo)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdSetSampleLocationsEXT" (Ptr CommandBuffer_T
-> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO ()
vkCmdSetSampleLocationsEXT' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
pSampleLocationsInfo)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetPhysicalDeviceMultisamplePropertiesEXT
:: FunPtr (Ptr PhysicalDevice_T -> SampleCountFlagBits -> Ptr MultisamplePropertiesEXT -> IO ()) -> Ptr PhysicalDevice_T -> SampleCountFlagBits -> Ptr MultisamplePropertiesEXT -> IO ()
getPhysicalDeviceMultisamplePropertiesEXT :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
("samples" ::: SampleCountFlagBits)
-> io (MultisamplePropertiesEXT)
getPhysicalDeviceMultisamplePropertiesEXT :: PhysicalDevice
-> ("samples" ::: SampleCountFlagBits)
-> io MultisamplePropertiesEXT
getPhysicalDeviceMultisamplePropertiesEXT physicalDevice :: PhysicalDevice
physicalDevice samples :: "samples" ::: SampleCountFlagBits
samples = IO MultisamplePropertiesEXT -> io MultisamplePropertiesEXT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MultisamplePropertiesEXT -> io MultisamplePropertiesEXT)
-> (ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
-> IO MultisamplePropertiesEXT)
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
-> io MultisamplePropertiesEXT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
-> IO MultisamplePropertiesEXT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
-> io MultisamplePropertiesEXT)
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
-> io MultisamplePropertiesEXT
forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceMultisamplePropertiesEXTPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
vkGetPhysicalDeviceMultisamplePropertiesEXTPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
pVkGetPhysicalDeviceMultisamplePropertiesEXT (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
IO () -> ContT MultisamplePropertiesEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT MultisamplePropertiesEXT IO ())
-> IO () -> ContT MultisamplePropertiesEXT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
vkGetPhysicalDeviceMultisamplePropertiesEXTPtr FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
-> FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetPhysicalDeviceMultisamplePropertiesEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetPhysicalDeviceMultisamplePropertiesEXT' :: Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ()
vkGetPhysicalDeviceMultisamplePropertiesEXT' = FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
-> Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ()
mkVkGetPhysicalDeviceMultisamplePropertiesEXT FunPtr
(Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ())
vkGetPhysicalDeviceMultisamplePropertiesEXTPtr
"pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
pPMultisampleProperties <- ((("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT)
-> ContT
MultisamplePropertiesEXT
IO
("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct MultisamplePropertiesEXT =>
(("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b)
-> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @MultisamplePropertiesEXT)
IO () -> ContT MultisamplePropertiesEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT MultisamplePropertiesEXT IO ())
-> IO () -> ContT MultisamplePropertiesEXT IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPhysicalDeviceMultisamplePropertiesEXT" (Ptr PhysicalDevice_T
-> ("samples" ::: SampleCountFlagBits)
-> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO ()
vkGetPhysicalDeviceMultisamplePropertiesEXT' (PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)) ("samples" ::: SampleCountFlagBits
samples) ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
pPMultisampleProperties))
MultisamplePropertiesEXT
pMultisampleProperties <- IO MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
forall a b. (a -> b) -> a -> b
$ ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @MultisamplePropertiesEXT "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
pPMultisampleProperties
MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT
-> ContT MultisamplePropertiesEXT IO MultisamplePropertiesEXT
forall a b. (a -> b) -> a -> b
$ (MultisamplePropertiesEXT
pMultisampleProperties)
data SampleLocationEXT = SampleLocationEXT
{
SampleLocationEXT -> Float
x :: Float
,
SampleLocationEXT -> Float
y :: Float
}
deriving (Typeable, SampleLocationEXT -> SampleLocationEXT -> Bool
(SampleLocationEXT -> SampleLocationEXT -> Bool)
-> (SampleLocationEXT -> SampleLocationEXT -> Bool)
-> Eq SampleLocationEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SampleLocationEXT -> SampleLocationEXT -> Bool
$c/= :: SampleLocationEXT -> SampleLocationEXT -> Bool
== :: SampleLocationEXT -> SampleLocationEXT -> Bool
$c== :: SampleLocationEXT -> SampleLocationEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SampleLocationEXT)
#endif
deriving instance Show SampleLocationEXT
instance ToCStruct SampleLocationEXT where
withCStruct :: SampleLocationEXT -> (Ptr SampleLocationEXT -> IO b) -> IO b
withCStruct x :: SampleLocationEXT
x f :: Ptr SampleLocationEXT -> IO b
f = Int -> Int -> (Ptr SampleLocationEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 8 4 ((Ptr SampleLocationEXT -> IO b) -> IO b)
-> (Ptr SampleLocationEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SampleLocationEXT
p -> Ptr SampleLocationEXT -> SampleLocationEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SampleLocationEXT
p SampleLocationEXT
x (Ptr SampleLocationEXT -> IO b
f Ptr SampleLocationEXT
p)
pokeCStruct :: Ptr SampleLocationEXT -> SampleLocationEXT -> IO b -> IO b
pokeCStruct p :: Ptr SampleLocationEXT
p SampleLocationEXT{..} f :: IO b
f = do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
x))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
y))
IO b
f
cStructSize :: Int
cStructSize = 8
cStructAlignment :: Int
cStructAlignment = 4
pokeZeroCStruct :: Ptr SampleLocationEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr SampleLocationEXT
p f :: IO b
f = do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct SampleLocationEXT where
peekCStruct :: Ptr SampleLocationEXT -> IO SampleLocationEXT
peekCStruct p :: Ptr SampleLocationEXT
p = do
CFloat
x <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat))
CFloat
y <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr SampleLocationEXT
p Ptr SampleLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat))
SampleLocationEXT -> IO SampleLocationEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SampleLocationEXT -> IO SampleLocationEXT)
-> SampleLocationEXT -> IO SampleLocationEXT
forall a b. (a -> b) -> a -> b
$ Float -> Float -> SampleLocationEXT
SampleLocationEXT
((\(CFloat a :: Float
a) -> Float
a) CFloat
x) ((\(CFloat a :: Float
a) -> Float
a) CFloat
y)
instance Storable SampleLocationEXT where
sizeOf :: SampleLocationEXT -> Int
sizeOf ~SampleLocationEXT
_ = 8
alignment :: SampleLocationEXT -> Int
alignment ~SampleLocationEXT
_ = 4
peek :: Ptr SampleLocationEXT -> IO SampleLocationEXT
peek = Ptr SampleLocationEXT -> IO SampleLocationEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SampleLocationEXT -> SampleLocationEXT -> IO ()
poke ptr :: Ptr SampleLocationEXT
ptr poked :: SampleLocationEXT
poked = Ptr SampleLocationEXT -> SampleLocationEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SampleLocationEXT
ptr SampleLocationEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SampleLocationEXT where
zero :: SampleLocationEXT
zero = Float -> Float -> SampleLocationEXT
SampleLocationEXT
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
data SampleLocationsInfoEXT = SampleLocationsInfoEXT
{
SampleLocationsInfoEXT -> "samples" ::: SampleCountFlagBits
sampleLocationsPerPixel :: SampleCountFlagBits
,
SampleLocationsInfoEXT -> Extent2D
sampleLocationGridSize :: Extent2D
,
SampleLocationsInfoEXT -> Vector SampleLocationEXT
sampleLocations :: Vector SampleLocationEXT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SampleLocationsInfoEXT)
#endif
deriving instance Show SampleLocationsInfoEXT
instance ToCStruct SampleLocationsInfoEXT where
withCStruct :: SampleLocationsInfoEXT
-> (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO b)
-> IO b
withCStruct x :: SampleLocationsInfoEXT
x f :: ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO b
f = Int
-> Int
-> (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO b)
-> IO b)
-> (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p -> ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p SampleLocationsInfoEXT
x (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT) -> IO b
f "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p)
pokeCStruct :: ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
pokeCStruct p :: "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p SampleLocationsInfoEXT{..} 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 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLE_LOCATIONS_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 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> 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 ("samples" ::: SampleCountFlagBits)
-> ("samples" ::: SampleCountFlagBits) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr ("samples" ::: SampleCountFlagBits)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlagBits)) ("samples" ::: SampleCountFlagBits
sampleLocationsPerPixel)
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 Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) (Extent2D
sampleLocationGridSize)
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 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector SampleLocationEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SampleLocationEXT -> Int)
-> Vector SampleLocationEXT -> Int
forall a b. (a -> b) -> a -> b
$ (Vector SampleLocationEXT
sampleLocations)) :: Word32))
Ptr SampleLocationEXT
pPSampleLocations' <- ((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT))
-> ((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr SampleLocationEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @SampleLocationEXT ((Vector SampleLocationEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SampleLocationEXT
sampleLocations)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 4
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
$ (Int -> SampleLocationEXT -> IO ())
-> Vector SampleLocationEXT -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SampleLocationEXT
e -> Ptr SampleLocationEXT -> SampleLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SampleLocationEXT
pPSampleLocations' Ptr SampleLocationEXT -> Int -> Ptr SampleLocationEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleLocationEXT) (SampleLocationEXT
e)) (Vector SampleLocationEXT
sampleLocations)
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 SampleLocationEXT) -> Ptr SampleLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr (Ptr SampleLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr SampleLocationEXT))) (Ptr SampleLocationEXT
pPSampleLocations')
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 :: ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO b -> IO b
pokeZeroCStruct p :: "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
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 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLE_LOCATIONS_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 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> 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 Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
Ptr SampleLocationEXT
pPSampleLocations' <- ((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT))
-> ((Ptr SampleLocationEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SampleLocationEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr SampleLocationEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @SampleLocationEXT ((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
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
$ (Int -> SampleLocationEXT -> IO ())
-> Vector SampleLocationEXT -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SampleLocationEXT
e -> Ptr SampleLocationEXT -> SampleLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SampleLocationEXT
pPSampleLocations' Ptr SampleLocationEXT -> Int -> Ptr SampleLocationEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleLocationEXT) (SampleLocationEXT
e)) (Vector SampleLocationEXT
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 SampleLocationEXT) -> Ptr SampleLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr (Ptr SampleLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr SampleLocationEXT))) (Ptr SampleLocationEXT
pPSampleLocations')
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 SampleLocationsInfoEXT where
peekCStruct :: ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO SampleLocationsInfoEXT
peekCStruct p :: "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p = do
"samples" ::: SampleCountFlagBits
sampleLocationsPerPixel <- Ptr ("samples" ::: SampleCountFlagBits)
-> IO ("samples" ::: SampleCountFlagBits)
forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr ("samples" ::: SampleCountFlagBits)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlagBits))
Extent2D
sampleLocationGridSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D))
Word32
sampleLocationsCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
Ptr SampleLocationEXT
pSampleLocations <- Ptr (Ptr SampleLocationEXT) -> IO (Ptr SampleLocationEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr SampleLocationEXT) (("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
p ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> Int -> Ptr (Ptr SampleLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr SampleLocationEXT)))
Vector SampleLocationEXT
pSampleLocations' <- Int
-> (Int -> IO SampleLocationEXT) -> IO (Vector SampleLocationEXT)
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
sampleLocationsCount) (\i :: Int
i -> Ptr SampleLocationEXT -> IO SampleLocationEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SampleLocationEXT ((Ptr SampleLocationEXT
pSampleLocations Ptr SampleLocationEXT -> Int -> Ptr SampleLocationEXT
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleLocationEXT)))
SampleLocationsInfoEXT -> IO SampleLocationsInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SampleLocationsInfoEXT -> IO SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO SampleLocationsInfoEXT
forall a b. (a -> b) -> a -> b
$ ("samples" ::: SampleCountFlagBits)
-> Extent2D -> Vector SampleLocationEXT -> SampleLocationsInfoEXT
SampleLocationsInfoEXT
"samples" ::: SampleCountFlagBits
sampleLocationsPerPixel Extent2D
sampleLocationGridSize Vector SampleLocationEXT
pSampleLocations'
instance Zero SampleLocationsInfoEXT where
zero :: SampleLocationsInfoEXT
zero = ("samples" ::: SampleCountFlagBits)
-> Extent2D -> Vector SampleLocationEXT -> SampleLocationsInfoEXT
SampleLocationsInfoEXT
"samples" ::: SampleCountFlagBits
forall a. Zero a => a
zero
Extent2D
forall a. Zero a => a
zero
Vector SampleLocationEXT
forall a. Monoid a => a
mempty
data AttachmentSampleLocationsEXT = AttachmentSampleLocationsEXT
{
AttachmentSampleLocationsEXT -> Word32
attachmentIndex :: Word32
,
AttachmentSampleLocationsEXT -> SampleLocationsInfoEXT
sampleLocationsInfo :: SampleLocationsInfoEXT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AttachmentSampleLocationsEXT)
#endif
deriving instance Show AttachmentSampleLocationsEXT
instance ToCStruct AttachmentSampleLocationsEXT where
withCStruct :: AttachmentSampleLocationsEXT
-> (Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b
withCStruct x :: AttachmentSampleLocationsEXT
x f :: Ptr AttachmentSampleLocationsEXT -> IO b
f = Int -> Int -> (Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> (Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AttachmentSampleLocationsEXT
p -> Ptr AttachmentSampleLocationsEXT
-> AttachmentSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AttachmentSampleLocationsEXT
p AttachmentSampleLocationsEXT
x (Ptr AttachmentSampleLocationsEXT -> IO b
f Ptr AttachmentSampleLocationsEXT
p)
pokeCStruct :: Ptr AttachmentSampleLocationsEXT
-> AttachmentSampleLocationsEXT -> IO b -> IO b
pokeCStruct p :: Ptr AttachmentSampleLocationsEXT
p AttachmentSampleLocationsEXT{..} 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
attachmentIndex)
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
sampleLocationsInfo) (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 = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr AttachmentSampleLocationsEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr AttachmentSampleLocationsEXT
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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
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 AttachmentSampleLocationsEXT where
peekCStruct :: Ptr AttachmentSampleLocationsEXT -> IO AttachmentSampleLocationsEXT
peekCStruct p :: Ptr AttachmentSampleLocationsEXT
p = do
Word32
attachmentIndex <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
SampleLocationsInfoEXT
sampleLocationsInfo <- ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO SampleLocationsInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SampleLocationsInfoEXT ((Ptr AttachmentSampleLocationsEXT
p Ptr AttachmentSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT))
AttachmentSampleLocationsEXT -> IO AttachmentSampleLocationsEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AttachmentSampleLocationsEXT -> IO AttachmentSampleLocationsEXT)
-> AttachmentSampleLocationsEXT -> IO AttachmentSampleLocationsEXT
forall a b. (a -> b) -> a -> b
$ Word32 -> SampleLocationsInfoEXT -> AttachmentSampleLocationsEXT
AttachmentSampleLocationsEXT
Word32
attachmentIndex SampleLocationsInfoEXT
sampleLocationsInfo
instance Zero AttachmentSampleLocationsEXT where
zero :: AttachmentSampleLocationsEXT
zero = Word32 -> SampleLocationsInfoEXT -> AttachmentSampleLocationsEXT
AttachmentSampleLocationsEXT
Word32
forall a. Zero a => a
zero
SampleLocationsInfoEXT
forall a. Zero a => a
zero
data SubpassSampleLocationsEXT = SubpassSampleLocationsEXT
{
SubpassSampleLocationsEXT -> Word32
subpassIndex :: Word32
,
SubpassSampleLocationsEXT -> SampleLocationsInfoEXT
sampleLocationsInfo :: SampleLocationsInfoEXT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassSampleLocationsEXT)
#endif
deriving instance Show SubpassSampleLocationsEXT
instance ToCStruct SubpassSampleLocationsEXT where
withCStruct :: SubpassSampleLocationsEXT
-> (Ptr SubpassSampleLocationsEXT -> IO b) -> IO b
withCStruct x :: SubpassSampleLocationsEXT
x f :: Ptr SubpassSampleLocationsEXT -> IO b
f = Int -> Int -> (Ptr SubpassSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> (Ptr SubpassSampleLocationsEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SubpassSampleLocationsEXT
p -> Ptr SubpassSampleLocationsEXT
-> SubpassSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SubpassSampleLocationsEXT
p SubpassSampleLocationsEXT
x (Ptr SubpassSampleLocationsEXT -> IO b
f Ptr SubpassSampleLocationsEXT
p)
pokeCStruct :: Ptr SubpassSampleLocationsEXT
-> SubpassSampleLocationsEXT -> IO b -> IO b
pokeCStruct p :: Ptr SubpassSampleLocationsEXT
p SubpassSampleLocationsEXT{..} 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
subpassIndex)
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
sampleLocationsInfo) (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 = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr SubpassSampleLocationsEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr SubpassSampleLocationsEXT
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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
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 SubpassSampleLocationsEXT where
peekCStruct :: Ptr SubpassSampleLocationsEXT -> IO SubpassSampleLocationsEXT
peekCStruct p :: Ptr SubpassSampleLocationsEXT
p = do
Word32
subpassIndex <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
SampleLocationsInfoEXT
sampleLocationsInfo <- ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO SampleLocationsInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SampleLocationsInfoEXT ((Ptr SubpassSampleLocationsEXT
p Ptr SubpassSampleLocationsEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr SampleLocationsInfoEXT))
SubpassSampleLocationsEXT -> IO SubpassSampleLocationsEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SubpassSampleLocationsEXT -> IO SubpassSampleLocationsEXT)
-> SubpassSampleLocationsEXT -> IO SubpassSampleLocationsEXT
forall a b. (a -> b) -> a -> b
$ Word32 -> SampleLocationsInfoEXT -> SubpassSampleLocationsEXT
SubpassSampleLocationsEXT
Word32
subpassIndex SampleLocationsInfoEXT
sampleLocationsInfo
instance Zero SubpassSampleLocationsEXT where
zero :: SubpassSampleLocationsEXT
zero = Word32 -> SampleLocationsInfoEXT -> SubpassSampleLocationsEXT
SubpassSampleLocationsEXT
Word32
forall a. Zero a => a
zero
SampleLocationsInfoEXT
forall a. Zero a => a
zero
data RenderPassSampleLocationsBeginInfoEXT = RenderPassSampleLocationsBeginInfoEXT
{
RenderPassSampleLocationsBeginInfoEXT
-> Vector AttachmentSampleLocationsEXT
attachmentInitialSampleLocations :: Vector AttachmentSampleLocationsEXT
,
RenderPassSampleLocationsBeginInfoEXT
-> Vector SubpassSampleLocationsEXT
postSubpassSampleLocations :: Vector SubpassSampleLocationsEXT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderPassSampleLocationsBeginInfoEXT)
#endif
deriving instance Show RenderPassSampleLocationsBeginInfoEXT
instance ToCStruct RenderPassSampleLocationsBeginInfoEXT where
withCStruct :: RenderPassSampleLocationsBeginInfoEXT
-> (Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b) -> IO b
withCStruct x :: RenderPassSampleLocationsBeginInfoEXT
x f :: Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b
f = Int
-> Int
-> (Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b) -> IO b)
-> (Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr RenderPassSampleLocationsBeginInfoEXT
p -> Ptr RenderPassSampleLocationsBeginInfoEXT
-> RenderPassSampleLocationsBeginInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderPassSampleLocationsBeginInfoEXT
p RenderPassSampleLocationsBeginInfoEXT
x (Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b
f Ptr RenderPassSampleLocationsBeginInfoEXT
p)
pokeCStruct :: Ptr RenderPassSampleLocationsBeginInfoEXT
-> RenderPassSampleLocationsBeginInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr RenderPassSampleLocationsBeginInfoEXT
p RenderPassSampleLocationsBeginInfoEXT{..} 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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> 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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> 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 AttachmentSampleLocationsEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AttachmentSampleLocationsEXT -> Int)
-> Vector AttachmentSampleLocationsEXT -> Int
forall a b. (a -> b) -> a -> b
$ (Vector AttachmentSampleLocationsEXT
attachmentInitialSampleLocations)) :: Word32))
Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations' <- ((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT))
-> ((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AttachmentSampleLocationsEXT ((Vector AttachmentSampleLocationsEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AttachmentSampleLocationsEXT
attachmentInitialSampleLocations)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
(Int -> AttachmentSampleLocationsEXT -> ContT b IO ())
-> Vector AttachmentSampleLocationsEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AttachmentSampleLocationsEXT
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 AttachmentSampleLocationsEXT
-> AttachmentSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations' Ptr AttachmentSampleLocationsEXT
-> Int -> Ptr AttachmentSampleLocationsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AttachmentSampleLocationsEXT) (AttachmentSampleLocationsEXT
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 AttachmentSampleLocationsEXT
attachmentInitialSampleLocations)
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 AttachmentSampleLocationsEXT)
-> Ptr AttachmentSampleLocationsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr AttachmentSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr AttachmentSampleLocationsEXT))) (Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations')
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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector SubpassSampleLocationsEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SubpassSampleLocationsEXT -> Int)
-> Vector SubpassSampleLocationsEXT -> Int
forall a b. (a -> b) -> a -> b
$ (Vector SubpassSampleLocationsEXT
postSubpassSampleLocations)) :: Word32))
Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations' <- ((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT))
-> ((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr SubpassSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @SubpassSampleLocationsEXT ((Vector SubpassSampleLocationsEXT -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SubpassSampleLocationsEXT
postSubpassSampleLocations)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
(Int -> SubpassSampleLocationsEXT -> ContT b IO ())
-> Vector SubpassSampleLocationsEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SubpassSampleLocationsEXT
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 SubpassSampleLocationsEXT
-> SubpassSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations' Ptr SubpassSampleLocationsEXT
-> Int -> Ptr SubpassSampleLocationsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SubpassSampleLocationsEXT) (SubpassSampleLocationsEXT
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 SubpassSampleLocationsEXT
postSubpassSampleLocations)
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 SubpassSampleLocationsEXT)
-> Ptr SubpassSampleLocationsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr SubpassSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr SubpassSampleLocationsEXT))) (Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations')
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 = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr RenderPassSampleLocationsBeginInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr RenderPassSampleLocationsBeginInfoEXT
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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_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 RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations' <- ((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT))
-> ((Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr AttachmentSampleLocationsEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr AttachmentSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AttachmentSampleLocationsEXT ((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
* 48) 8
(Int -> AttachmentSampleLocationsEXT -> ContT b IO ())
-> Vector AttachmentSampleLocationsEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AttachmentSampleLocationsEXT
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 AttachmentSampleLocationsEXT
-> AttachmentSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations' Ptr AttachmentSampleLocationsEXT
-> Int -> Ptr AttachmentSampleLocationsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AttachmentSampleLocationsEXT) (AttachmentSampleLocationsEXT
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 AttachmentSampleLocationsEXT
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 AttachmentSampleLocationsEXT)
-> Ptr AttachmentSampleLocationsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr AttachmentSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr AttachmentSampleLocationsEXT))) (Ptr AttachmentSampleLocationsEXT
pPAttachmentInitialSampleLocations')
Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations' <- ((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT))
-> ((Ptr SubpassSampleLocationsEXT -> IO b) -> IO b)
-> ContT b IO (Ptr SubpassSampleLocationsEXT)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr SubpassSampleLocationsEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @SubpassSampleLocationsEXT ((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
* 48) 8
(Int -> SubpassSampleLocationsEXT -> ContT b IO ())
-> Vector SubpassSampleLocationsEXT -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SubpassSampleLocationsEXT
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 SubpassSampleLocationsEXT
-> SubpassSampleLocationsEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations' Ptr SubpassSampleLocationsEXT
-> Int -> Ptr SubpassSampleLocationsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SubpassSampleLocationsEXT) (SubpassSampleLocationsEXT
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 SubpassSampleLocationsEXT
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 SubpassSampleLocationsEXT)
-> Ptr SubpassSampleLocationsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr SubpassSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr SubpassSampleLocationsEXT))) (Ptr SubpassSampleLocationsEXT
pPPostSubpassSampleLocations')
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 RenderPassSampleLocationsBeginInfoEXT where
peekCStruct :: Ptr RenderPassSampleLocationsBeginInfoEXT
-> IO RenderPassSampleLocationsBeginInfoEXT
peekCStruct p :: Ptr RenderPassSampleLocationsBeginInfoEXT
p = do
Word32
attachmentInitialSampleLocationsCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
Ptr AttachmentSampleLocationsEXT
pAttachmentInitialSampleLocations <- Ptr (Ptr AttachmentSampleLocationsEXT)
-> IO (Ptr AttachmentSampleLocationsEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr AttachmentSampleLocationsEXT) ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr AttachmentSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr AttachmentSampleLocationsEXT)))
Vector AttachmentSampleLocationsEXT
pAttachmentInitialSampleLocations' <- Int
-> (Int -> IO AttachmentSampleLocationsEXT)
-> IO (Vector AttachmentSampleLocationsEXT)
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
attachmentInitialSampleLocationsCount) (\i :: Int
i -> Ptr AttachmentSampleLocationsEXT -> IO AttachmentSampleLocationsEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AttachmentSampleLocationsEXT ((Ptr AttachmentSampleLocationsEXT
pAttachmentInitialSampleLocations Ptr AttachmentSampleLocationsEXT
-> Int -> Ptr AttachmentSampleLocationsEXT
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AttachmentSampleLocationsEXT)))
Word32
postSubpassSampleLocationsCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
Ptr SubpassSampleLocationsEXT
pPostSubpassSampleLocations <- Ptr (Ptr SubpassSampleLocationsEXT)
-> IO (Ptr SubpassSampleLocationsEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr SubpassSampleLocationsEXT) ((Ptr RenderPassSampleLocationsBeginInfoEXT
p Ptr RenderPassSampleLocationsBeginInfoEXT
-> Int -> Ptr (Ptr SubpassSampleLocationsEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr SubpassSampleLocationsEXT)))
Vector SubpassSampleLocationsEXT
pPostSubpassSampleLocations' <- Int
-> (Int -> IO SubpassSampleLocationsEXT)
-> IO (Vector SubpassSampleLocationsEXT)
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
postSubpassSampleLocationsCount) (\i :: Int
i -> Ptr SubpassSampleLocationsEXT -> IO SubpassSampleLocationsEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SubpassSampleLocationsEXT ((Ptr SubpassSampleLocationsEXT
pPostSubpassSampleLocations Ptr SubpassSampleLocationsEXT
-> Int -> Ptr SubpassSampleLocationsEXT
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SubpassSampleLocationsEXT)))
RenderPassSampleLocationsBeginInfoEXT
-> IO RenderPassSampleLocationsBeginInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RenderPassSampleLocationsBeginInfoEXT
-> IO RenderPassSampleLocationsBeginInfoEXT)
-> RenderPassSampleLocationsBeginInfoEXT
-> IO RenderPassSampleLocationsBeginInfoEXT
forall a b. (a -> b) -> a -> b
$ Vector AttachmentSampleLocationsEXT
-> Vector SubpassSampleLocationsEXT
-> RenderPassSampleLocationsBeginInfoEXT
RenderPassSampleLocationsBeginInfoEXT
Vector AttachmentSampleLocationsEXT
pAttachmentInitialSampleLocations' Vector SubpassSampleLocationsEXT
pPostSubpassSampleLocations'
instance Zero RenderPassSampleLocationsBeginInfoEXT where
zero :: RenderPassSampleLocationsBeginInfoEXT
zero = Vector AttachmentSampleLocationsEXT
-> Vector SubpassSampleLocationsEXT
-> RenderPassSampleLocationsBeginInfoEXT
RenderPassSampleLocationsBeginInfoEXT
Vector AttachmentSampleLocationsEXT
forall a. Monoid a => a
mempty
Vector SubpassSampleLocationsEXT
forall a. Monoid a => a
mempty
data PipelineSampleLocationsStateCreateInfoEXT = PipelineSampleLocationsStateCreateInfoEXT
{
PipelineSampleLocationsStateCreateInfoEXT -> Bool
sampleLocationsEnable :: Bool
,
PipelineSampleLocationsStateCreateInfoEXT -> SampleLocationsInfoEXT
sampleLocationsInfo :: SampleLocationsInfoEXT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineSampleLocationsStateCreateInfoEXT)
#endif
deriving instance Show PipelineSampleLocationsStateCreateInfoEXT
instance ToCStruct PipelineSampleLocationsStateCreateInfoEXT where
withCStruct :: PipelineSampleLocationsStateCreateInfoEXT
-> (Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b) -> IO b
withCStruct x :: PipelineSampleLocationsStateCreateInfoEXT
x f :: Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b
f = Int
-> Int
-> (Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b) -> IO b)
-> (Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PipelineSampleLocationsStateCreateInfoEXT
p -> Ptr PipelineSampleLocationsStateCreateInfoEXT
-> PipelineSampleLocationsStateCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineSampleLocationsStateCreateInfoEXT
p PipelineSampleLocationsStateCreateInfoEXT
x (Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b
f Ptr PipelineSampleLocationsStateCreateInfoEXT
p)
pokeCStruct :: Ptr PipelineSampleLocationsStateCreateInfoEXT
-> PipelineSampleLocationsStateCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr PipelineSampleLocationsStateCreateInfoEXT
p PipelineSampleLocationsStateCreateInfoEXT{..} 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 PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_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 PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> 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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
sampleLocationsEnable))
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
sampleLocationsInfo) (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 = 64
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PipelineSampleLocationsStateCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PipelineSampleLocationsStateCreateInfoEXT
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 PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_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 PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> 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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT -> 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))
((() -> 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
$ ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> SampleLocationsInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SampleLocationsInfoEXT)) (SampleLocationsInfoEXT
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 PipelineSampleLocationsStateCreateInfoEXT where
peekCStruct :: Ptr PipelineSampleLocationsStateCreateInfoEXT
-> IO PipelineSampleLocationsStateCreateInfoEXT
peekCStruct p :: Ptr PipelineSampleLocationsStateCreateInfoEXT
p = do
Bool32
sampleLocationsEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
SampleLocationsInfoEXT
sampleLocationsInfo <- ("pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT)
-> IO SampleLocationsInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SampleLocationsInfoEXT ((Ptr PipelineSampleLocationsStateCreateInfoEXT
p Ptr PipelineSampleLocationsStateCreateInfoEXT
-> Int -> "pSampleLocationsInfo" ::: Ptr SampleLocationsInfoEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SampleLocationsInfoEXT))
PipelineSampleLocationsStateCreateInfoEXT
-> IO PipelineSampleLocationsStateCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineSampleLocationsStateCreateInfoEXT
-> IO PipelineSampleLocationsStateCreateInfoEXT)
-> PipelineSampleLocationsStateCreateInfoEXT
-> IO PipelineSampleLocationsStateCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ Bool
-> SampleLocationsInfoEXT
-> PipelineSampleLocationsStateCreateInfoEXT
PipelineSampleLocationsStateCreateInfoEXT
(Bool32 -> Bool
bool32ToBool Bool32
sampleLocationsEnable) SampleLocationsInfoEXT
sampleLocationsInfo
instance Zero PipelineSampleLocationsStateCreateInfoEXT where
zero :: PipelineSampleLocationsStateCreateInfoEXT
zero = Bool
-> SampleLocationsInfoEXT
-> PipelineSampleLocationsStateCreateInfoEXT
PipelineSampleLocationsStateCreateInfoEXT
Bool
forall a. Zero a => a
zero
SampleLocationsInfoEXT
forall a. Zero a => a
zero
data PhysicalDeviceSampleLocationsPropertiesEXT = PhysicalDeviceSampleLocationsPropertiesEXT
{
PhysicalDeviceSampleLocationsPropertiesEXT
-> "samples" ::: SampleCountFlagBits
sampleLocationSampleCounts :: SampleCountFlags
,
PhysicalDeviceSampleLocationsPropertiesEXT -> Extent2D
maxSampleLocationGridSize :: Extent2D
,
PhysicalDeviceSampleLocationsPropertiesEXT -> (Float, Float)
sampleLocationCoordinateRange :: (Float, Float)
,
PhysicalDeviceSampleLocationsPropertiesEXT -> Word32
sampleLocationSubPixelBits :: Word32
,
PhysicalDeviceSampleLocationsPropertiesEXT -> Bool
variableSampleLocations :: Bool
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceSampleLocationsPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceSampleLocationsPropertiesEXT
instance ToCStruct PhysicalDeviceSampleLocationsPropertiesEXT where
withCStruct :: PhysicalDeviceSampleLocationsPropertiesEXT
-> (Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b) -> IO b
withCStruct x :: PhysicalDeviceSampleLocationsPropertiesEXT
x f :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p -> Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> PhysicalDeviceSampleLocationsPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p PhysicalDeviceSampleLocationsPropertiesEXT
x (Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b
f Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p)
pokeCStruct :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> PhysicalDeviceSampleLocationsPropertiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p PhysicalDeviceSampleLocationsPropertiesEXT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("samples" ::: SampleCountFlagBits)
-> ("samples" ::: SampleCountFlagBits) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr ("samples" ::: SampleCountFlagBits)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags)) ("samples" ::: SampleCountFlagBits
sampleLocationSampleCounts)
Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) (Extent2D
maxSampleLocationGridSize)
let pSampleLocationCoordinateRange' :: Ptr CFloat
pSampleLocationCoordinateRange' = Ptr (FixedArray 2 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr (FixedArray 2 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr (FixedArray 2 CFloat)))
case ((Float, Float)
sampleLocationCoordinateRange) of
(e0 :: Float
e0, e1 :: Float
e1) -> do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pSampleLocationCoordinateRange' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pSampleLocationCoordinateRange' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) (Word32
sampleLocationSubPixelBits)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
variableSampleLocations))
IO b
f
cStructSize :: Int
cStructSize = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("samples" ::: SampleCountFlagBits)
-> ("samples" ::: SampleCountFlagBits) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr ("samples" ::: SampleCountFlagBits)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags)) ("samples" ::: SampleCountFlagBits
forall a. Zero a => a
zero)
Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
let pSampleLocationCoordinateRange' :: Ptr CFloat
pSampleLocationCoordinateRange' = Ptr (FixedArray 2 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr (FixedArray 2 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr (FixedArray 2 CFloat)))
case ((Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)) of
(e0 :: Float
e0, e1 :: Float
e1) -> do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pSampleLocationCoordinateRange' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pSampleLocationCoordinateRange' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceSampleLocationsPropertiesEXT where
peekCStruct :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT
peekCStruct p :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p = do
"samples" ::: SampleCountFlagBits
sampleLocationSampleCounts <- Ptr ("samples" ::: SampleCountFlagBits)
-> IO ("samples" ::: SampleCountFlagBits)
forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlags ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr ("samples" ::: SampleCountFlagBits)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags))
Extent2D
maxSampleLocationGridSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D))
let psampleLocationCoordinateRange :: Ptr CFloat
psampleLocationCoordinateRange = Ptr (FixedArray 2 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> Int -> Ptr (FixedArray 2 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr (FixedArray 2 CFloat)))
CFloat
sampleLocationCoordinateRange0 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
psampleLocationCoordinateRange Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr CFloat))
CFloat
sampleLocationCoordinateRange1 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
psampleLocationCoordinateRange Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr CFloat))
Word32
sampleLocationSubPixelBits <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32))
Bool32
variableSampleLocations <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceSampleLocationsPropertiesEXT
p Ptr PhysicalDeviceSampleLocationsPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32))
PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT)
-> PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT
forall a b. (a -> b) -> a -> b
$ ("samples" ::: SampleCountFlagBits)
-> Extent2D
-> (Float, Float)
-> Word32
-> Bool
-> PhysicalDeviceSampleLocationsPropertiesEXT
PhysicalDeviceSampleLocationsPropertiesEXT
"samples" ::: SampleCountFlagBits
sampleLocationSampleCounts Extent2D
maxSampleLocationGridSize ((((\(CFloat a :: Float
a) -> Float
a) CFloat
sampleLocationCoordinateRange0), ((\(CFloat a :: Float
a) -> Float
a) CFloat
sampleLocationCoordinateRange1))) Word32
sampleLocationSubPixelBits (Bool32 -> Bool
bool32ToBool Bool32
variableSampleLocations)
instance Storable PhysicalDeviceSampleLocationsPropertiesEXT where
sizeOf :: PhysicalDeviceSampleLocationsPropertiesEXT -> Int
sizeOf ~PhysicalDeviceSampleLocationsPropertiesEXT
_ = 48
alignment :: PhysicalDeviceSampleLocationsPropertiesEXT -> Int
alignment ~PhysicalDeviceSampleLocationsPropertiesEXT
_ = 8
peek :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT
peek = Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> IO PhysicalDeviceSampleLocationsPropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> PhysicalDeviceSampleLocationsPropertiesEXT -> IO ()
poke ptr :: Ptr PhysicalDeviceSampleLocationsPropertiesEXT
ptr poked :: PhysicalDeviceSampleLocationsPropertiesEXT
poked = Ptr PhysicalDeviceSampleLocationsPropertiesEXT
-> PhysicalDeviceSampleLocationsPropertiesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSampleLocationsPropertiesEXT
ptr PhysicalDeviceSampleLocationsPropertiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceSampleLocationsPropertiesEXT where
zero :: PhysicalDeviceSampleLocationsPropertiesEXT
zero = ("samples" ::: SampleCountFlagBits)
-> Extent2D
-> (Float, Float)
-> Word32
-> Bool
-> PhysicalDeviceSampleLocationsPropertiesEXT
PhysicalDeviceSampleLocationsPropertiesEXT
"samples" ::: SampleCountFlagBits
forall a. Zero a => a
zero
Extent2D
forall a. Zero a => a
zero
(Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)
Word32
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data MultisamplePropertiesEXT = MultisamplePropertiesEXT
{
MultisamplePropertiesEXT -> Extent2D
maxSampleLocationGridSize :: Extent2D }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MultisamplePropertiesEXT)
#endif
deriving instance Show MultisamplePropertiesEXT
instance ToCStruct MultisamplePropertiesEXT where
withCStruct :: MultisamplePropertiesEXT
-> (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b)
-> IO b
withCStruct x :: MultisamplePropertiesEXT
x f :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT) -> IO b
f = Int
-> Int
-> (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b)
-> IO b)
-> (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p -> ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p MultisamplePropertiesEXT
x (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT) -> IO b
f "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p)
pokeCStruct :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT -> IO b -> IO b
pokeCStruct p :: "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p MultisamplePropertiesEXT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
maxSampleLocationGridSize)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO b -> IO b
pokeZeroCStruct p :: "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct MultisamplePropertiesEXT where
peekCStruct :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT
peekCStruct p :: "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p = do
Extent2D
maxSampleLocationGridSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D (("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
p ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
MultisamplePropertiesEXT -> IO MultisamplePropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MultisamplePropertiesEXT -> IO MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT -> IO MultisamplePropertiesEXT
forall a b. (a -> b) -> a -> b
$ Extent2D -> MultisamplePropertiesEXT
MultisamplePropertiesEXT
Extent2D
maxSampleLocationGridSize
instance Storable MultisamplePropertiesEXT where
sizeOf :: MultisamplePropertiesEXT -> Int
sizeOf ~MultisamplePropertiesEXT
_ = 24
alignment :: MultisamplePropertiesEXT -> Int
alignment ~MultisamplePropertiesEXT
_ = 8
peek :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT
peek = ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> IO MultisamplePropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT -> IO ()
poke ptr :: "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
ptr poked :: MultisamplePropertiesEXT
poked = ("pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT)
-> MultisamplePropertiesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pMultisampleProperties" ::: Ptr MultisamplePropertiesEXT
ptr MultisamplePropertiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero MultisamplePropertiesEXT where
zero :: MultisamplePropertiesEXT
zero = Extent2D -> MultisamplePropertiesEXT
MultisamplePropertiesEXT
Extent2D
forall a. Zero a => a
zero
type EXT_SAMPLE_LOCATIONS_SPEC_VERSION = 1
pattern EXT_SAMPLE_LOCATIONS_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_SAMPLE_LOCATIONS_SPEC_VERSION :: a
$mEXT_SAMPLE_LOCATIONS_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_SAMPLE_LOCATIONS_SPEC_VERSION = 1
type EXT_SAMPLE_LOCATIONS_EXTENSION_NAME = "VK_EXT_sample_locations"
pattern EXT_SAMPLE_LOCATIONS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_SAMPLE_LOCATIONS_EXTENSION_NAME :: a
$mEXT_SAMPLE_LOCATIONS_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_SAMPLE_LOCATIONS_EXTENSION_NAME = "VK_EXT_sample_locations"