{-# language CPP #-}
module Vulkan.Extensions.VK_GGP_frame_token ( PresentFrameTokenGGP(..)
, GGP_FRAME_TOKEN_SPEC_VERSION
, pattern GGP_FRAME_TOKEN_SPEC_VERSION
, GGP_FRAME_TOKEN_EXTENSION_NAME
, pattern GGP_FRAME_TOKEN_EXTENSION_NAME
, GgpFrameToken
) where
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP))
data PresentFrameTokenGGP = PresentFrameTokenGGP
{
PresentFrameTokenGGP -> GgpFrameToken
frameToken :: GgpFrameToken }
deriving (Typeable, PresentFrameTokenGGP -> PresentFrameTokenGGP -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PresentFrameTokenGGP -> PresentFrameTokenGGP -> Bool
$c/= :: PresentFrameTokenGGP -> PresentFrameTokenGGP -> Bool
== :: PresentFrameTokenGGP -> PresentFrameTokenGGP -> Bool
$c== :: PresentFrameTokenGGP -> PresentFrameTokenGGP -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PresentFrameTokenGGP)
#endif
deriving instance Show PresentFrameTokenGGP
instance ToCStruct PresentFrameTokenGGP where
withCStruct :: forall b.
PresentFrameTokenGGP -> (Ptr PresentFrameTokenGGP -> IO b) -> IO b
withCStruct PresentFrameTokenGGP
x Ptr PresentFrameTokenGGP -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PresentFrameTokenGGP
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentFrameTokenGGP
p PresentFrameTokenGGP
x (Ptr PresentFrameTokenGGP -> IO b
f Ptr PresentFrameTokenGGP
p)
pokeCStruct :: forall b.
Ptr PresentFrameTokenGGP -> PresentFrameTokenGGP -> IO b -> IO b
pokeCStruct Ptr PresentFrameTokenGGP
p PresentFrameTokenGGP{GgpFrameToken
frameToken :: GgpFrameToken
$sel:frameToken:PresentFrameTokenGGP :: PresentFrameTokenGGP -> GgpFrameToken
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GgpFrameToken)) (GgpFrameToken
frameToken)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PresentFrameTokenGGP -> IO b -> IO b
pokeZeroCStruct Ptr PresentFrameTokenGGP
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GgpFrameToken)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PresentFrameTokenGGP where
peekCStruct :: Ptr PresentFrameTokenGGP -> IO PresentFrameTokenGGP
peekCStruct Ptr PresentFrameTokenGGP
p = do
GgpFrameToken
frameToken <- forall a. Storable a => Ptr a -> IO a
peek @GgpFrameToken ((Ptr PresentFrameTokenGGP
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GgpFrameToken))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ GgpFrameToken -> PresentFrameTokenGGP
PresentFrameTokenGGP
GgpFrameToken
frameToken
instance Storable PresentFrameTokenGGP where
sizeOf :: PresentFrameTokenGGP -> Int
sizeOf ~PresentFrameTokenGGP
_ = Int
24
alignment :: PresentFrameTokenGGP -> Int
alignment ~PresentFrameTokenGGP
_ = Int
8
peek :: Ptr PresentFrameTokenGGP -> IO PresentFrameTokenGGP
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PresentFrameTokenGGP -> PresentFrameTokenGGP -> IO ()
poke Ptr PresentFrameTokenGGP
ptr PresentFrameTokenGGP
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PresentFrameTokenGGP
ptr PresentFrameTokenGGP
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PresentFrameTokenGGP where
zero :: PresentFrameTokenGGP
zero = GgpFrameToken -> PresentFrameTokenGGP
PresentFrameTokenGGP
forall a. Zero a => a
zero
type GGP_FRAME_TOKEN_SPEC_VERSION = 1
pattern GGP_FRAME_TOKEN_SPEC_VERSION :: forall a . Integral a => a
pattern $bGGP_FRAME_TOKEN_SPEC_VERSION :: forall a. Integral a => a
$mGGP_FRAME_TOKEN_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
GGP_FRAME_TOKEN_SPEC_VERSION = 1
type GGP_FRAME_TOKEN_EXTENSION_NAME = "VK_GGP_frame_token"
pattern GGP_FRAME_TOKEN_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bGGP_FRAME_TOKEN_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mGGP_FRAME_TOKEN_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
GGP_FRAME_TOKEN_EXTENSION_NAME = "VK_GGP_frame_token"
type GgpFrameToken = Word32