{-# language CPP #-}
-- | = Name
--
-- VK_EXT_pipeline_properties - device extension
--
-- == VK_EXT_pipeline_properties
--
-- [__Name String__]
--     @VK_EXT_pipeline_properties@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     373
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--
-- [__Contact__]
--
--     -   Mukund Keshava
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_pipeline_properties] @mkeshavanv%0A*Here describe the issue or question you have about the VK_EXT_pipeline_properties extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-04-19
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Mukund Keshava, NVIDIA
--
--     -   Daniel Koch, NVIDIA
--
--     -   Mark Bellamy, Arm
--
-- == Description
--
-- Vulkan SC requires offline compilation of pipelines. In order to support
-- this, the pipeline state is represented in a
-- <https://github.com/KhronosGroup/VulkanSC-Docs/wiki/JSON-schema JSON schema>
-- that is read by an offline tool for compilation.
--
-- One method of developing a Vulkan SC application is to author a Vulkan
-- application and use a layer to record and serialize the pipeline state
-- and shaders for offline compilation. Each pipeline is represented by a
-- separate JSON file, and can be identified with a @pipelineIdentifier@.
--
-- Once the pipelines have been compiled by the offline pipeline cache
-- compiler, the Vulkan SC application can then use this
-- @pipelineIdentifier@ for identifying the pipeline via Vulkan SC’s
-- @VkPipelineIdentifierInfo@ structure.
--
-- This extension allows the Vulkan application to query the
-- @pipelineIdentifier@ associated with each pipeline so that the
-- application can store this with its pipeline metadata and the Vulkan SC
-- application will then use to map the same state to an entry in the
-- Vulkan SC pipeline cache.
--
-- It is expected that this extension will initially be implemented in the
-- json generation layer, although we can envision that there might be
-- future uses for it in native Vulkan drivers as well.
--
-- == New Commands
--
-- -   'getPipelinePropertiesEXT'
--
-- == New Structures
--
-- -   'PipelineInfoEXT'
--
-- -   'PipelinePropertiesIdentifierEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDevicePipelinePropertiesFeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_PIPELINE_PROPERTIES_EXTENSION_NAME'
--
-- -   'EXT_PIPELINE_PROPERTIES_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT'
--
--     -   'STRUCTURE_TYPE_PIPELINE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT'
--
-- == Issues
--
-- (1) This extension does not make sense on a strict Vulkan SC
-- implementation. It may however be of potential use in a non-strict
-- Vulkan SC implementation. Should this extension be enabled as part of
-- Vulkan SC as well?
--
-- __RESOLVED__: No. This extension will not be enabled for Vulkan SC.
--
-- (2) This is intended to be a general pipeline properties query, but is
-- currently only retrieving the pipeline identifier. Should the pipeline
-- identifier query be mandatory for this extension and for all queries
-- using this entry point?
--
-- __RESOLVED__: Use 'Vulkan.CStruct.Extends.BaseOutStructure' for the
-- return parameter. Currently this is required to actually be a
-- 'PipelinePropertiesIdentifierEXT' structure, but that could be relaxed
-- in the future to allow other structure types or to allow other
-- structures to be chained in along with this one.
--
-- (3) Should there be a feature structure? Should it be required?
--
-- __RESOLVED__: Add a feature structure, and a feature for querying
-- pipeline identifier, but allow it to be optional so that this extension
-- can be used as the basis for other pipeline property queries without
-- requiring the pipeline identifier to be supported.
--
-- == Version History
--
-- -   Revision 1, 2022-04-19 (Mukund Keshava, Daniel Koch)
--
--     -   Initial draft
--
-- == See Also
--
-- 'PhysicalDevicePipelinePropertiesFeaturesEXT', 'PipelineInfoEXT',
-- 'PipelinePropertiesIdentifierEXT', 'getPipelinePropertiesEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_pipeline_properties Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_pipeline_properties  ( getPipelinePropertiesEXT
                                                     , pattern STRUCTURE_TYPE_PIPELINE_INFO_EXT
                                                     , PipelinePropertiesIdentifierEXT(..)
                                                     , PhysicalDevicePipelinePropertiesFeaturesEXT(..)
                                                     , PipelineInfoEXT
                                                     , EXT_PIPELINE_PROPERTIES_SPEC_VERSION
                                                     , pattern EXT_PIPELINE_PROPERTIES_SPEC_VERSION
                                                     , EXT_PIPELINE_PROPERTIES_EXTENSION_NAME
                                                     , pattern EXT_PIPELINE_PROPERTIES_EXTENSION_NAME
                                                     , PipelineInfoKHR(..)
                                                     ) where

