{-# language CPP #-}
module Graphics.Vulkan.Extensions.VK_EXT_pipeline_creation_feedback ( PipelineCreationFeedbackEXT(..)
, PipelineCreationFeedbackCreateInfoEXT(..)
, PipelineCreationFeedbackFlagBitsEXT( PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT
, PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT
, PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT
, ..
)
, PipelineCreationFeedbackFlagsEXT
, EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION
, pattern EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION
, EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME
, pattern EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
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 Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Text.Read.Lex (Lexeme(Ident))
import Data.Kind (Type)
import Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.CStruct (FromCStruct)
import Graphics.Vulkan.CStruct (FromCStruct(..))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType)
import Graphics.Vulkan.CStruct (ToCStruct)
import Graphics.Vulkan.CStruct (ToCStruct(..))
import Graphics.Vulkan.Zero (Zero)
import Graphics.Vulkan.Zero (Zero(..))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT))
data PipelineCreationFeedbackEXT = PipelineCreationFeedbackEXT
{
flags :: PipelineCreationFeedbackFlagsEXT
,
duration :: Word64
}
deriving (Typeable)
deriving instance Show PipelineCreationFeedbackEXT
instance ToCStruct PipelineCreationFeedbackEXT where
withCStruct x f = allocaBytesAligned 16 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PipelineCreationFeedbackEXT{..} f = do
poke ((p `plusPtr` 0 :: Ptr PipelineCreationFeedbackFlagsEXT)) (flags)
poke ((p `plusPtr` 8 :: Ptr Word64)) (duration)
f
cStructSize = 16
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr PipelineCreationFeedbackFlagsEXT)) (zero)
poke ((p `plusPtr` 8 :: Ptr Word64)) (zero)
f
instance FromCStruct PipelineCreationFeedbackEXT where
peekCStruct p = do
flags <- peek @PipelineCreationFeedbackFlagsEXT ((p `plusPtr` 0 :: Ptr PipelineCreationFeedbackFlagsEXT))
duration <- peek @Word64 ((p `plusPtr` 8 :: Ptr Word64))
pure $ PipelineCreationFeedbackEXT
flags duration
instance Storable PipelineCreationFeedbackEXT where
sizeOf ~_ = 16
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PipelineCreationFeedbackEXT where
zero = PipelineCreationFeedbackEXT
zero
zero
data PipelineCreationFeedbackCreateInfoEXT = PipelineCreationFeedbackCreateInfoEXT
{
pipelineCreationFeedback :: Ptr PipelineCreationFeedbackEXT
,
pipelineStageCreationFeedbackCount :: Word32
,
pipelineStageCreationFeedbacks :: Ptr PipelineCreationFeedbackEXT
}
deriving (Typeable)
deriving instance Show PipelineCreationFeedbackCreateInfoEXT
instance ToCStruct PipelineCreationFeedbackCreateInfoEXT where
withCStruct x f = allocaBytesAligned 40 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PipelineCreationFeedbackCreateInfoEXT{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr (Ptr PipelineCreationFeedbackEXT))) (pipelineCreationFeedback)
poke ((p `plusPtr` 24 :: Ptr Word32)) (pipelineStageCreationFeedbackCount)
poke ((p `plusPtr` 32 :: Ptr (Ptr PipelineCreationFeedbackEXT))) (pipelineStageCreationFeedbacks)
f
cStructSize = 40
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr (Ptr PipelineCreationFeedbackEXT))) (zero)
poke ((p `plusPtr` 24 :: Ptr Word32)) (zero)
poke ((p `plusPtr` 32 :: Ptr (Ptr PipelineCreationFeedbackEXT))) (zero)
f
instance FromCStruct PipelineCreationFeedbackCreateInfoEXT where
peekCStruct p = do
pPipelineCreationFeedback <- peek @(Ptr PipelineCreationFeedbackEXT) ((p `plusPtr` 16 :: Ptr (Ptr PipelineCreationFeedbackEXT)))
pipelineStageCreationFeedbackCount <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
pPipelineStageCreationFeedbacks <- peek @(Ptr PipelineCreationFeedbackEXT) ((p `plusPtr` 32 :: Ptr (Ptr PipelineCreationFeedbackEXT)))
pure $ PipelineCreationFeedbackCreateInfoEXT
pPipelineCreationFeedback pipelineStageCreationFeedbackCount pPipelineStageCreationFeedbacks
instance Storable PipelineCreationFeedbackCreateInfoEXT where
sizeOf ~_ = 40
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PipelineCreationFeedbackCreateInfoEXT where
zero = PipelineCreationFeedbackCreateInfoEXT
zero
zero
zero
newtype PipelineCreationFeedbackFlagBitsEXT = PipelineCreationFeedbackFlagBitsEXT Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = PipelineCreationFeedbackFlagBitsEXT 0x00000001
pattern PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = PipelineCreationFeedbackFlagBitsEXT 0x00000002
pattern PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = PipelineCreationFeedbackFlagBitsEXT 0x00000004
type PipelineCreationFeedbackFlagsEXT = PipelineCreationFeedbackFlagBitsEXT
instance Show PipelineCreationFeedbackFlagBitsEXT where
showsPrec p = \case
PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT -> showString "PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT"
PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT -> showString "PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT"
PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT -> showString "PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT"
PipelineCreationFeedbackFlagBitsEXT x -> showParen (p >= 11) (showString "PipelineCreationFeedbackFlagBitsEXT 0x" . showHex x)
instance Read PipelineCreationFeedbackFlagBitsEXT where
readPrec = parens (choose [("PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT", pure PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT)
, ("PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT", pure PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT)
, ("PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT", pure PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT)]
+++
prec 10 (do
expectP (Ident "PipelineCreationFeedbackFlagBitsEXT")
v <- step readPrec
pure (PipelineCreationFeedbackFlagBitsEXT v)))
type EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION = 1
pattern EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION :: forall a . Integral a => a
pattern EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION = 1
type EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME = "VK_EXT_pipeline_creation_feedback"
pattern EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME = "VK_EXT_pipeline_creation_feedback"