{-# 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
(PipelineCreationFeedback -> PipelineCreationFeedback -> Bool)
-> (PipelineCreationFeedback -> PipelineCreationFeedback -> Bool)
-> Eq PipelineCreationFeedback
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 :: PipelineCreationFeedback
-> (Ptr PipelineCreationFeedback -> IO b) -> IO b
withCStruct PipelineCreationFeedback
x Ptr PipelineCreationFeedback -> IO b
f = Int -> (Ptr PipelineCreationFeedback -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr PipelineCreationFeedback -> IO b) -> IO b)
-> (Ptr PipelineCreationFeedback -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCreationFeedback
p -> Ptr PipelineCreationFeedback
-> PipelineCreationFeedback -> IO b -> IO b
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 :: 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
Ptr PipelineCreationFeedbackFlags
-> PipelineCreationFeedbackFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback
-> Int -> Ptr PipelineCreationFeedbackFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags)) (PipelineCreationFeedbackFlags
flags)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback -> Int -> Ptr Word64
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 :: Ptr PipelineCreationFeedback -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCreationFeedback
p IO b
f = do
Ptr PipelineCreationFeedbackFlags
-> PipelineCreationFeedbackFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback
-> Int -> Ptr PipelineCreationFeedbackFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags)) (PipelineCreationFeedbackFlags
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64)) (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 <- Ptr PipelineCreationFeedbackFlags
-> IO PipelineCreationFeedbackFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineCreationFeedbackFlags ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback
-> Int -> Ptr PipelineCreationFeedbackFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PipelineCreationFeedbackFlags))
Word64
duration <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PipelineCreationFeedback
p Ptr PipelineCreationFeedback -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word64))
PipelineCreationFeedback -> IO PipelineCreationFeedback
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineCreationFeedback -> IO PipelineCreationFeedback)
-> PipelineCreationFeedback -> IO PipelineCreationFeedback
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 = Ptr PipelineCreationFeedback -> IO PipelineCreationFeedback
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineCreationFeedback -> PipelineCreationFeedback -> IO ()
poke Ptr PipelineCreationFeedback
ptr PipelineCreationFeedback
poked = Ptr PipelineCreationFeedback
-> PipelineCreationFeedback -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedback
ptr PipelineCreationFeedback
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineCreationFeedback where
zero :: PipelineCreationFeedback
zero = PipelineCreationFeedbackFlags -> Word64 -> PipelineCreationFeedback
PipelineCreationFeedback
PipelineCreationFeedbackFlags
forall a. Zero a => a
zero
Word64
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
(PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool)
-> (PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> Bool)
-> Eq PipelineCreationFeedbackCreateInfo
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 :: PipelineCreationFeedbackCreateInfo
-> (Ptr PipelineCreationFeedbackCreateInfo -> IO b) -> IO b
withCStruct PipelineCreationFeedbackCreateInfo
x Ptr PipelineCreationFeedbackCreateInfo -> IO b
f = Int -> (Ptr PipelineCreationFeedbackCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PipelineCreationFeedbackCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineCreationFeedbackCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCreationFeedbackCreateInfo
p -> Ptr PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> IO b -> IO b
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 :: 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
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (Ptr PipelineCreationFeedback)
-> Ptr PipelineCreationFeedback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback))) (Ptr PipelineCreationFeedback
pipelineCreationFeedback)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
pipelineStageCreationFeedbackCount)
Ptr (Ptr PipelineCreationFeedback)
-> Ptr PipelineCreationFeedback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
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 :: Ptr PipelineCreationFeedbackCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCreationFeedbackCreateInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (Ptr PipelineCreationFeedback)
-> Ptr PipelineCreationFeedback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback))) (Ptr PipelineCreationFeedback
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr (Ptr PipelineCreationFeedback)
-> Ptr PipelineCreationFeedback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineCreationFeedback))) (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 <- Ptr (Ptr PipelineCreationFeedback)
-> IO (Ptr PipelineCreationFeedback)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineCreationFeedback) ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineCreationFeedback)))
Word32
pipelineStageCreationFeedbackCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Ptr PipelineCreationFeedback
pPipelineStageCreationFeedbacks <- Ptr (Ptr PipelineCreationFeedback)
-> IO (Ptr PipelineCreationFeedback)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineCreationFeedback) ((Ptr PipelineCreationFeedbackCreateInfo
p Ptr PipelineCreationFeedbackCreateInfo
-> Int -> Ptr (Ptr PipelineCreationFeedback)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineCreationFeedback)))
PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo)
-> PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo
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 = Ptr PipelineCreationFeedbackCreateInfo
-> IO PipelineCreationFeedbackCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> IO ()
poke Ptr PipelineCreationFeedbackCreateInfo
ptr PipelineCreationFeedbackCreateInfo
poked = Ptr PipelineCreationFeedbackCreateInfo
-> PipelineCreationFeedbackCreateInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreationFeedbackCreateInfo
ptr PipelineCreationFeedbackCreateInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineCreationFeedbackCreateInfo where
zero :: PipelineCreationFeedbackCreateInfo
zero = Ptr PipelineCreationFeedback
-> Word32
-> Ptr PipelineCreationFeedback
-> PipelineCreationFeedbackCreateInfo
PipelineCreationFeedbackCreateInfo
Ptr PipelineCreationFeedback
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Ptr PipelineCreationFeedback
forall a. Zero a => a
zero