import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
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 (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word8)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (peekByteStringFromSizedVectorPtr)
import Vulkan.CStruct.Utils (pokeFixedLengthByteString)
import Vulkan.NamedType ((:::))
import Vulkan.CStruct.Extends (BaseOutStructure)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetPipelinePropertiesEXT))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Extensions.VK_KHR_pipeline_executable_properties (PipelineInfoKHR)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.APIConstants (UUID_SIZE)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_KHR_pipeline_executable_properties (PipelineInfoKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPipelinePropertiesEXT
  :: FunPtr (Ptr Device_T -> Ptr PipelineInfoEXT -> Ptr BaseOutStructure -> IO Result) -> Ptr Device_T -> Ptr PipelineInfoEXT -> Ptr BaseOutStructure -> IO Result

-- | vkGetPipelinePropertiesEXT - Query pipeline properties
--
-- = Description
--
-- To query a pipeline’s @pipelineIdentifier@ pass a
-- 'PipelinePropertiesIdentifierEXT' structure in @pPipelineProperties@.
-- Each pipeline is associated with a @pipelineIdentifier@ and the
-- identifier is implementation specific.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPipelinePropertiesEXT-pipeline-06738# The @pipeline@
--     member of @pPipelineInfo@ must have been created with @device@
--
-- -   #VUID-vkGetPipelinePropertiesEXT-pPipelineProperties-06739#
--     @pPipelineProperties@ /must/ be a valid pointer to a
--     'PipelinePropertiesIdentifierEXT' structure
--
-- -   #VUID-vkGetPipelinePropertiesEXT-None-06766# The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-pipelinePropertiesIdentifier pipelinePropertiesIdentifier>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPipelinePropertiesEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetPipelinePropertiesEXT-pPipelineInfo-parameter#
--     @pPipelineInfo@ /must/ be a valid pointer to a valid
--     'PipelineInfoEXT' structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_pipeline_properties VK_EXT_pipeline_properties>,
-- 'Vulkan.CStruct.Extends.BaseOutStructure',
-- 'Vulkan.Core10.Handles.Device', 'PipelineInfoEXT'
getPipelinePropertiesEXT :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device that created the pipeline.
                            Device
                         -> -- | @pPipelineInfo@ is a pointer to a 'PipelineInfoEXT' structure which
                            -- describes the pipeline being queried.
                            PipelineInfoEXT
                         -> -- | @pPipelineProperties@ is a pointer to a
                            -- 'Vulkan.CStruct.Extends.BaseOutStructure' structure in which the
                            -- pipeline properties will be written.
                            ("pipelineProperties" ::: Ptr BaseOutStructure)
                         -> io ()
getPipelinePropertiesEXT :: forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineInfoEXT
-> ("pipelineProperties" ::: Ptr BaseOutStructure)
-> io ()
getPipelinePropertiesEXT Device
device
                           PipelineInfoEXT
pipelineInfo
                           "pipelineProperties" ::: Ptr BaseOutStructure
pipelineProperties = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetPipelinePropertiesEXTPtr :: FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
vkGetPipelinePropertiesEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
      -> ("pipelineProperties" ::: Ptr BaseOutStructure)
      -> IO Result)
pVkGetPipelinePropertiesEXT (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
vkGetPipelinePropertiesEXTPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) 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
"The function pointer for vkGetPipelinePropertiesEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetPipelinePropertiesEXT' :: Ptr Device_T
-> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
-> ("pipelineProperties" ::: Ptr BaseOutStructure)
-> IO Result
vkGetPipelinePropertiesEXT' = FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
-> Ptr Device_T
-> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
-> ("pipelineProperties" ::: Ptr BaseOutStructure)
-> IO Result
mkVkGetPipelinePropertiesEXT FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
vkGetPipelinePropertiesEXTPtr
  "pPipelineInfo" ::: Ptr PipelineInfoEXT
