{-# language CPP #-}
module Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback ( PipelineCreationFeedback(..)
, PipelineCreationFeedbackCreateInfo(..)
, StructureType(..)
, PipelineCreationFeedbackFlagBits(..)
, PipelineCreationFeedbackFlags
) 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.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.Word (Word64)
import Data.Kind (Type)
import Vulkan.Core13.Enums.PipelineCreationFeedbackFlagBits (PipelineCreationFeedbackFlags)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO))
import Vulkan.Core13.Enums.PipelineCreationFeedbackFlagBits (PipelineCreationFeedbackFlagBits(..))
import Vulkan.Core13.Enums.PipelineCreationFeedbackFlagBits (PipelineCreationFeedbackFlags)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
data PipelineCreationFeedback = PipelineCreationFeedback
{
PipelineCreationFeedback -> PipelineCreationFeedbackFlags
flags :: PipelineCreationFeedbackFlags
,
PipelineCreationFeedback -> Word64
duration :: Word64
}
deriving (Typeable, PipelineCreationFeedback -> PipelineCreationFeedback -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineCreationFeedback -> PipelineCreationFeedback -> Bool
$c/= :: PipelineCreationFeedback -> PipelineCreationFeedback -> Bool
== :: PipelineCreationFeedback -> PipelineCreationFeedback -> Bool
$c== :: PipelineCreationFeedback -> PipelineCreationFeedback -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineCreationFeedback)
#endif
deriving instance Show PipelineCreationFeedback
instance ToCStruct PipelineCreationFeedback where
withCStruct :: forall b.
PipelineCreationFeedback
-> (Ptr PipelineCreationFeedback -> IO b) -> IO b
withCStruct PipelineCreationFeedback
x Ptr PipelineCreationFeedback -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCreationFeedback
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedback
p PipelineCreationFeedback
x (Ptr PipelineCreationFeedback -> IO b
f Ptr PipelineCreationFeedback
p)
pokeCStruct :: forall b.
Ptr PipelineCreationFeedback
-> PipelineCreationFeedback -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedback
p PipelineCreationFeedback{Word64
PipelineCreationFeedbackFlags
duration :: Word64
flags :: PipelineCreationFeedbackFlags
$sel:duration:PipelineCreationFeedback :: PipelineCreationFeedback -> Word64
$sel:flags:PipelineCreationFeedback :: PipelineCreationFeedback -> PipelineCreationFeedbackFlags
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags)) (PipelineCreationFeedbackFlags
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64)) (Word64
duration)
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PipelineCreationFeedback -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCreationFeedback
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PipelineCreationFeedback where
peekCStruct :: Ptr PipelineCreationFeedback -> IO PipelineCreationFeedback
peekCStruct Ptr PipelineCreationFeedback
p = do
PipelineCreationFeedbackFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineCreationFeedbackFlags ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags))
Word64
duration <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PipelineCreationFeedback
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ PipelineCreationFeedbackFlags -> Word64 -> PipelineCreationFeedback
PipelineCreationFeedback
PipelineCreationFeedbackFlags
flags Word64
duration
instance Storable PipelineCreationFeedback where
sizeOf :: PipelineCreationFeedback -> Int
sizeOf ~PipelineCreationFeedback
_ = Int
16
alignment :: PipelineCreationFeedback -> Int
alignment ~PipelineCreationFeedback
_ = Int
8
peek :: Ptr PipelineCreationFeedback -> IO PipelineCreationFeedback
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineCreationFeedback -> PipelineCreationFeedback -> IO ()
poke Ptr PipelineCreationFeedback
ptr PipelineCreationFeedback
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedback
ptr PipelineCreationFeedback
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineCreationFeedback where
zero :: PipelineCreationFeedback
zero = PipelineCreationFeedbackFlags -> Word64 -> PipelineCreationFeedback
PipelineCreationFeedback
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineCreationFeedbackCreateInfo = PipelineCreationFeedbackCreateInfo
{
PipelineCreationFeedbackCreateInfo -> Ptr PipelineCreationFeedback
pipelineCreationFeedback :: Ptr PipelineCreationFeedback
,
PipelineCreationFeedbackCreateInfo -> Word32
pipelineStageCreationFeedbackCount :: Word32
,
PipelineCreationFeedbackCreateInfo -> Ptr PipelineCreationFeedback
pipelineStageCreationFeedbacks :: Ptr PipelineCreationFeedback
}
deriving (Typeable, PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool
$c/= :: PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool
== :: PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool
$c== :: PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineCreationFeedbackCreateInfo)
#endif
deriving instance Show PipelineCreationFeedbackCreateInfo
instance ToCStruct PipelineCreationFeedbackCreateInfo where
withCStruct :: forall b.
PipelineCreationFeedbackCreateInfo
-> (Ptr PipelineCreationFeedbackCreateInfo -> IO b) -> IO b
withCStruct PipelineCreationFeedbackCreateInfo
x Ptr PipelineCreationFeedbackCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCreationFeedbackCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedbackCreateInfo
p PipelineCreationFeedbackCreateInfo
x (Ptr PipelineCreationFeedbackCreateInfo -> IO b
f Ptr PipelineCreationFeedbackCreateInfo
p)
pokeCStruct :: forall b.
Ptr PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedbackCreateInfo
p PipelineCreationFeedbackCreateInfo{Word32
Ptr PipelineCreationFeedback
pipelineStageCreationFeedbacks :: Ptr PipelineCreationFeedback
pipelineStageCreationFeedbackCount :: Word32
pipelineCreationFeedback :: Ptr PipelineCreationFeedback
$sel:pipelineStageCreationFeedbacks:PipelineCreationFeedbackCreateInfo :: PipelineCreationFeedbackCreateInfo -> Ptr PipelineCreationFeedback
$sel:pipelineStageCreationFeedbackCount:PipelineCreationFeedbackCreateInfo :: PipelineCreationFeedbackCreateInfo -> Word32
$sel:pipelineCreationFeedback:PipelineCreationFeedbackCreateInfo :: PipelineCreationFeedbackCreateInfo -> Ptr PipelineCreationFeedback
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
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 PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback))) (Ptr PipelineCreationFeedback
pipelineCreationFeedback)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
pipelineStageCreationFeedbackCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineCreationFeedback))) (Ptr PipelineCreationFeedback
pipelineStageCreationFeedbacks)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PipelineCreationFeedbackCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCreationFeedbackCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
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 PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineCreationFeedback))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PipelineCreationFeedbackCreateInfo where
peekCStruct :: Ptr PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo
peekCStruct Ptr PipelineCreationFeedbackCreateInfo
p = do
Ptr PipelineCreationFeedback
pPipelineCreationFeedback <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineCreationFeedback) ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback)))
Word32
pipelineStageCreationFeedbackCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Ptr PipelineCreationFeedback
pPipelineStageCreationFeedbacks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineCreationFeedback) ((Ptr PipelineCreationFeedbackCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineCreationFeedback)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr PipelineCreationFeedback
-> Word32
-> Ptr PipelineCreationFeedback
-> PipelineCreationFeedbackCreateInfo
PipelineCreationFeedbackCreateInfo
Ptr PipelineCreationFeedback
pPipelineCreationFeedback
Word32
pipelineStageCreationFeedbackCount
Ptr PipelineCreationFeedback
pPipelineStageCreationFeedbacks
instance Storable PipelineCreationFeedbackCreateInfo where
sizeOf :: PipelineCreationFeedbackCreateInfo -> Int
sizeOf ~PipelineCreationFeedbackCreateInfo
_ = Int
40
alignment :: PipelineCreationFeedbackCreateInfo -> Int
alignment ~PipelineCreationFeedbackCreateInfo
_ = Int
8
peek :: Ptr PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> IO ()
poke Ptr PipelineCreationFeedbackCreateInfo
ptr PipelineCreationFeedbackCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedbackCreateInfo
ptr PipelineCreationFeedbackCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineCreationFeedbackCreateInfo where
zero :: PipelineCreationFeedbackCreateInfo
zero = Ptr PipelineCreationFeedback
-> Word32
-> Ptr PipelineCreationFeedback
-> PipelineCreationFeedbackCreateInfo
PipelineCreationFeedbackCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero