{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_incremental_present ( PresentRegionsKHR(..)
, PresentRegionKHR(..)
, RectLayerKHR(..)
, KHR_INCREMENTAL_PRESENT_SPEC_VERSION
, pattern KHR_INCREMENTAL_PRESENT_SPEC_VERSION
, KHR_INCREMENTAL_PRESENT_EXTENSION_NAME
, pattern KHR_INCREMENTAL_PRESENT_EXTENSION_NAME
) where
import Control.Monad (unless)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
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 qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
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 (Extent2D)
import Vulkan.Core10.FundamentalTypes (Offset2D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_REGIONS_KHR))
data PresentRegionsKHR = PresentRegionsKHR
{
PresentRegionsKHR -> Word32
swapchainCount :: Word32
,
PresentRegionsKHR -> Vector PresentRegionKHR
regions :: Vector PresentRegionKHR
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentRegionsKHR)
#endif
deriving instance Show PresentRegionsKHR
instance ToCStruct PresentRegionsKHR where
withCStruct :: forall b.
PresentRegionsKHR -> (Ptr PresentRegionsKHR -> IO b) -> IO b
withCStruct PresentRegionsKHR
x Ptr PresentRegionsKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PresentRegionsKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentRegionsKHR
p PresentRegionsKHR
x (Ptr PresentRegionsKHR -> IO b
f Ptr PresentRegionsKHR
p)
pokeCStruct :: forall b.
Ptr PresentRegionsKHR -> PresentRegionsKHR -> IO b -> IO b
pokeCStruct Ptr PresentRegionsKHR
p PresentRegionsKHR{Word32
Vector PresentRegionKHR
regions :: Vector PresentRegionKHR
swapchainCount :: Word32
$sel:regions:PresentRegionsKHR :: PresentRegionsKHR -> Vector PresentRegionKHR
$sel:swapchainCount:PresentRegionsKHR :: PresentRegionsKHR -> Word32
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_REGIONS_KHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
let pRegionsLength :: Int
pRegionsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector PresentRegionKHR
regions)
Word32
swapchainCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if (Word32
swapchainCount) forall a. Eq a => a -> a -> Bool
== Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pRegionsLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pRegionsLength forall a. Eq a => a -> a -> Bool
== (Word32
swapchainCount) Bool -> Bool -> Bool
|| Int
pRegionsLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pRegions must be empty or have 'swapchainCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32
swapchainCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
swapchainCount'')
Ptr PresentRegionKHR
pRegions'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector PresentRegionKHR
regions)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr PresentRegionKHR
pPRegions <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @PresentRegionKHR (((forall a. Vector a -> Int
Data.Vector.length (Vector PresentRegionKHR
regions))) forall a. Num a => a -> a -> a
* Int
16)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i PresentRegionKHR
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr PresentRegionKHR
pPRegions forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentRegionKHR) (PresentRegionKHR
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ((Vector PresentRegionKHR
regions))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr PresentRegionKHR
pPRegions
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr PresentRegionKHR))) Ptr PresentRegionKHR
pRegions''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PresentRegionsKHR -> IO b -> IO b
pokeZeroCStruct Ptr PresentRegionsKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_REGIONS_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct PresentRegionsKHR where
peekCStruct :: Ptr PresentRegionsKHR -> IO PresentRegionsKHR
peekCStruct Ptr PresentRegionsKHR
p = do
Word32
swapchainCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Ptr PresentRegionKHR
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PresentRegionKHR) ((Ptr PresentRegionsKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr PresentRegionKHR)))
let pRegionsLength :: Int
pRegionsLength = if Ptr PresentRegionKHR
pRegions forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
swapchainCount)
Vector PresentRegionKHR
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pRegionsLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PresentRegionKHR ((Ptr PresentRegionKHR
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentRegionKHR)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> Vector PresentRegionKHR -> PresentRegionsKHR
PresentRegionsKHR
Word32
swapchainCount Vector PresentRegionKHR
pRegions'
instance Zero PresentRegionsKHR where
zero :: PresentRegionsKHR
zero = Word32 -> Vector PresentRegionKHR -> PresentRegionsKHR
PresentRegionsKHR
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data PresentRegionKHR = PresentRegionKHR
{
PresentRegionKHR -> Word32
rectangleCount :: Word32
,
PresentRegionKHR -> Vector RectLayerKHR
rectangles :: Vector RectLayerKHR
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentRegionKHR)
#endif
deriving instance Show PresentRegionKHR
instance ToCStruct PresentRegionKHR where
withCStruct :: forall b.
PresentRegionKHR -> (Ptr PresentRegionKHR -> IO b) -> IO b
withCStruct PresentRegionKHR
x Ptr PresentRegionKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr PresentRegionKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentRegionKHR
p PresentRegionKHR
x (Ptr PresentRegionKHR -> IO b
f Ptr PresentRegionKHR
p)
pokeCStruct :: forall b. Ptr PresentRegionKHR -> PresentRegionKHR -> IO b -> IO b
pokeCStruct Ptr PresentRegionKHR
p PresentRegionKHR{Word32
Vector RectLayerKHR
rectangles :: Vector RectLayerKHR
rectangleCount :: Word32
$sel:rectangles:PresentRegionKHR :: PresentRegionKHR -> Vector RectLayerKHR
$sel:rectangleCount:PresentRegionKHR :: PresentRegionKHR -> Word32
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let pRectanglesLength :: Int
pRectanglesLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector RectLayerKHR
rectangles)
Word32
rectangleCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if (Word32
rectangleCount) forall a. Eq a => a -> a -> Bool
== Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pRectanglesLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pRectanglesLength forall a. Eq a => a -> a -> Bool
== (Word32
rectangleCount) Bool -> Bool -> Bool
|| Int
pRectanglesLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pRectangles must be empty or have 'rectangleCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32
rectangleCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
rectangleCount'')
Ptr RectLayerKHR
pRectangles'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector RectLayerKHR
rectangles)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr RectLayerKHR
pPRectangles <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @RectLayerKHR (((forall a. Vector a -> Int
Data.Vector.length (Vector RectLayerKHR
rectangles))) forall a. Num a => a -> a -> a
* Int
20)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i RectLayerKHR
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RectLayerKHR
pPRectangles forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
20 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr RectLayerKHR) (RectLayerKHR
e)) ((Vector RectLayerKHR
rectangles))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr RectLayerKHR
pPRectangles
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentRegionKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr RectLayerKHR))) Ptr RectLayerKHR
pRectangles''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PresentRegionKHR -> IO b -> IO b
pokeZeroCStruct Ptr PresentRegionKHR
_ IO b
f = IO b
f
instance FromCStruct PresentRegionKHR where
peekCStruct :: Ptr PresentRegionKHR -> IO PresentRegionKHR
peekCStruct Ptr PresentRegionKHR
p = do
Word32
rectangleCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PresentRegionKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Ptr RectLayerKHR
pRectangles <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr RectLayerKHR) ((Ptr PresentRegionKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr RectLayerKHR)))
let pRectanglesLength :: Int
pRectanglesLength = if Ptr RectLayerKHR
pRectangles forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
rectangleCount)
Vector RectLayerKHR
pRectangles' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pRectanglesLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @RectLayerKHR ((Ptr RectLayerKHR
pRectangles forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
20 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr RectLayerKHR)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> Vector RectLayerKHR -> PresentRegionKHR
PresentRegionKHR
Word32
rectangleCount Vector RectLayerKHR
pRectangles'
instance Zero PresentRegionKHR where
zero :: PresentRegionKHR
zero = Word32 -> Vector RectLayerKHR -> PresentRegionKHR
PresentRegionKHR
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data RectLayerKHR = RectLayerKHR
{
RectLayerKHR -> Offset2D
offset :: Offset2D
,
RectLayerKHR -> Extent2D
extent :: Extent2D
,
RectLayerKHR -> Word32
layer :: Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RectLayerKHR)
#endif
deriving instance Show RectLayerKHR
instance ToCStruct RectLayerKHR where
withCStruct :: forall b. RectLayerKHR -> (Ptr RectLayerKHR -> IO b) -> IO b
withCStruct RectLayerKHR
x Ptr RectLayerKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
20 forall a b. (a -> b) -> a -> b
$ \Ptr RectLayerKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RectLayerKHR
p RectLayerKHR
x (Ptr RectLayerKHR -> IO b
f Ptr RectLayerKHR
p)
pokeCStruct :: forall b. Ptr RectLayerKHR -> RectLayerKHR -> IO b -> IO b
pokeCStruct Ptr RectLayerKHR
p RectLayerKHR{Word32
Offset2D
Extent2D
layer :: Word32
extent :: Extent2D
offset :: Offset2D
$sel:layer:RectLayerKHR :: RectLayerKHR -> Word32
$sel:extent:RectLayerKHR :: RectLayerKHR -> Extent2D
$sel:offset:RectLayerKHR :: RectLayerKHR -> Offset2D
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Offset2D)) (Offset2D
offset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Extent2D)) (Extent2D
extent)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
layer)
IO b
f
cStructSize :: Int
cStructSize = Int
20
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: forall b. Ptr RectLayerKHR -> IO b -> IO b
pokeZeroCStruct Ptr RectLayerKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Offset2D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Extent2D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct RectLayerKHR where
peekCStruct :: Ptr RectLayerKHR -> IO RectLayerKHR
peekCStruct Ptr RectLayerKHR
p = do
Offset2D
offset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset2D ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Offset2D))
Extent2D
extent <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Extent2D))
Word32
layer <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RectLayerKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Offset2D -> Extent2D -> Word32 -> RectLayerKHR
RectLayerKHR
Offset2D
offset Extent2D
extent Word32
layer
instance Storable RectLayerKHR where
sizeOf :: RectLayerKHR -> Int
sizeOf ~RectLayerKHR
_ = Int
20
alignment :: RectLayerKHR -> Int
alignment ~RectLayerKHR
_ = Int
4
peek :: Ptr RectLayerKHR -> IO RectLayerKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr RectLayerKHR -> RectLayerKHR -> IO ()
poke Ptr RectLayerKHR
ptr RectLayerKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RectLayerKHR
ptr RectLayerKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero RectLayerKHR where
zero :: RectLayerKHR
zero = Offset2D -> Extent2D -> Word32 -> RectLayerKHR
RectLayerKHR
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
type KHR_INCREMENTAL_PRESENT_SPEC_VERSION = 2
pattern KHR_INCREMENTAL_PRESENT_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_INCREMENTAL_PRESENT_SPEC_VERSION :: forall a. Integral a => a
$mKHR_INCREMENTAL_PRESENT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_INCREMENTAL_PRESENT_SPEC_VERSION = 2
type KHR_INCREMENTAL_PRESENT_EXTENSION_NAME = "VK_KHR_incremental_present"
pattern KHR_INCREMENTAL_PRESENT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_INCREMENTAL_PRESENT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_INCREMENTAL_PRESENT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_INCREMENTAL_PRESENT_EXTENSION_NAME = "VK_KHR_incremental_present"