pPipelineInfo <- 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 => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineInfoEXT
pipelineInfo)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPipelinePropertiesEXT" (Ptr Device_T
-> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
-> ("pipelineProperties" ::: Ptr BaseOutStructure)
-> IO Result
vkGetPipelinePropertiesEXT'
                                                               (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                               "pPipelineInfo" ::: Ptr PipelineInfoEXT
pPipelineInfo
                                                               ("pipelineProperties" ::: Ptr BaseOutStructure
pipelineProperties))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


-- No documentation found for TopLevel "VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT"
pattern $bSTRUCTURE_TYPE_PIPELINE_INFO_EXT :: StructureType
$mSTRUCTURE_TYPE_PIPELINE_INFO_EXT :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
STRUCTURE_TYPE_PIPELINE_INFO_EXT = STRUCTURE_TYPE_PIPELINE_INFO_KHR


-- | VkPipelinePropertiesIdentifierEXT - Structure used to retrieve pipeline
-- properties
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_pipeline_properties VK_EXT_pipeline_properties>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelinePropertiesIdentifierEXT = PipelinePropertiesIdentifierEXT
  { -- | @pipelineIdentifier@ is an array of
    -- 'Vulkan.Core10.APIConstants.UUID_SIZE' @uint8_t@ values into which the
    -- pipeline identifier will be written.
    PipelinePropertiesIdentifierEXT -> ByteString
pipelineIdentifier :: ByteString }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelinePropertiesIdentifierEXT)
#endif
deriving instance Show PipelinePropertiesIdentifierEXT

instance ToCStruct PipelinePropertiesIdentifierEXT where
  withCStruct :: forall b.
PipelinePropertiesIdentifierEXT
-> (Ptr PipelinePropertiesIdentifierEXT -> IO b) -> IO b
withCStruct PipelinePropertiesIdentifierEXT
x Ptr PipelinePropertiesIdentifierEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelinePropertiesIdentifierEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelinePropertiesIdentifierEXT
p PipelinePropertiesIdentifierEXT
x (Ptr PipelinePropertiesIdentifierEXT -> IO b
f Ptr PipelinePropertiesIdentifierEXT
p)
  pokeCStruct :: forall b.
Ptr PipelinePropertiesIdentifierEXT
-> PipelinePropertiesIdentifierEXT -> IO b -> IO b
pokeCStruct Ptr PipelinePropertiesIdentifierEXT
p PipelinePropertiesIdentifierEXT{ByteString
pipelineIdentifier :: ByteString
$sel:pipelineIdentifier:PipelinePropertiesIdentifierEXT :: PipelinePropertiesIdentifierEXT -> ByteString
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
pipelineIdentifier)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelinePropertiesIdentifierEXT -> IO b -> IO b
pokeZeroCStruct Ptr PipelinePropertiesIdentifierEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray UUID_SIZE Word8))) (forall a. Monoid a => a
mempty)
    IO b
f

instance FromCStruct PipelinePropertiesIdentifierEXT where
  peekCStruct :: Ptr PipelinePropertiesIdentifierEXT
-> IO PipelinePropertiesIdentifierEXT
peekCStruct Ptr PipelinePropertiesIdentifierEXT
p = do
    ByteString
