{-# 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
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
--     -   Requires @VK_KHR_get_physical_device_properties2@ to be enabled
--         for any device-level functionality
--
-- [__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 = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
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)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
vkGetPipelinePropertiesEXTPtr FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
      -> ("pipelineProperties" ::: Ptr BaseOutStructure)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
   -> ("pipelineProperties" ::: Ptr BaseOutStructure)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPipelinePropertiesEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pPipelineInfo" ::: Ptr PipelineInfoEXT) -> IO ()) -> IO ())
-> ContT () IO ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPipelineInfo" ::: Ptr PipelineInfoEXT) -> IO ()) -> IO ())
 -> ContT () IO ("pPipelineInfo" ::: Ptr PipelineInfoEXT))
-> ((("pPipelineInfo" ::: Ptr PipelineInfoEXT) -> IO ()) -> IO ())
-> ContT () IO ("pPipelineInfo" ::: Ptr PipelineInfoEXT)
forall a b. (a -> b) -> a -> b
$ PipelineInfoEXT
-> (("pPipelineInfo" ::: Ptr PipelineInfoEXT) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineInfoEXT
pipelineInfo)
  Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
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))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
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 -> (Void# -> r) -> (Void# -> 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 = Int -> (Ptr PipelinePropertiesIdentifierEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelinePropertiesIdentifierEXT -> IO b) -> IO b)
-> (Ptr PipelinePropertiesIdentifierEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelinePropertiesIdentifierEXT
p -> Ptr PipelinePropertiesIdentifierEXT
-> PipelinePropertiesIdentifierEXT -> IO b -> IO b
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
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
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
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
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 <- Ptr (FixedArray UUID_SIZE Word8) -> IO ByteString
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> IO ByteString
peekByteStringFromSizedVectorPtr ((Ptr PipelinePropertiesIdentifierEXT
p Ptr PipelinePropertiesIdentifierEXT
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray UUID_SIZE Word8)))
    PipelinePropertiesIdentifierEXT
-> IO PipelinePropertiesIdentifierEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelinePropertiesIdentifierEXT
 -> IO PipelinePropertiesIdentifierEXT)
-> PipelinePropertiesIdentifierEXT
-> IO PipelinePropertiesIdentifierEXT
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 = Ptr PipelinePropertiesIdentifierEXT
-> IO PipelinePropertiesIdentifierEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PipelinePropertiesIdentifierEXT
-> PipelinePropertiesIdentifierEXT -> IO ()
poke Ptr PipelinePropertiesIdentifierEXT
ptr PipelinePropertiesIdentifierEXT
poked = Ptr PipelinePropertiesIdentifierEXT
-> PipelinePropertiesIdentifierEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelinePropertiesIdentifierEXT
ptr PipelinePropertiesIdentifierEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PipelinePropertiesIdentifierEXT where
  zero :: PipelinePropertiesIdentifierEXT
zero = ByteString -> PipelinePropertiesIdentifierEXT
PipelinePropertiesIdentifierEXT
           ByteString
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
(PhysicalDevicePipelinePropertiesFeaturesEXT
 -> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool)
-> (PhysicalDevicePipelinePropertiesFeaturesEXT
    -> PhysicalDevicePipelinePropertiesFeaturesEXT -> Bool)
-> Eq PhysicalDevicePipelinePropertiesFeaturesEXT
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 = Int
-> (Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p -> Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> IO b -> IO b
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
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr Bool32
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
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
p Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
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 Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    PhysicalDevicePipelinePropertiesFeaturesEXT
-> IO PhysicalDevicePipelinePropertiesFeaturesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDevicePipelinePropertiesFeaturesEXT
 -> IO PhysicalDevicePipelinePropertiesFeaturesEXT)
-> PhysicalDevicePipelinePropertiesFeaturesEXT
-> IO PhysicalDevicePipelinePropertiesFeaturesEXT
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 = Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> IO PhysicalDevicePipelinePropertiesFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> IO ()
poke Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
ptr PhysicalDevicePipelinePropertiesFeaturesEXT
poked = Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
-> PhysicalDevicePipelinePropertiesFeaturesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelinePropertiesFeaturesEXT
ptr PhysicalDevicePipelinePropertiesFeaturesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDevicePipelinePropertiesFeaturesEXT where
  zero :: PhysicalDevicePipelinePropertiesFeaturesEXT
zero = Bool -> PhysicalDevicePipelinePropertiesFeaturesEXT
PhysicalDevicePipelinePropertiesFeaturesEXT
           Bool
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 -> (Void# -> r) -> (Void# -> 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 -> (Void# -> r) -> (Void# -> r) -> r
EXT_PIPELINE_PROPERTIES_EXTENSION_NAME = "VK_EXT_pipeline_properties"