pipelineIdentifier <- forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> IO ByteString
peekByteStringFromSizedVectorPtr ((Ptr PipelinePropertiesIdentifierEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray UUID_SIZE Word8)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ByteString -> PipelinePropertiesIdentifierEXT
PipelinePropertiesIdentifierEXT
             ByteString
pipelineIdentifier

instance Storable PipelinePropertiesIdentifierEXT where
  sizeOf :: PipelinePropertiesIdentifierEXT -> Int
sizeOf ~PipelinePropertiesIdentifierEXT
_ = Int
32
  alignment :: PipelinePropertiesIdentifierEXT -> Int
alignment ~PipelinePropertiesIdentifierEXT
_ = Int
8
  peek :: Ptr PipelinePropertiesIdentifierEXT
-> IO PipelinePropertiesIdentifierEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PipelinePropertiesIdentifierEXT
-> PipelinePropertiesIdentifierEXT -> IO ()
poke Ptr PipelinePropertiesIdentifierEXT
ptr PipelinePropertiesIdentifierEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelinePropertiesIdentifierEXT
ptr PipelinePropertiesIdentifierEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PipelinePropertiesIdentifierEXT where
  zero :: PipelinePropertiesIdentifierEXT
zero = ByteString -> PipelinePropertiesIdentifierEXT
PipelinePropertiesIdentifierEXT
           forall a. Monoid a => a
mempty


-- | VkPhysicalDevicePipelinePropertiesFeaturesEXT - Structure describing
-- what pipeline properties are supported
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDevicePipelinePropertiesFeaturesEXT' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDevicePipelinePropertiesFeaturesEXT' /can/ also be
-- used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_pipeline_properties VK_EXT_pipeline_properties>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePipelinePropertiesFeaturesEXT = PhysicalDevicePipelinePropertiesFeaturesEXT
  { -- | #features-pipelinePropertiesIdentifier# @pipelinePropertiesIdentifier@
    -- indicates that the implementation supports querying a unique pipeline
    -- identifier.
    PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
pipelinePropertiesIdentifier :: Bool }
  deriving (Typeable, PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
$c/= :: PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
== :: PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
$c== :: PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePipelinePropertiesFeaturesEXT)
#endif
deriving instance Show PhysicalDevicePipelinePropertiesFeaturesEXT

instance ToCStruct PhysicalDevicePipelinePropertiesFeaturesEXT where
  withCStruct :: forall b.
PhysicalDevicePipelinePropertiesFeaturesEXT
-> (Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDevicePipelinePropertiesFeaturesEXT
x Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p PhysicalDevicePipelinePropertiesFeaturesEXT
x (Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b
f Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p PhysicalDevicePipelinePropertiesFeaturesEXT{Bool
pipelinePropertiesIdentifier :: Bool
$sel:pipelinePropertiesIdentifier:PhysicalDevicePipelinePropertiesFeaturesEXT :: PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
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 PhysicalDevicePipelinePropertiesFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelinePropertiesIdentifier))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
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 PhysicalDevicePipelinePropertiesFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDevicePipelinePropertiesFeaturesEXT where
  peekCStruct :: Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> IO PhysicalDevicePipelinePropertiesFeaturesEXT
peekCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p = do
    Bool32
pipelinePropertiesIdentifier <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDevicePipelinePropertiesFeaturesEXT
PhysicalDevicePipelinePropertiesFeaturesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
pipelinePropertiesIdentifier)

instance Storable PhysicalDevicePipelinePropertiesFeaturesEXT where
  sizeOf :: PhysicalDevicePipelinePropertiesFeaturesEXT -> Int
sizeOf ~PhysicalDevicePipelinePropertiesFeaturesEXT
_ = Int
24
  alignment :: PhysicalDevicePipelinePropertiesFeaturesEXT -> Int
alignment ~PhysicalDevicePipelinePropertiesFeaturesEXT
_ = Int
8
  peek :: Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> IO PhysicalDevicePipelinePropertiesFeaturesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> IO ()
poke Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
ptr PhysicalDevicePipelinePropertiesFeaturesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
ptr PhysicalDevicePipelinePropertiesFeaturesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDevicePipelinePropertiesFeaturesEXT where
  zero :: PhysicalDevicePipelinePropertiesFeaturesEXT
zero = Bool -> PhysicalDevicePipelinePropertiesFeaturesEXT
PhysicalDevicePipelinePropertiesFeaturesEXT
           forall a. Zero a => a
zero


-- No documentation found for TopLevel "VkPipelineInfoEXT"
type PipelineInfoEXT = PipelineInfoKHR


type EXT_PIPELINE_PROPERTIES_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_PIPELINE_PROPERTIES_SPEC_VERSION"
pattern EXT_PIPELINE_PROPERTIES_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_PIPELINE_PROPERTIES_SPEC_VERSION :: forall a. Integral a => a
$mEXT_PIPELINE_PROPERTIES_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_PIPELINE_PROPERTIES_SPEC_VERSION = 1


type EXT_PIPELINE_PROPERTIES_EXTENSION_NAME = "VK_EXT_pipeline_properties"

-- No documentation found for TopLevel "VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME"
pattern EXT_PIPELINE_PROPERTIES_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_PIPELINE_PROPERTIES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_PIPELINE_PROPERTIES_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_PIPELINE_PROPERTIES_EXTENSION_NAME = "VK_EXT_pipeline_properties"