{-# language CPP #-}
-- | = Name
--
-- VK_KHR_pipeline_binary - device extension
--
-- = VK_KHR_pipeline_binary
--
-- [__Name String__]
--     @VK_KHR_pipeline_binary@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     484
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.4 Vulkan Version 1.4>
--
-- [__Contact__]
--
--     -   Stu Smith
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_pipeline_binary] @stu-s%0A*Here describe the issue or question you have about the VK_KHR_pipeline_binary extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_pipeline_binary.adoc VK_KHR_pipeline_binary>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2024-07-01
--
-- [__Contributors__]
--
--     -   Stu Smith, AMD
--
--     -   Tobias Hector, AMD
--
--     -   Alan Harrison, AMD
--
--     -   Maciej Jesionowski, AMD
--
--     -   Younggwan Kim, Arm
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Ting Wei, Arm
--
--     -   Chris Glover, Google
--
--     -   Shahbaz Youssefi, Google
--
--     -   Jakub Kuderski, Google
--
--     -   Piotr Byszewski, Mobica
--
--     -   Piers Daniell, NVIDIA
--
--     -   Ralph Potter, Samsung
--
--     -   Matthew Netsch, Qualcomm
--
--     -   Hans-Kristian Arntzen, Valve
--
--     -   Samuel Pitoiset, Valve
--
--     -   Tatsuyuki Ishi, Valve
--
-- == Description
--
-- This extension provides a method to obtain binary data associated with
-- individual pipelines such that applications can manage caching
-- themselves instead of using VkPipelineCache objects.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.PipelineBinaryKHR'
--
-- == New Commands
--
-- -   'createPipelineBinariesKHR'
--
-- -   'destroyPipelineBinaryKHR'
--
-- -   'getPipelineBinaryDataKHR'
--
-- -   'getPipelineKeyKHR'
--
-- -   'releaseCapturedPipelineDataKHR'
--
-- == New Structures
--
-- -   'PipelineBinaryCreateInfoKHR'
--
-- -   'PipelineBinaryDataInfoKHR'
--
-- -   'PipelineBinaryDataKHR'
--
-- -   'PipelineBinaryHandlesInfoKHR'
--
-- -   'PipelineBinaryKeyKHR'
--
-- -   'PipelineBinaryKeysAndDataKHR'
--
-- -   'PipelineCreateInfoKHR'
--
-- -   'ReleaseCapturedPipelineDataInfoKHR'
--
-- -   Extending 'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'DevicePipelineBinaryInternalCacheControlKHR'
--
-- -   Extending
--     'Vulkan.Core10.GraphicsPipeline.GraphicsPipelineCreateInfo',
--     'Vulkan.Core10.ComputePipeline.ComputePipelineCreateInfo',
--     'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingPipelineCreateInfoKHR':
--
--     -   'PipelineBinaryInfoKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDevicePipelineBinaryFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDevicePipelineBinaryPropertiesKHR'
--
-- == New Enum Constants
--
-- -   'KHR_PIPELINE_BINARY_EXTENSION_NAME'
--
-- -   'KHR_PIPELINE_BINARY_SPEC_VERSION'
--
-- -   'Vulkan.Core10.APIConstants.MAX_PIPELINE_BINARY_KEY_SIZE_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_PIPELINE_BINARY_KHR'
--
-- -   Extending
--     'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlagBits2':
--
--     -   'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_NOT_ENOUGH_SPACE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.PIPELINE_BINARY_MISSING_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR'
--
-- == Version History
--
-- -   Revision 1, 2021-12-10 (Chris Glover)
--
--     -   Initial draft.
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_KHR_pipeline_binary Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_pipeline_binary  ( createPipelineBinariesKHR
                                                 , destroyPipelineBinaryKHR
                                                 , getPipelineKeyKHR
                                                 , getPipelineBinaryDataKHR
                                                 , releaseCapturedPipelineDataKHR
                                                 , PipelineBinaryCreateInfoKHR(..)
                                                 , PipelineBinaryHandlesInfoKHR(..)
                                                 , PipelineBinaryDataKHR(..)
                                                 , PipelineBinaryKeysAndDataKHR(..)
                                                 , PipelineBinaryKeyKHR(..)
                                                 , PipelineBinaryInfoKHR(..)
                                                 , ReleaseCapturedPipelineDataInfoKHR(..)
                                                 , PipelineBinaryDataInfoKHR(..)
                                                 , PipelineCreateInfoKHR(..)
                                                 , PhysicalDevicePipelineBinaryFeaturesKHR(..)
                                                 , DevicePipelineBinaryInternalCacheControlKHR(..)
                                                 , PhysicalDevicePipelineBinaryPropertiesKHR(..)
                                                 , KHR_PIPELINE_BINARY_SPEC_VERSION
                                                 , pattern KHR_PIPELINE_BINARY_SPEC_VERSION
                                                 , KHR_PIPELINE_BINARY_EXTENSION_NAME
                                                 , pattern KHR_PIPELINE_BINARY_EXTENSION_NAME
                                                 , PipelineBinaryKHR(..)
                                                 , MAX_PIPELINE_BINARY_KEY_SIZE_KHR
                                                 , pattern MAX_PIPELINE_BINARY_KEY_SIZE_KHR
                                                 ) where

import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import Foreign.Marshal.Utils (maybePeek)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.ByteString (packCStringLen)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Foreign.C.Types (CSize(..))
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.C.Types (CChar)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
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 (Word32)
import Data.Word (Word64)
import Data.Word (Word8)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
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.Core10.AllocationCallbacks (AllocationCallbacks)
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(pVkCreatePipelineBinariesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyPipelineBinaryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetPipelineBinaryDataKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetPipelineKeyKHR))
import Vulkan.Dynamic (DeviceCmds(pVkReleaseCapturedPipelineDataKHR))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.APIConstants (MAX_PIPELINE_BINARY_KEY_SIZE_KHR)
import Vulkan.Core10.Handles (Pipeline)
import Vulkan.Extensions.Handles (PipelineBinaryKHR)
import Vulkan.Extensions.Handles (PipelineBinaryKHR(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.APIConstants (MAX_PIPELINE_BINARY_KEY_SIZE_KHR)
import Vulkan.Extensions.Handles (PipelineBinaryKHR(..))
import Vulkan.Core10.APIConstants (pattern MAX_PIPELINE_BINARY_KEY_SIZE_KHR)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreatePipelineBinariesKHR
  :: FunPtr (Ptr Device_T -> Ptr PipelineBinaryCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr PipelineBinaryHandlesInfoKHR -> IO Result) -> Ptr Device_T -> Ptr PipelineBinaryCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr PipelineBinaryHandlesInfoKHR -> IO Result

-- | vkCreatePipelineBinariesKHR - Create pipeline binaries from a pipeline
-- or previously retrieved data
--
-- = Description
--
-- The implementation will attempt to create all pipeline binaries. If
-- creation fails for any pipeline binary, then:
--
-- -   The corresponding entry in the @pPipelineBinaries@ output array will
--     be filled with 'Vulkan.Core10.APIConstants.NULL_HANDLE'.
--
-- -   The 'Vulkan.Core10.Enums.Result.Result' returned by
--     'createPipelineBinariesKHR' will contain the error value for the
--     first entry in the output array in @pBinaries@ containing
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreatePipelineBinariesKHR-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreatePipelineBinariesKHR-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'PipelineBinaryCreateInfoKHR' structure
--
-- -   #VUID-vkCreatePipelineBinariesKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreatePipelineBinariesKHR-pBinaries-parameter# @pBinaries@
--     /must/ be a valid pointer to a 'PipelineBinaryHandlesInfoKHR'
--     structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
--     -   'Vulkan.Core10.Enums.Result.PIPELINE_BINARY_MISSING_KHR'
--
--     -   '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_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'PipelineBinaryCreateInfoKHR',
-- 'PipelineBinaryHandlesInfoKHR'
createPipelineBinariesKHR :: forall io
                           . (MonadIO io)
                          => -- | @device@ is the logical device that creates the pipeline binary objects.
                             Device
                          -> -- | @pCreateInfo@ is a pointer to a 'PipelineBinaryCreateInfoKHR' structure
                             -- that contains the data to create the pipeline binaries from.
                             PipelineBinaryCreateInfoKHR
                          -> -- | @pAllocator@ controls host memory allocation as described in the
                             -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                             -- chapter.
                             ("allocator" ::: Maybe AllocationCallbacks)
                          -> io (Result, ("binaries" ::: PipelineBinaryHandlesInfoKHR))
createPipelineBinariesKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineBinaryCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
createPipelineBinariesKHR Device
device PipelineBinaryCreateInfoKHR
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
-> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
 -> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> (ContT
      (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
      IO
      (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
    -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
-> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
  IO
  (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
-> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
   IO
   (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
 -> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
-> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkCreatePipelineBinariesKHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
vkCreatePipelineBinariesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineBinaryCreateInfoKHR
      -> Ptr AllocationCallbacks
      -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
      -> IO Result)
pVkCreatePipelineBinariesKHR (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO ()
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR) IO ()
forall (m :: * -> *) a.
Monad m =>
m a
-> ContT (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR) IO ())
-> IO ()
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
vkCreatePipelineBinariesKHRPtr FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineBinaryCreateInfoKHR
      -> Ptr AllocationCallbacks
      -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 vkCreatePipelineBinariesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreatePipelineBinariesKHR' :: Ptr Device_T
-> Ptr PipelineBinaryCreateInfoKHR
-> Ptr AllocationCallbacks
-> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> IO Result
vkCreatePipelineBinariesKHR' = FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
-> Ptr Device_T
-> Ptr PipelineBinaryCreateInfoKHR
-> Ptr AllocationCallbacks
-> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> IO Result
mkVkCreatePipelineBinariesKHR FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryCreateInfoKHR
   -> Ptr AllocationCallbacks
   -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
   -> IO Result)
vkCreatePipelineBinariesKHRPtr
  pCreateInfo <- ((Ptr PipelineBinaryCreateInfoKHR
  -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
 -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Ptr PipelineBinaryCreateInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineBinaryCreateInfoKHR
   -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
  -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
 -> ContT
      (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
      IO
      (Ptr PipelineBinaryCreateInfoKHR))
-> ((Ptr PipelineBinaryCreateInfoKHR
     -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
    -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Ptr PipelineBinaryCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ PipelineBinaryCreateInfoKHR
-> (Ptr PipelineBinaryCreateInfoKHR
    -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PipelineBinaryCreateInfoKHR
-> (Ptr PipelineBinaryCreateInfoKHR -> IO b) -> IO b
withCStruct (PipelineBinaryCreateInfoKHR
createInfo)
  pAllocator <- case (allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Ptr AllocationCallbacks)
forall a.
a
-> ContT (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR) IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks
  -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
 -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks
   -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
  -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
 -> ContT
      (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
      IO
      (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks
     -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
    -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> ContT
     (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
     IO
     (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks
    -> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR))
-> IO (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  pPBinaries <- ContT (withZeroCStruct @PipelineBinaryHandlesInfoKHR)
  r <- lift $ traceAroundEvent "vkCreatePipelineBinariesKHR" (vkCreatePipelineBinariesKHR'
                                                                (deviceHandle (device))
                                                                pCreateInfo
                                                                pAllocator
                                                                (pPBinaries))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pBinaries <- lift $ peekCStruct @PipelineBinaryHandlesInfoKHR pPBinaries
  pure $ (r, pBinaries)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyPipelineBinaryKHR
  :: FunPtr (Ptr Device_T -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyPipelineBinaryKHR - Destroy a pipeline binary
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-pipelineBinary-09614# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @pipelineBinary@ was created, a compatible set of
--     callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-pipelineBinary-09615# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @pipelineBinary@ was created, @pAllocator@ /must/ be
--     @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-pipelineBinary-parameter# If
--     @pipelineBinary@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @pipelineBinary@ /must/ be a valid
--     'Vulkan.Extensions.Handles.PipelineBinaryKHR' handle
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyPipelineBinaryKHR-pipelineBinary-parent# If
--     @pipelineBinary@ is a valid handle, it /must/ have been created,
--     allocated, or retrieved from @device@
--
-- == Host Synchronization
--
-- -   Host access to @pipelineBinary@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.PipelineBinaryKHR'
destroyPipelineBinaryKHR :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device that created the pipeline binary object.
                            Device
                         -> -- | @pipelineBinary@ is the handle of the pipeline binary object to destroy.
                            PipelineBinaryKHR
                         -> -- | @pAllocator@ controls host memory allocation as described in the
                            -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                            -- chapter.
                            ("allocator" ::: Maybe AllocationCallbacks)
                         -> io ()
destroyPipelineBinaryKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineBinaryKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyPipelineBinaryKHR Device
device
                           PipelineBinaryKHR
pipelineBinary
                           "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
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 vkDestroyPipelineBinaryKHRPtr :: FunPtr
  (Ptr Device_T
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroyPipelineBinaryKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
pVkDestroyPipelineBinaryKHR (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
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
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroyPipelineBinaryKHRPtr FunPtr
  (Ptr Device_T
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
     (Ptr Device_T
      -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 vkDestroyPipelineBinaryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyPipelineBinaryKHR' :: Ptr Device_T
-> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ()
vkDestroyPipelineBinaryKHR' = FunPtr
  (Ptr Device_T
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T
-> PipelineBinaryKHR
-> Ptr AllocationCallbacks
-> IO ()
mkVkDestroyPipelineBinaryKHR FunPtr
  (Ptr Device_T
   -> PipelineBinaryKHR -> Ptr AllocationCallbacks -> IO ())
vkDestroyPipelineBinaryKHRPtr
  pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
 -> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  lift $ traceAroundEvent "vkDestroyPipelineBinaryKHR" (vkDestroyPipelineBinaryKHR'
                                                          (deviceHandle (device))
                                                          (pipelineBinary)
                                                          pAllocator)
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPipelineKeyKHR
  :: FunPtr (Ptr Device_T -> Ptr PipelineCreateInfoKHR -> Ptr PipelineBinaryKeyKHR -> IO Result) -> Ptr Device_T -> Ptr PipelineCreateInfoKHR -> Ptr PipelineBinaryKeyKHR -> IO Result

-- | vkGetPipelineKeyKHR - Generate the pipeline key from pipeline creation
-- info
--
-- = Description
--
-- If @pPipelineCreateInfo@ is @NULL@, then the implementation /must/
-- return the global key that applies to all pipelines. If the key obtained
-- in this way changes between saving and restoring data obtained from
-- 'getPipelineBinaryDataKHR' in a different
-- 'Vulkan.Core10.Handles.Device', then the application /must/ assume that
-- the restored data is invalid and cannot be passed to
-- 'createPipelineBinariesKHR'. Otherwise the application /can/ assume the
-- data is still valid.
--
-- If @pPipelineCreateInfo@ is not @NULL@, the key obtained functions as a
-- method to compare two pipeline creation info structures. Implementations
-- /may/ not compare parts of a pipeline creation info which would not
-- contribute to the final binary output. If a shader module identifier is
-- used instead of a shader module, the @pPipelineKey@ generated /must/ be
-- equal to the key generated when using the shader module from which the
-- identifier was queried. If the content of two @pPipelineKey@ are equal,
-- pipelines created with the two @pPipelineCreateInfo->pNext@ create infos
-- /must/ produce the same 'Vulkan.Extensions.Handles.PipelineBinaryKHR'
-- contents.
--
-- The pipeline key is distinct from pipeline binary key. Pipeline binary
-- keys /can/ only be obtained after compilation. The pipeline key is
-- intended to optionally allow associating pipeline create info with
-- multiple pipeline binary keys.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPipelineKeyKHR-pNext-09605# The @pNext@ chain of
--     @pPipelineCreateInfo@ /must/ not set
--     'PipelineBinaryInfoKHR'::@binaryCount@ to a value greater than @0@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPipelineKeyKHR-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetPipelineKeyKHR-pPipelineCreateInfo-parameter# If
--     @pPipelineCreateInfo@ is not @NULL@, @pPipelineCreateInfo@ /must/ be
--     a valid pointer to a valid 'PipelineCreateInfoKHR' structure
--
-- -   #VUID-vkGetPipelineKeyKHR-pPipelineKey-parameter# @pPipelineKey@
--     /must/ be a valid pointer to a 'PipelineBinaryKeyKHR' 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_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.Handles.Device', 'PipelineBinaryKeyKHR',
-- 'PipelineCreateInfoKHR'
getPipelineKeyKHR :: forall io
                   . (MonadIO io)
                  => -- | @device@ is the logical device that creates the pipeline object.
                     Device
                  -> -- | @pPipelineCreateInfo@ is @NULL@ or a pointer to a
                     -- 'PipelineCreateInfoKHR' structure.
                     ("pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR)
                  -> io (("pipelineKey" ::: PipelineBinaryKeyKHR))
getPipelineKeyKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> ("pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR)
-> io ("pipelineKey" ::: PipelineBinaryKeyKHR)
getPipelineKeyKHR Device
device "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
pipelineCreateInfo = IO ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> io ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("pipelineKey" ::: PipelineBinaryKeyKHR)
 -> io ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> (ContT
      ("pipelineKey" ::: PipelineBinaryKeyKHR)
      IO
      ("pipelineKey" ::: PipelineBinaryKeyKHR)
    -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
     IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> io ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  ("pipelineKey" ::: PipelineBinaryKeyKHR)
  IO
  ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> IO ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   ("pipelineKey" ::: PipelineBinaryKeyKHR)
   IO
   ("pipelineKey" ::: PipelineBinaryKeyKHR)
 -> io ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
     IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> io ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPipelineKeyKHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
vkGetPipelineKeyKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineCreateInfoKHR
      -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
      -> IO Result)
pVkGetPipelineKeyKHR (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT ("pipelineKey" ::: PipelineBinaryKeyKHR) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("pipelineKey" ::: PipelineBinaryKeyKHR) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("pipelineKey" ::: PipelineBinaryKeyKHR) IO ())
-> IO () -> ContT ("pipelineKey" ::: PipelineBinaryKeyKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
vkGetPipelineKeyKHRPtr FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineCreateInfoKHR
      -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetPipelineKeyKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPipelineKeyKHR' :: Ptr Device_T
-> Ptr PipelineCreateInfoKHR
-> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> IO Result
vkGetPipelineKeyKHR' = FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
-> Ptr Device_T
-> Ptr PipelineCreateInfoKHR
-> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> IO Result
mkVkGetPipelineKeyKHR FunPtr
  (Ptr Device_T
   -> Ptr PipelineCreateInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> IO Result)
vkGetPipelineKeyKHRPtr
  pPipelineCreateInfo <- case ("pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
pipelineCreateInfo) of
    "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
Nothing -> Ptr PipelineCreateInfoKHR
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
     IO
     (Ptr PipelineCreateInfoKHR)
forall a. a -> ContT ("pipelineKey" ::: PipelineBinaryKeyKHR) IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineCreateInfoKHR
forall a. Ptr a
nullPtr
    Just PipelineCreateInfoKHR
j -> ((Ptr PipelineCreateInfoKHR
  -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
 -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
     IO
     (Ptr PipelineCreateInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineCreateInfoKHR
   -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
  -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
 -> ContT
      ("pipelineKey" ::: PipelineBinaryKeyKHR)
      IO
      (Ptr PipelineCreateInfoKHR))
-> ((Ptr PipelineCreateInfoKHR
     -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
    -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR)
     IO
     (Ptr PipelineCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ PipelineCreateInfoKHR
-> (Ptr PipelineCreateInfoKHR
    -> IO ("pipelineKey" ::: PipelineBinaryKeyKHR))
-> IO ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PipelineCreateInfoKHR
-> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
withCStruct (PipelineCreateInfoKHR
j)
  pPPipelineKey <- ContT (withZeroCStruct @PipelineBinaryKeyKHR)
  r <- lift $ traceAroundEvent "vkGetPipelineKeyKHR" (vkGetPipelineKeyKHR'
                                                        (deviceHandle (device))
                                                        pPipelineCreateInfo
                                                        (pPPipelineKey))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pPipelineKey <- lift $ peekCStruct @PipelineBinaryKeyKHR pPPipelineKey
  pure $ (pPipelineKey)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPipelineBinaryDataKHR
  :: FunPtr (Ptr Device_T -> Ptr PipelineBinaryDataInfoKHR -> Ptr PipelineBinaryKeyKHR -> Ptr CSize -> Ptr () -> IO Result) -> Ptr Device_T -> Ptr PipelineBinaryDataInfoKHR -> Ptr PipelineBinaryKeyKHR -> Ptr CSize -> Ptr () -> IO Result

-- | vkGetPipelineBinaryDataKHR - Get the data store from a pipeline binary
--
-- = Description
--
-- If @pPipelineBinaryData@ is @NULL@, then the size of the data, in bytes,
-- that is required to store the binary is returned in
-- @pPipelineBinaryDataSize@. Otherwise, @pPipelineBinaryDataSize@ /must/
-- contain the size of the buffer, in bytes, pointed to by
-- @pPipelineBinaryData@, and on return @pPipelineBinaryDataSize@ is
-- overwritten with the size of the data, in bytes, that is required to
-- store the binary. If @pPipelineBinaryDataSize@ is less than the size
-- that is required to store the binary, nothing is written to
-- @pPipelineBinaryData@ and
-- 'Vulkan.Core10.Enums.Result.ERROR_NOT_ENOUGH_SPACE_KHR' will be
-- returned, instead of 'Vulkan.Core10.Enums.Result.SUCCESS'.
--
-- If the call returns one of the success return codes, the pipeline binary
-- key is written to @pPipelineBinaryKey@, regardless of whether
-- @pPipelineBinaryData@ is @NULL@ or not.
--
-- If
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-pipelineBinaryCompressedData pipelineBinaryCompressedData>
-- is 'Vulkan.Core10.FundamentalTypes.FALSE', implementations /should/ not
-- return compressed pipeline binary data to the application.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPipelineBinaryDataKHR-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetPipelineBinaryDataKHR-pInfo-parameter# @pInfo@ /must/ be
--     a valid pointer to a valid 'PipelineBinaryDataInfoKHR' structure
--
-- -   #VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryKey-parameter#
--     @pPipelineBinaryKey@ /must/ be a valid pointer to a
--     'PipelineBinaryKeyKHR' structure
--
-- -   #VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryDataSize-parameter#
--     @pPipelineBinaryDataSize@ /must/ be a valid pointer to a @size_t@
--     value
--
-- -   #VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryData-parameter# If
--     the value referenced by @pPipelineBinaryDataSize@ is not @0@, and
--     @pPipelineBinaryData@ is not @NULL@, @pPipelineBinaryData@ /must/ be
--     a valid pointer to an array of @pPipelineBinaryDataSize@ bytes
--
-- == 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_NOT_ENOUGH_SPACE_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.Handles.Device', 'PipelineBinaryDataInfoKHR',
-- 'PipelineBinaryKeyKHR'
getPipelineBinaryDataKHR :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device that created the pipeline binary.
                            Device
                         -> -- | @pInfo@ is a pointer to a 'PipelineBinaryDataInfoKHR' structure which
                            -- describes the pipeline binary to get data from.
                            PipelineBinaryDataInfoKHR
                         -> io (PipelineBinaryKeyKHR, ("pipelineBinaryData" ::: ByteString))
getPipelineBinaryDataKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineBinaryDataInfoKHR
-> io
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
getPipelineBinaryDataKHR Device
device PipelineBinaryDataInfoKHR
info = IO
  ("pipelineKey" ::: PipelineBinaryKeyKHR,
   "pipelineBinaryData" ::: ByteString)
-> io
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO
   ("pipelineKey" ::: PipelineBinaryKeyKHR,
    "pipelineBinaryData" ::: ByteString)
 -> io
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString))
-> (ContT
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString)
      IO
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString)
    -> IO
         ("pipelineKey" ::: PipelineBinaryKeyKHR,
          "pipelineBinaryData" ::: ByteString))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
-> io
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  ("pipelineKey" ::: PipelineBinaryKeyKHR,
   "pipelineBinaryData" ::: ByteString)
  IO
  ("pipelineKey" ::: PipelineBinaryKeyKHR,
   "pipelineBinaryData" ::: ByteString)
-> IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   ("pipelineKey" ::: PipelineBinaryKeyKHR,
    "pipelineBinaryData" ::: ByteString)
   IO
   ("pipelineKey" ::: PipelineBinaryKeyKHR,
    "pipelineBinaryData" ::: ByteString)
 -> io
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
-> io
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPipelineBinaryDataKHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
vkGetPipelineBinaryDataKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineBinaryDataInfoKHR
      -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
      -> Ptr CSize
      -> Ptr ()
      -> IO Result)
pVkGetPipelineBinaryDataKHR (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO ()
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     ()
forall (m :: * -> *) a.
Monad m =>
m a
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     m
     a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString)
      IO
      ())
-> IO ()
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
vkGetPipelineBinaryDataKHRPtr FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr PipelineBinaryDataInfoKHR
      -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
      -> Ptr CSize
      -> Ptr ()
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetPipelineBinaryDataKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPipelineBinaryDataKHR' :: Ptr Device_T
-> Ptr PipelineBinaryDataInfoKHR
-> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Ptr CSize
-> Ptr ()
-> IO Result
vkGetPipelineBinaryDataKHR' = FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
-> Ptr Device_T
-> Ptr PipelineBinaryDataInfoKHR
-> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Ptr CSize
-> Ptr ()
-> IO Result
mkVkGetPipelineBinaryDataKHR FunPtr
  (Ptr Device_T
   -> Ptr PipelineBinaryDataInfoKHR
   -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
   -> Ptr CSize
   -> Ptr ()
   -> IO Result)
vkGetPipelineBinaryDataKHRPtr
  let device' :: Ptr Device_T
device' = Device -> Ptr Device_T
deviceHandle (Device
device)
  pInfo <- ((Ptr PipelineBinaryDataInfoKHR
  -> IO
       ("pipelineKey" ::: PipelineBinaryKeyKHR,
        "pipelineBinaryData" ::: ByteString))
 -> IO
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     (Ptr PipelineBinaryDataInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineBinaryDataInfoKHR
   -> IO
        ("pipelineKey" ::: PipelineBinaryKeyKHR,
         "pipelineBinaryData" ::: ByteString))
  -> IO
       ("pipelineKey" ::: PipelineBinaryKeyKHR,
        "pipelineBinaryData" ::: ByteString))
 -> ContT
      ("pipelineKey" ::: PipelineBinaryKeyKHR,
       "pipelineBinaryData" ::: ByteString)
      IO
      (Ptr PipelineBinaryDataInfoKHR))
-> ((Ptr PipelineBinaryDataInfoKHR
     -> IO
          ("pipelineKey" ::: PipelineBinaryKeyKHR,
           "pipelineBinaryData" ::: ByteString))
    -> IO
         ("pipelineKey" ::: PipelineBinaryKeyKHR,
          "pipelineBinaryData" ::: ByteString))
-> ContT
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
     IO
     (Ptr PipelineBinaryDataInfoKHR)
forall a b. (a -> b) -> a -> b
$ PipelineBinaryDataInfoKHR
-> (Ptr PipelineBinaryDataInfoKHR
    -> IO
         ("pipelineKey" ::: PipelineBinaryKeyKHR,
          "pipelineBinaryData" ::: ByteString))
-> IO
     ("pipelineKey" ::: PipelineBinaryKeyKHR,
      "pipelineBinaryData" ::: ByteString)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PipelineBinaryDataInfoKHR
-> (Ptr PipelineBinaryDataInfoKHR -> IO b) -> IO b
withCStruct (PipelineBinaryDataInfoKHR
info)
  pPPipelineBinaryKey <- ContT (withZeroCStruct @PipelineBinaryKeyKHR)
  pPPipelineBinaryDataSize <- ContT $ bracket (callocBytes @CSize 8) free
  r <- lift $ traceAroundEvent "vkGetPipelineBinaryDataKHR" (vkGetPipelineBinaryDataKHR'
                                                               device'
                                                               pInfo
                                                               (pPPipelineBinaryKey)
                                                               (pPPipelineBinaryDataSize)
                                                               (nullPtr))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pPipelineBinaryDataSize <- lift $ peek @CSize pPPipelineBinaryDataSize
  pPPipelineBinaryData <- ContT $ bracket (callocBytes @(()) (fromIntegral ((coerce @CSize @Word64 pPipelineBinaryDataSize)))) free
  r' <- lift $ traceAroundEvent "vkGetPipelineBinaryDataKHR" (vkGetPipelineBinaryDataKHR'
                                                                device'
                                                                pInfo
                                                                (pPPipelineBinaryKey)
                                                                (pPPipelineBinaryDataSize)
                                                                (pPPipelineBinaryData))
  lift $ when (r' < SUCCESS) (throwIO (VulkanException r'))
  pPipelineBinaryKey <- lift $ peekCStruct @PipelineBinaryKeyKHR pPPipelineBinaryKey
  pPipelineBinaryDataSize'' <- lift $ peek @CSize pPPipelineBinaryDataSize
  pPipelineBinaryData' <- lift $ packCStringLen  ( castPtr @() @CChar pPPipelineBinaryData
                                                 , (fromIntegral ((coerce @CSize @Word64 pPipelineBinaryDataSize''))) )
  pure $ (pPipelineBinaryKey, pPipelineBinaryData')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkReleaseCapturedPipelineDataKHR
  :: FunPtr (Ptr Device_T -> Ptr ReleaseCapturedPipelineDataInfoKHR -> Ptr AllocationCallbacks -> IO Result) -> Ptr Device_T -> Ptr ReleaseCapturedPipelineDataInfoKHR -> Ptr AllocationCallbacks -> IO Result

-- | vkReleaseCapturedPipelineDataKHR - Release captured pipeline binary data
--
-- = Description
--
-- The implementation /may/ free any resources captured as a result of
-- creating the pipeline with
-- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
-- and put the pipeline into a state as if
-- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
-- had not been provided at pipeline creation time.
--
-- Any resources captured as a result of creating the pipeline with
-- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
-- are implicitly freed by 'Vulkan.Core10.ComputePipeline.destroyPipeline'.
--
-- == Valid Usage
--
-- -   #VUID-vkReleaseCapturedPipelineDataKHR-pipeline-09611# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @pipeline@ was created, a compatible set of callbacks
--     /must/ be provided in @pAllocator@
--
-- -   #VUID-vkReleaseCapturedPipelineDataKHR-pipeline-09612# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @pipeline@ was created, @pAllocator@ /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkReleaseCapturedPipelineDataKHR-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkReleaseCapturedPipelineDataKHR-pInfo-parameter# @pInfo@
--     /must/ be a valid pointer to a valid
--     'ReleaseCapturedPipelineDataInfoKHR' structure
--
-- -   #VUID-vkReleaseCapturedPipelineDataKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     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_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'ReleaseCapturedPipelineDataInfoKHR'
releaseCapturedPipelineDataKHR :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the logical device that created the pipeline object.
                                  Device
                               -> -- | @pInfo@ is a pointer to a 'ReleaseCapturedPipelineDataInfoKHR' structure
                                  -- which describes the pipeline to release the data from.
                                  ReleaseCapturedPipelineDataInfoKHR
                               -> -- | @pAllocator@ controls host memory allocation as described in the
                                  -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                                  -- chapter.
                                  ("allocator" ::: Maybe AllocationCallbacks)
                               -> io ()
releaseCapturedPipelineDataKHR :: forall (io :: * -> *).
MonadIO io =>
Device
-> ReleaseCapturedPipelineDataInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
releaseCapturedPipelineDataKHR Device
device ReleaseCapturedPipelineDataInfoKHR
info "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
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 vkReleaseCapturedPipelineDataKHRPtr :: FunPtr
  (Ptr Device_T
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
vkReleaseCapturedPipelineDataKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr ReleaseCapturedPipelineDataInfoKHR
      -> Ptr AllocationCallbacks
      -> IO Result)
pVkReleaseCapturedPipelineDataKHR (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
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
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
vkReleaseCapturedPipelineDataKHRPtr FunPtr
  (Ptr Device_T
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr ReleaseCapturedPipelineDataInfoKHR
      -> Ptr AllocationCallbacks
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 vkReleaseCapturedPipelineDataKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkReleaseCapturedPipelineDataKHR' :: Ptr Device_T
-> Ptr ReleaseCapturedPipelineDataInfoKHR
-> Ptr AllocationCallbacks
-> IO Result
vkReleaseCapturedPipelineDataKHR' = FunPtr
  (Ptr Device_T
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
-> Ptr Device_T
-> Ptr ReleaseCapturedPipelineDataInfoKHR
-> Ptr AllocationCallbacks
-> IO Result
mkVkReleaseCapturedPipelineDataKHR FunPtr
  (Ptr Device_T
   -> Ptr ReleaseCapturedPipelineDataInfoKHR
   -> Ptr AllocationCallbacks
   -> IO Result)
vkReleaseCapturedPipelineDataKHRPtr
  pInfo <- ((Ptr ReleaseCapturedPipelineDataInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr ReleaseCapturedPipelineDataInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ReleaseCapturedPipelineDataInfoKHR -> IO ()) -> IO ())
 -> ContT () IO (Ptr ReleaseCapturedPipelineDataInfoKHR))
-> ((Ptr ReleaseCapturedPipelineDataInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr ReleaseCapturedPipelineDataInfoKHR)
forall a b. (a -> b) -> a -> b
$ ReleaseCapturedPipelineDataInfoKHR
-> (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
ReleaseCapturedPipelineDataInfoKHR
-> (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b) -> IO b
withCStruct (ReleaseCapturedPipelineDataInfoKHR
info)
  pAllocator <- case (allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
 -> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  r <- lift $ traceAroundEvent "vkReleaseCapturedPipelineDataKHR" (vkReleaseCapturedPipelineDataKHR'
                                                                     (deviceHandle (device))
                                                                     pInfo
                                                                     pAllocator)
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))


-- | VkPipelineBinaryCreateInfoKHR - Structure specifying where to retrieve
-- data for pipeline binary creation
--
-- = Description
--
-- When @pPipelineCreateInfo@ is not @NULL@, an implementation will attempt
-- to retrieve pipeline binary data from an internal cache external to the
-- application if
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-pipelineBinaryInternalCache pipelineBinaryInternalCache>
-- is 'Vulkan.Core10.FundamentalTypes.TRUE'. Applications /can/ use this to
-- determine if a pipeline /can/ be created without compilation. If the
-- implementation fails to create a pipeline binary due to missing an
-- internal cache entry,
-- 'Vulkan.Core10.Enums.Result.PIPELINE_BINARY_MISSING_KHR' is returned. If
-- creation succeeds, the resulting binary /can/ be used to create a
-- pipeline. 'Vulkan.Core10.Enums.Result.PIPELINE_BINARY_MISSING_KHR' /may/
-- be returned for any reason in this situation, even if creating a
-- pipeline binary with the same parameters that succeeded earlier.
--
-- If
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-pipelineBinaryPrecompiledInternalCache pipelineBinaryPrecompiledInternalCache>
-- is 'Vulkan.Core10.FundamentalTypes.TRUE', the implementation /may/ be
-- able to create pipeline binaries even when @pPipelineCreateInfo@ has not
-- been used to create binaries before by the application.
--
-- On some platforms, internal pipeline caches may be pre-populated before
-- running the application.
--
-- == Valid Usage
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pipeline-09607# If @pipeline@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @pipeline@ /must/ have
--     been created with
--     'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pipeline-09608# If @pipeline@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     'releaseCapturedPipelineDataKHR' /must/ not have been called on
--     @pipeline@ prior to this command
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pipelineBinaryInternalCache-09609#
--     If
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-pipelineBinaryInternalCache pipelineBinaryInternalCache>
--     is 'Vulkan.Core10.FundamentalTypes.FALSE' pPipelineCreateInfo /must/
--     be @NULL@
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-device-09610# If @device@ was
--     created with
--     'DevicePipelineBinaryInternalCacheControlKHR'::@disableInternalCache@
--     set to 'Vulkan.Core10.FundamentalTypes.TRUE', @pPipelineCreateInfo@
--     /must/ be @NULL@
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pKeysAndDataInfo-09619# One and
--     only one of @pKeysAndDataInfo@, @pipeline@, or @pPipelineCreateInfo@
--     /must/ be non-@NULL@
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pPipelineCreateInfo-09606# If
--     @pPipelineCreateInfo@ is not @NULL@, the @pNext@ chain of
--     @pPipelineCreateInfo@ /must/ not set
--     'PipelineBinaryInfoKHR'::@binaryCount@ to a value greater than @0@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR'
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pKeysAndDataInfo-parameter# If
--     @pKeysAndDataInfo@ is not @NULL@, @pKeysAndDataInfo@ /must/ be a
--     valid pointer to a valid 'PipelineBinaryKeysAndDataKHR' structure
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pipeline-parameter# If
--     @pipeline@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @pipeline@ /must/ be a valid 'Vulkan.Core10.Handles.Pipeline' handle
--
-- -   #VUID-VkPipelineBinaryCreateInfoKHR-pPipelineCreateInfo-parameter#
--     If @pPipelineCreateInfo@ is not @NULL@, @pPipelineCreateInfo@ /must/
--     be a valid pointer to a valid 'PipelineCreateInfoKHR' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.Handles.Pipeline', 'PipelineBinaryKeysAndDataKHR',
-- 'PipelineCreateInfoKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createPipelineBinariesKHR'
data PipelineBinaryCreateInfoKHR = PipelineBinaryCreateInfoKHR
  { -- | @pKeysAndDataInfo@ is @NULL@ or a pointer to a
    -- 'PipelineBinaryKeysAndDataKHR' structure that contains keys and data to
    -- create the pipeline binaries from.
    PipelineBinaryCreateInfoKHR -> Maybe PipelineBinaryKeysAndDataKHR
keysAndDataInfo :: Maybe PipelineBinaryKeysAndDataKHR
  , -- | @pipeline@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE' or a
    -- 'Vulkan.Core10.Handles.Pipeline' that contains data to create the
    -- pipeline binaries from.
    PipelineBinaryCreateInfoKHR -> Pipeline
pipeline :: Pipeline
  , -- | @pPipelineCreateInfo@ is @NULL@ or a pointer to a
    -- 'PipelineCreateInfoKHR' structure with the pipeline creation info. This
    -- is used to probe the implementation’s internal cache for pipeline
    -- binaries.
    PipelineBinaryCreateInfoKHR
-> "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
pipelineCreateInfo :: Maybe PipelineCreateInfoKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryCreateInfoKHR)
#endif
deriving instance Show PipelineBinaryCreateInfoKHR

instance ToCStruct PipelineBinaryCreateInfoKHR where
  withCStruct :: forall b.
PipelineBinaryCreateInfoKHR
-> (Ptr PipelineBinaryCreateInfoKHR -> IO b) -> IO b
withCStruct PipelineBinaryCreateInfoKHR
x Ptr PipelineBinaryCreateInfoKHR -> IO b
f = Int -> (Ptr PipelineBinaryCreateInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PipelineBinaryCreateInfoKHR -> IO b) -> IO b)
-> (Ptr PipelineBinaryCreateInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineBinaryCreateInfoKHR
p -> Ptr PipelineBinaryCreateInfoKHR
-> PipelineBinaryCreateInfoKHR -> IO b -> IO b
forall b.
Ptr PipelineBinaryCreateInfoKHR
-> PipelineBinaryCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryCreateInfoKHR
p PipelineBinaryCreateInfoKHR
x (Ptr PipelineBinaryCreateInfoKHR -> IO b
f Ptr PipelineBinaryCreateInfoKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineBinaryCreateInfoKHR
-> PipelineBinaryCreateInfoKHR -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryCreateInfoKHR
p PipelineBinaryCreateInfoKHR{"pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
Maybe PipelineBinaryKeysAndDataKHR
Pipeline
keysAndDataInfo :: PipelineBinaryCreateInfoKHR -> Maybe PipelineBinaryKeysAndDataKHR
pipeline :: PipelineBinaryCreateInfoKHR -> Pipeline
pipelineCreateInfo :: PipelineBinaryCreateInfoKHR
-> "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
keysAndDataInfo :: Maybe PipelineBinaryKeysAndDataKHR
pipeline :: Pipeline
pipelineCreateInfo :: "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryCreateInfoKHR
p Ptr PipelineBinaryCreateInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryCreateInfoKHR
p Ptr PipelineBinaryCreateInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    pKeysAndDataInfo'' <- case (Maybe PipelineBinaryKeysAndDataKHR
keysAndDataInfo) of
      Maybe PipelineBinaryKeysAndDataKHR
Nothing -> Ptr PipelineBinaryKeysAndDataKHR
-> ContT b IO (Ptr PipelineBinaryKeysAndDataKHR)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineBinaryKeysAndDataKHR
forall a. Ptr a
nullPtr
      Just PipelineBinaryKeysAndDataKHR
j -> ((Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineBinaryKeysAndDataKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b)
 -> ContT b IO (Ptr PipelineBinaryKeysAndDataKHR))
-> ((Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineBinaryKeysAndDataKHR)
forall a b. (a -> b) -> a -> b
$ PipelineBinaryKeysAndDataKHR
-> (Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PipelineBinaryKeysAndDataKHR
-> (Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b
withCStruct (PipelineBinaryKeysAndDataKHR
j)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr PipelineBinaryKeysAndDataKHR))) pKeysAndDataInfo''
    lift $ poke ((p `plusPtr` 24 :: Ptr Pipeline)) (pipeline)
    pPipelineCreateInfo'' <- case (pipelineCreateInfo) of
      "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
Nothing -> Ptr PipelineCreateInfoKHR -> ContT b IO (Ptr PipelineCreateInfoKHR)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineCreateInfoKHR
forall a. Ptr a
nullPtr
      Just PipelineCreateInfoKHR
j -> ((Ptr PipelineCreateInfoKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineCreateInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineCreateInfoKHR -> IO b) -> IO b)
 -> ContT b IO (Ptr PipelineCreateInfoKHR))
-> ((Ptr PipelineCreateInfoKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ PipelineCreateInfoKHR
-> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PipelineCreateInfoKHR
-> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
withCStruct (PipelineCreateInfoKHR
j)
    lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr PipelineCreateInfoKHR))) pPipelineCreateInfo''
    lift $ f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineBinaryCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineBinaryCreateInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryCreateInfoKHR
p Ptr PipelineBinaryCreateInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryCreateInfoKHR
p Ptr PipelineBinaryCreateInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct PipelineBinaryCreateInfoKHR where
  peekCStruct :: Ptr PipelineBinaryCreateInfoKHR -> IO PipelineBinaryCreateInfoKHR
peekCStruct Ptr PipelineBinaryCreateInfoKHR
p = do
    pKeysAndDataInfo <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineBinaryKeysAndDataKHR) ((Ptr PipelineBinaryCreateInfoKHR
p Ptr PipelineBinaryCreateInfoKHR
-> Int -> Ptr (Ptr PipelineBinaryKeysAndDataKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PipelineBinaryKeysAndDataKHR)))
    pKeysAndDataInfo' <- maybePeek (\Ptr PipelineBinaryKeysAndDataKHR
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineBinaryKeysAndDataKHR (Ptr PipelineBinaryKeysAndDataKHR
j)) pKeysAndDataInfo
    pipeline <- peek @Pipeline ((p `plusPtr` 24 :: Ptr Pipeline))
    pPipelineCreateInfo <- peek @(Ptr PipelineCreateInfoKHR) ((p `plusPtr` 32 :: Ptr (Ptr PipelineCreateInfoKHR)))
    pPipelineCreateInfo' <- maybePeek (\Ptr PipelineCreateInfoKHR
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineCreateInfoKHR (Ptr PipelineCreateInfoKHR
j)) pPipelineCreateInfo
    pure $ PipelineBinaryCreateInfoKHR
             pKeysAndDataInfo' pipeline pPipelineCreateInfo'

instance Zero PipelineBinaryCreateInfoKHR where
  zero :: PipelineBinaryCreateInfoKHR
zero = Maybe PipelineBinaryKeysAndDataKHR
-> Pipeline
-> ("pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR)
-> PipelineBinaryCreateInfoKHR
PipelineBinaryCreateInfoKHR
           Maybe PipelineBinaryKeysAndDataKHR
forall a. Maybe a
Nothing
           Pipeline
forall a. Zero a => a
zero
           "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR
forall a. Maybe a
Nothing


-- | VkPipelineBinaryHandlesInfoKHR - Structure containing newly created
-- pipeline binaries
--
-- = Description
--
-- If @pPipelineBinaries@ is @NULL@, the number of binaries that would be
-- created is returned in @pipelineBinaryCount@. Otherwise,
-- @pipelineBinaryCount@ /must/ be the number of entries in the
-- @pPipelineBinaries@ array, and on return from
-- 'createPipelineBinariesKHR' @pipelineBinaryCount@ is overwritten with
-- the number of handles actually written to @pPipelineBinaries@. If the
-- value of @pipelineBinaryCount@ is less than the number of binaries that
-- would have been created, at most @pipelineBinaryCount@ handles will be
-- written to @pPipelineBinaries@ and
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of
-- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that
-- @pPipelineBinaries@ was not large enough to create all the binaries.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineBinaryHandlesInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR'
--
-- -   #VUID-VkPipelineBinaryHandlesInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkPipelineBinaryHandlesInfoKHR-pPipelineBinaries-parameter# If
--     @pipelineBinaryCount@ is not @0@, and @pPipelineBinaries@ is not
--     @NULL@, @pPipelineBinaries@ /must/ be a valid pointer to an array of
--     @pipelineBinaryCount@ 'Vulkan.Extensions.Handles.PipelineBinaryKHR'
--     handles
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Extensions.Handles.PipelineBinaryKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createPipelineBinariesKHR'
data PipelineBinaryHandlesInfoKHR = PipelineBinaryHandlesInfoKHR
  { -- | @pipelineBinaryCount@ is the number of binaries associated with this
    -- pipeline or the number of entries in the @pPipelineBinaries@ array.
    ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Word32
pipelineBinaryCount :: Word32
  , -- | @pPipelineBinaries@ is @NULL@ or a pointer to an array of
    -- 'Vulkan.Extensions.Handles.PipelineBinaryKHR' handles in which the
    -- resulting pipeline binaries are returned.
    ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Ptr PipelineBinaryKHR
pipelineBinaries :: Ptr PipelineBinaryKHR
  }
  deriving (Typeable, ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool
(("binaries" ::: PipelineBinaryHandlesInfoKHR)
 -> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool)
-> (("binaries" ::: PipelineBinaryHandlesInfoKHR)
    -> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool)
-> Eq ("binaries" ::: PipelineBinaryHandlesInfoKHR)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool
== :: ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool
$c/= :: ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool
/= :: ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryHandlesInfoKHR)
#endif
deriving instance Show PipelineBinaryHandlesInfoKHR

instance ToCStruct PipelineBinaryHandlesInfoKHR where
  withCStruct :: forall b.
("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> (Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b)
-> IO b
withCStruct "binaries" ::: PipelineBinaryHandlesInfoKHR
x Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b
f = Int
-> (Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b)
 -> IO b)
-> (Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p -> Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b -> IO b
forall b.
Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p "binaries" ::: PipelineBinaryHandlesInfoKHR
x (Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b
f Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p)
  pokeCStruct :: forall b.
Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b -> IO b
pokeCStruct Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p PipelineBinaryHandlesInfoKHR{Word32
Ptr PipelineBinaryKHR
pipelineBinaryCount :: ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> Word32
pipelineBinaries :: ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Ptr PipelineBinaryKHR
pipelineBinaryCount :: Word32
pipelineBinaries :: Ptr PipelineBinaryKHR
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
pipelineBinaryCount)
    Ptr (Ptr PipelineBinaryKHR) -> Ptr PipelineBinaryKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr (Ptr PipelineBinaryKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr PipelineBinaryKHR))) (Ptr PipelineBinaryKHR
pipelineBinaries)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR) -> IO b -> IO b
pokeZeroCStruct Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PipelineBinaryHandlesInfoKHR where
  peekCStruct :: Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> IO ("binaries" ::: PipelineBinaryHandlesInfoKHR)
peekCStruct Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p = do
    pipelineBinaryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
p Ptr ("binaries" ::: PipelineBinaryHandlesInfoKHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    pPipelineBinaries <- peek @(Ptr PipelineBinaryKHR) ((p `plusPtr` 24 :: Ptr (Ptr PipelineBinaryKHR)))
    pure $ PipelineBinaryHandlesInfoKHR
             pipelineBinaryCount pPipelineBinaries

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

instance Zero PipelineBinaryHandlesInfoKHR where
  zero :: "binaries" ::: PipelineBinaryHandlesInfoKHR
zero = Word32
-> Ptr PipelineBinaryKHR
-> "binaries" ::: PipelineBinaryHandlesInfoKHR
PipelineBinaryHandlesInfoKHR
           Word32
forall a. Zero a => a
zero
           Ptr PipelineBinaryKHR
forall a. Zero a => a
zero


-- | VkPipelineBinaryDataKHR - Structure specifying data and length of a
-- pipeline binary
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'PipelineBinaryKeysAndDataKHR'
data PipelineBinaryDataKHR = PipelineBinaryDataKHR
  { -- | @dataSize@ is the size of the @pData@ buffer in bytes.
    --
    -- #VUID-VkPipelineBinaryDataKHR-dataSize-arraylength# @dataSize@ /must/ be
    -- greater than @0@
    PipelineBinaryDataKHR -> Word64
dataSize :: Word64
  , -- | @pData@ is a pointer to a buffer of @size@ bytes that contains pipeline
    -- binary data obtained from 'getPipelineBinaryDataKHR'.
    --
    -- #VUID-VkPipelineBinaryDataKHR-pData-parameter# @pData@ /must/ be a valid
    -- pointer to an array of @dataSize@ bytes
    PipelineBinaryDataKHR -> Ptr ()
data' :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryDataKHR)
#endif
deriving instance Show PipelineBinaryDataKHR

instance ToCStruct PipelineBinaryDataKHR where
  withCStruct :: forall b.
PipelineBinaryDataKHR
-> (Ptr PipelineBinaryDataKHR -> IO b) -> IO b
withCStruct PipelineBinaryDataKHR
x Ptr PipelineBinaryDataKHR -> IO b
f = Int -> (Ptr PipelineBinaryDataKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr PipelineBinaryDataKHR -> IO b) -> IO b)
-> (Ptr PipelineBinaryDataKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineBinaryDataKHR
p -> Ptr PipelineBinaryDataKHR -> PipelineBinaryDataKHR -> IO b -> IO b
forall b.
Ptr PipelineBinaryDataKHR -> PipelineBinaryDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryDataKHR
p PipelineBinaryDataKHR
x (Ptr PipelineBinaryDataKHR -> IO b
f Ptr PipelineBinaryDataKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineBinaryDataKHR -> PipelineBinaryDataKHR -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryDataKHR
p PipelineBinaryDataKHR{Word64
Ptr ()
dataSize :: PipelineBinaryDataKHR -> Word64
data' :: PipelineBinaryDataKHR -> Ptr ()
dataSize :: Word64
data' :: Ptr ()
..} IO b
f = do
    Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataKHR
p Ptr PipelineBinaryDataKHR -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
dataSize))
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataKHR
p Ptr PipelineBinaryDataKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
data')
    IO b
f
  cStructSize :: Int
cStructSize = Int
16
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineBinaryDataKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineBinaryDataKHR
p IO b
f = do
    Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataKHR
p Ptr PipelineBinaryDataKHR -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataKHR
p Ptr PipelineBinaryDataKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PipelineBinaryDataKHR where
  peekCStruct :: Ptr PipelineBinaryDataKHR -> IO PipelineBinaryDataKHR
peekCStruct Ptr PipelineBinaryDataKHR
p = do
    dataSize <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr PipelineBinaryDataKHR
p Ptr PipelineBinaryDataKHR -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CSize))
    pData <- peek @(Ptr ()) ((p `plusPtr` 8 :: Ptr (Ptr ())))
    pure $ PipelineBinaryDataKHR
             (coerce @CSize @Word64 dataSize) pData

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

instance Zero PipelineBinaryDataKHR where
  zero :: PipelineBinaryDataKHR
zero = Word64 -> Ptr () -> PipelineBinaryDataKHR
PipelineBinaryDataKHR
           Word64
forall a. Zero a => a
zero
           Ptr ()
forall a. Zero a => a
zero


-- | VkPipelineBinaryKeysAndDataKHR - Structure specifying arrays of key and
-- data pairs
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'PipelineBinaryCreateInfoKHR', 'PipelineBinaryDataKHR',
-- 'PipelineBinaryKeyKHR'
data PipelineBinaryKeysAndDataKHR = PipelineBinaryKeysAndDataKHR
  { -- | @pPipelineBinaryKeys@ is a pointer to an array of 'PipelineBinaryKeyKHR'
    -- structures containing the pipeline binary keys
    --
    -- #VUID-VkPipelineBinaryKeysAndDataKHR-pPipelineBinaryKeys-parameter#
    -- @pPipelineBinaryKeys@ /must/ be a valid pointer to an array of
    -- @binaryCount@ valid 'PipelineBinaryKeyKHR' structures
    PipelineBinaryKeysAndDataKHR
-> Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
pipelineBinaryKeys :: Vector PipelineBinaryKeyKHR
  , -- | @pPipelineBinaryData@ is a pointer to an array of
    -- 'PipelineBinaryDataKHR' structures containing the pipeline binary data
    --
    -- #VUID-VkPipelineBinaryKeysAndDataKHR-pPipelineBinaryData-parameter#
    -- @pPipelineBinaryData@ /must/ be a valid pointer to an array of
    -- @binaryCount@ valid 'PipelineBinaryDataKHR' structures
    PipelineBinaryKeysAndDataKHR -> Vector PipelineBinaryDataKHR
pipelineBinaryData :: Vector PipelineBinaryDataKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryKeysAndDataKHR)
#endif
deriving instance Show PipelineBinaryKeysAndDataKHR

instance ToCStruct PipelineBinaryKeysAndDataKHR where
  withCStruct :: forall b.
PipelineBinaryKeysAndDataKHR
-> (Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b
withCStruct PipelineBinaryKeysAndDataKHR
x Ptr PipelineBinaryKeysAndDataKHR -> IO b
f = Int -> (Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b)
-> (Ptr PipelineBinaryKeysAndDataKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineBinaryKeysAndDataKHR
p -> Ptr PipelineBinaryKeysAndDataKHR
-> PipelineBinaryKeysAndDataKHR -> IO b -> IO b
forall b.
Ptr PipelineBinaryKeysAndDataKHR
-> PipelineBinaryKeysAndDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryKeysAndDataKHR
p PipelineBinaryKeysAndDataKHR
x (Ptr PipelineBinaryKeysAndDataKHR -> IO b
f Ptr PipelineBinaryKeysAndDataKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineBinaryKeysAndDataKHR
-> PipelineBinaryKeysAndDataKHR -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryKeysAndDataKHR
p PipelineBinaryKeysAndDataKHR{Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
Vector PipelineBinaryDataKHR
pipelineBinaryKeys :: PipelineBinaryKeysAndDataKHR
-> Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
pipelineBinaryData :: PipelineBinaryKeysAndDataKHR -> Vector PipelineBinaryDataKHR
pipelineBinaryKeys :: Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
pipelineBinaryData :: Vector PipelineBinaryDataKHR
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    let pPipelineBinaryKeysLength :: Int
pPipelineBinaryKeysLength = Vector ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int)
-> Vector ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
pipelineBinaryKeys)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((Vector PipelineBinaryDataKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PipelineBinaryDataKHR -> Int)
-> Vector PipelineBinaryDataKHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector PipelineBinaryDataKHR
pipelineBinaryData)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pPipelineBinaryKeysLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
      IOException -> IO ()
forall e a. (HasCallStack, 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
"pPipelineBinaryData and pPipelineBinaryKeys must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryKeysAndDataKHR
p Ptr PipelineBinaryKeysAndDataKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pPipelineBinaryKeysLength :: Word32))
    pPPipelineBinaryKeys' <- ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b)
-> ContT b IO (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b)
 -> ContT b IO (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)))
-> ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b)
-> ContT b IO (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR))
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @PipelineBinaryKeyKHR ((Vector ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
pipelineBinaryKeys)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
56)
    lift $ Data.Vector.imapM_ (\Int
i "pipelineKey" ::: PipelineBinaryKeyKHR
e -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
pPPipelineBinaryKeys' Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
56 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryKeyKHR) ("pipelineKey" ::: PipelineBinaryKeyKHR
e)) (pipelineBinaryKeys)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr PipelineBinaryKeyKHR))) (pPPipelineBinaryKeys')
    pPPipelineBinaryData' <- ContT $ allocaBytes @PipelineBinaryDataKHR ((Data.Vector.length (pipelineBinaryData)) * 16)
    lift $ Data.Vector.imapM_ (\Int
i PipelineBinaryDataKHR
e -> Ptr PipelineBinaryDataKHR -> PipelineBinaryDataKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PipelineBinaryDataKHR
pPPipelineBinaryData' Ptr PipelineBinaryDataKHR -> Int -> Ptr PipelineBinaryDataKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryDataKHR) (PipelineBinaryDataKHR
e)) (pipelineBinaryData)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr PipelineBinaryDataKHR))) (pPPipelineBinaryData')
    lift $ f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineBinaryKeysAndDataKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineBinaryKeysAndDataKHR
_ IO b
f = IO b
f

instance FromCStruct PipelineBinaryKeysAndDataKHR where
  peekCStruct :: Ptr PipelineBinaryKeysAndDataKHR -> IO PipelineBinaryKeysAndDataKHR
peekCStruct Ptr PipelineBinaryKeysAndDataKHR
p = do
    binaryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineBinaryKeysAndDataKHR
p Ptr PipelineBinaryKeysAndDataKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
    pPipelineBinaryKeys <- peek @(Ptr PipelineBinaryKeyKHR) ((p `plusPtr` 8 :: Ptr (Ptr PipelineBinaryKeyKHR)))
    pPipelineBinaryKeys' <- generateM (fromIntegral binaryCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineBinaryKeyKHR ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
pPipelineBinaryKeys Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
56 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryKeyKHR)))
    pPipelineBinaryData <- peek @(Ptr PipelineBinaryDataKHR) ((p `plusPtr` 16 :: Ptr (Ptr PipelineBinaryDataKHR)))
    pPipelineBinaryData' <- generateM (fromIntegral binaryCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineBinaryDataKHR ((Ptr PipelineBinaryDataKHR
pPipelineBinaryData Ptr PipelineBinaryDataKHR -> Int -> Ptr PipelineBinaryDataKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryDataKHR)))
    pure $ PipelineBinaryKeysAndDataKHR
             pPipelineBinaryKeys' pPipelineBinaryData'

instance Zero PipelineBinaryKeysAndDataKHR where
  zero :: PipelineBinaryKeysAndDataKHR
zero = Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Vector PipelineBinaryDataKHR -> PipelineBinaryKeysAndDataKHR
PipelineBinaryKeysAndDataKHR
           Vector ("pipelineKey" ::: PipelineBinaryKeyKHR)
forall a. Monoid a => a
mempty
           Vector PipelineBinaryDataKHR
forall a. Monoid a => a
mempty


-- | VkPipelineBinaryKeyKHR - Structure specifying a key to a pipeline binary
--
-- = Description
--
-- Any returned values beyond the first @keySize@ bytes are undefined.
-- Implementations /must/ return a @keySize@ greater than 0, and
-- less-or-equal to
-- 'Vulkan.Core10.APIConstants.MAX_PIPELINE_BINARY_KEY_SIZE_KHR'.
--
-- Two keys are considered equal if @keySize@ is equal and the first
-- @keySize@ bytes of @key@ compare equal.
--
-- Implementations /may/ return a different @keySize@ for different
-- binaries.
--
-- Implementations /should/ ensure that @keySize@ is large enough to
-- uniquely identify a pipeline binary.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'PipelineBinaryKeysAndDataKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPipelineBinaryDataKHR', 'getPipelineKeyKHR'
data PipelineBinaryKeyKHR = PipelineBinaryKeyKHR
  { -- | @keySize@ is the size, in bytes, of valid data returned in @key@.
    ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Word32
keySize :: Word32
  , -- | @key@ is a buffer of opaque data specifying a pipeline binary key.
    ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> "pipelineBinaryData" ::: ByteString
key :: ByteString
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryKeyKHR)
#endif
deriving instance Show PipelineBinaryKeyKHR

instance ToCStruct PipelineBinaryKeyKHR where
  withCStruct :: forall b.
("pipelineKey" ::: PipelineBinaryKeyKHR)
-> (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b
withCStruct "pipelineKey" ::: PipelineBinaryKeyKHR
x Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b
f = Int
-> (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b)
-> (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p -> Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b -> IO b
forall b.
Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p "pipelineKey" ::: PipelineBinaryKeyKHR
x (Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b
f Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p)
  pokeCStruct :: forall b.
Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b -> IO b
pokeCStruct Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p PipelineBinaryKeyKHR{Word32
"pipelineBinaryData" ::: ByteString
keySize :: ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Word32
key :: ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> "pipelineBinaryData" ::: ByteString
keySize :: Word32
key :: "pipelineBinaryData" ::: ByteString
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
keySize)
    Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8)
-> ("pipelineBinaryData" ::: ByteString) -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8)
-> ("pipelineBinaryData" ::: ByteString) -> IO ()
pokeFixedLengthByteString ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8))) ("pipelineBinaryData" ::: ByteString
key)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> IO b -> IO b
pokeZeroCStruct Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8)
-> ("pipelineBinaryData" ::: ByteString) -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8)
-> ("pipelineBinaryData" ::: ByteString) -> IO ()
pokeFixedLengthByteString ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> Int -> Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8))) ("pipelineBinaryData" ::: ByteString
forall a. Monoid a => a
mempty)
    IO b
f

instance FromCStruct PipelineBinaryKeyKHR where
  peekCStruct :: Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
-> IO ("pipelineKey" ::: PipelineBinaryKeyKHR)
peekCStruct Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p = do
    keySize <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR)
p Ptr ("pipelineKey" ::: PipelineBinaryKeyKHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    key <- peekByteStringFromSizedVectorPtr ((p `plusPtr` 20 :: Ptr (FixedArray MAX_PIPELINE_BINARY_KEY_SIZE_KHR Word8)))
    pure $ PipelineBinaryKeyKHR
             keySize key

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

instance Zero PipelineBinaryKeyKHR where
  zero :: "pipelineKey" ::: PipelineBinaryKeyKHR
zero = Word32
-> ("pipelineBinaryData" ::: ByteString)
-> "pipelineKey" ::: PipelineBinaryKeyKHR
PipelineBinaryKeyKHR
           Word32
forall a. Zero a => a
zero
           "pipelineBinaryData" ::: ByteString
forall a. Monoid a => a
mempty


-- | VkPipelineBinaryInfoKHR - Structure specifying pipeline binaries to use
-- during pipeline creation
--
-- = Description
--
-- If a 'PipelineBinaryInfoKHR' structure with a @binaryCount@ greater than
-- 0 is included in the @pNext@ chain of any @Vk*PipelineCreateInfo@
-- structure when creating a pipeline, implementations /must/ use the data
-- in @pPipelineBinaries@ instead of recalculating it. Any shader module
-- identifiers, shader modules, or chained
-- 'Vulkan.Core10.Shader.ShaderModuleCreateInfo' structures declared in
-- 'Vulkan.Core10.ComputePipeline.PipelineShaderStageCreateInfo' instances,
-- are ignored. Any
-- 'Vulkan.Extensions.VK_EXT_descriptor_heap.ShaderDescriptorSetAndBindingMappingInfoEXT'
-- in the @pNext@ chains of
-- 'Vulkan.Core10.ComputePipeline.PipelineShaderStageCreateInfo' instances
-- are ignored.
--
-- If this structure is not included in the @pNext@ chain, it is equivalent
-- to specifying this structure with a @binaryCount@ of @0@.
--
-- == Valid Usage
--
-- -   #VUID-VkPipelineBinaryInfoKHR-binaryCount-09603# @binaryCount@ and
--     the order of the elements in @pPipelineBinaries@ /must/ exactly
--     match that returned by 'createPipelineBinariesKHR' for the matching
--     @Vk*PipelineCreateInfo@ structure and its @pNext@ chain, ignoring
--     the presence of the 'PipelineBinaryInfoKHR' structure, the presence
--     of the
--     'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
--     flag, and absence of any shader module identifiers, shader modules,
--     or 'Vulkan.Core10.Shader.ShaderModuleCreateInfo' structures, for the
--     same
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#global-pipeline-key global pipeline key>,
--     from either:
--
--     -   'PipelineBinaryCreateInfoKHR'::@pPipelineCreateInfo@, or
--
--     -   'PipelineBinaryCreateInfoKHR'::@pipeline@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineBinaryInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR'
--
-- -   #VUID-VkPipelineBinaryInfoKHR-pPipelineBinaries-parameter# If
--     @binaryCount@ is not @0@, @pPipelineBinaries@ /must/ be a valid
--     pointer to an array of @binaryCount@ valid
--     'Vulkan.Extensions.Handles.PipelineBinaryKHR' handles
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Extensions.Handles.PipelineBinaryKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineBinaryInfoKHR = PipelineBinaryInfoKHR
  { -- | @pPipelineBinaries@ is a pointer to an array of
    -- 'Vulkan.Extensions.Handles.PipelineBinaryKHR' handles.
    PipelineBinaryInfoKHR -> Vector PipelineBinaryKHR
pipelineBinaries :: Vector PipelineBinaryKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryInfoKHR)
#endif
deriving instance Show PipelineBinaryInfoKHR

instance ToCStruct PipelineBinaryInfoKHR where
  withCStruct :: forall b.
PipelineBinaryInfoKHR
-> (Ptr PipelineBinaryInfoKHR -> IO b) -> IO b
withCStruct PipelineBinaryInfoKHR
x Ptr PipelineBinaryInfoKHR -> IO b
f = Int -> (Ptr PipelineBinaryInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelineBinaryInfoKHR -> IO b) -> IO b)
-> (Ptr PipelineBinaryInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineBinaryInfoKHR
p -> Ptr PipelineBinaryInfoKHR -> PipelineBinaryInfoKHR -> IO b -> IO b
forall b.
Ptr PipelineBinaryInfoKHR -> PipelineBinaryInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryInfoKHR
p PipelineBinaryInfoKHR
x (Ptr PipelineBinaryInfoKHR -> IO b
f Ptr PipelineBinaryInfoKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineBinaryInfoKHR -> PipelineBinaryInfoKHR -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryInfoKHR
p PipelineBinaryInfoKHR{Vector PipelineBinaryKHR
pipelineBinaries :: PipelineBinaryInfoKHR -> Vector PipelineBinaryKHR
pipelineBinaries :: Vector PipelineBinaryKHR
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector PipelineBinaryKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PipelineBinaryKHR -> Int)
-> Vector PipelineBinaryKHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector PipelineBinaryKHR
pipelineBinaries)) :: Word32))
    pPPipelineBinaries' <- ((Ptr PipelineBinaryKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineBinaryKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineBinaryKHR -> IO b) -> IO b)
 -> ContT b IO (Ptr PipelineBinaryKHR))
-> ((Ptr PipelineBinaryKHR -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineBinaryKHR)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @PipelineBinaryKHR ((Vector PipelineBinaryKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PipelineBinaryKHR
pipelineBinaries)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
    lift $ Data.Vector.imapM_ (\Int
i PipelineBinaryKHR
e -> Ptr PipelineBinaryKHR -> PipelineBinaryKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PipelineBinaryKHR
pPPipelineBinaries' Ptr PipelineBinaryKHR -> Int -> Ptr PipelineBinaryKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryKHR) (PipelineBinaryKHR
e)) (pipelineBinaries)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr PipelineBinaryKHR))) (pPPipelineBinaries')
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineBinaryInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineBinaryInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct PipelineBinaryInfoKHR where
  peekCStruct :: Ptr PipelineBinaryInfoKHR -> IO PipelineBinaryInfoKHR
peekCStruct Ptr PipelineBinaryInfoKHR
p = do
    binaryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineBinaryInfoKHR
p Ptr PipelineBinaryInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    pPipelineBinaries <- peek @(Ptr PipelineBinaryKHR) ((p `plusPtr` 24 :: Ptr (Ptr PipelineBinaryKHR)))
    pPipelineBinaries' <- generateM (fromIntegral binaryCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @PipelineBinaryKHR ((Ptr PipelineBinaryKHR
pPipelineBinaries Ptr PipelineBinaryKHR -> Int -> Ptr PipelineBinaryKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineBinaryKHR)))
    pure $ PipelineBinaryInfoKHR
             pPipelineBinaries'

instance Zero PipelineBinaryInfoKHR where
  zero :: PipelineBinaryInfoKHR
zero = Vector PipelineBinaryKHR -> PipelineBinaryInfoKHR
PipelineBinaryInfoKHR
           Vector PipelineBinaryKHR
forall a. Monoid a => a
mempty


-- | VkReleaseCapturedPipelineDataInfoKHR - Structure specifying a pipeline
-- whose captured data is to be released
--
-- == Valid Usage
--
-- -   #VUID-VkReleaseCapturedPipelineDataInfoKHR-pipeline-09613#
--     @pipeline@ /must/ have been created with
--     'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR'
--
-- -   #VUID-VkReleaseCapturedPipelineDataInfoKHR-pipeline-09618#
--     @pipeline@ /must/ not have been used in a previous call to
--     'releaseCapturedPipelineDataKHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkReleaseCapturedPipelineDataInfoKHR-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR'
--
-- -   #VUID-VkReleaseCapturedPipelineDataInfoKHR-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkReleaseCapturedPipelineDataInfoKHR-pipeline-parameter#
--     @pipeline@ /must/ be a valid 'Vulkan.Core10.Handles.Pipeline' handle
--
-- == Host Synchronization
--
-- -   Host access to @pipeline@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'releaseCapturedPipelineDataKHR'
data ReleaseCapturedPipelineDataInfoKHR = ReleaseCapturedPipelineDataInfoKHR
  { -- | @pipeline@ the handle of the pipeline object to release the data from.
    ReleaseCapturedPipelineDataInfoKHR -> Pipeline
pipeline :: Pipeline }
  deriving (Typeable, ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> Bool
(ReleaseCapturedPipelineDataInfoKHR
 -> ReleaseCapturedPipelineDataInfoKHR -> Bool)
-> (ReleaseCapturedPipelineDataInfoKHR
    -> ReleaseCapturedPipelineDataInfoKHR -> Bool)
-> Eq ReleaseCapturedPipelineDataInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> Bool
== :: ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> Bool
$c/= :: ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> Bool
/= :: ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ReleaseCapturedPipelineDataInfoKHR)
#endif
deriving instance Show ReleaseCapturedPipelineDataInfoKHR

instance ToCStruct ReleaseCapturedPipelineDataInfoKHR where
  withCStruct :: forall b.
ReleaseCapturedPipelineDataInfoKHR
-> (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b) -> IO b
withCStruct ReleaseCapturedPipelineDataInfoKHR
x Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b
f = Int -> (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b) -> IO b)
-> (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ReleaseCapturedPipelineDataInfoKHR
p -> Ptr ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> IO b -> IO b
forall b.
Ptr ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ReleaseCapturedPipelineDataInfoKHR
p ReleaseCapturedPipelineDataInfoKHR
x (Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b
f Ptr ReleaseCapturedPipelineDataInfoKHR
p)
  pokeCStruct :: forall b.
Ptr ReleaseCapturedPipelineDataInfoKHR
-> ReleaseCapturedPipelineDataInfoKHR -> IO b -> IO b
pokeCStruct Ptr ReleaseCapturedPipelineDataInfoKHR
p ReleaseCapturedPipelineDataInfoKHR{Pipeline
pipeline :: ReleaseCapturedPipelineDataInfoKHR -> Pipeline
pipeline :: Pipeline
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Pipeline -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Pipeline)) (Pipeline
pipeline)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ReleaseCapturedPipelineDataInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr ReleaseCapturedPipelineDataInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Pipeline -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Pipeline)) (Pipeline
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ReleaseCapturedPipelineDataInfoKHR where
  peekCStruct :: Ptr ReleaseCapturedPipelineDataInfoKHR
-> IO ReleaseCapturedPipelineDataInfoKHR
peekCStruct Ptr ReleaseCapturedPipelineDataInfoKHR
p = do
    pipeline <- forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr ReleaseCapturedPipelineDataInfoKHR
p Ptr ReleaseCapturedPipelineDataInfoKHR -> Int -> Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Pipeline))
    pure $ ReleaseCapturedPipelineDataInfoKHR
             pipeline

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

instance Zero ReleaseCapturedPipelineDataInfoKHR where
  zero :: ReleaseCapturedPipelineDataInfoKHR
zero = Pipeline -> ReleaseCapturedPipelineDataInfoKHR
ReleaseCapturedPipelineDataInfoKHR
           Pipeline
forall a. Zero a => a
zero


-- | VkPipelineBinaryDataInfoKHR - Structure specifying a pipeline binary to
-- retrieve binary data from
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Extensions.Handles.PipelineBinaryKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPipelineBinaryDataKHR'
data PipelineBinaryDataInfoKHR = PipelineBinaryDataInfoKHR
  { -- | @pipelineBinary@ is the pipeline binary to get data from.
    --
    -- #VUID-VkPipelineBinaryDataInfoKHR-pipelineBinary-parameter#
    -- @pipelineBinary@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.PipelineBinaryKHR' handle
    PipelineBinaryDataInfoKHR -> PipelineBinaryKHR
pipelineBinary :: PipelineBinaryKHR }
  deriving (Typeable, PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool
(PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool)
-> (PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool)
-> Eq PipelineBinaryDataInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool
== :: PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool
$c/= :: PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool
/= :: PipelineBinaryDataInfoKHR -> PipelineBinaryDataInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineBinaryDataInfoKHR)
#endif
deriving instance Show PipelineBinaryDataInfoKHR

instance ToCStruct PipelineBinaryDataInfoKHR where
  withCStruct :: forall b.
PipelineBinaryDataInfoKHR
-> (Ptr PipelineBinaryDataInfoKHR -> IO b) -> IO b
withCStruct PipelineBinaryDataInfoKHR
x Ptr PipelineBinaryDataInfoKHR -> IO b
f = Int -> (Ptr PipelineBinaryDataInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PipelineBinaryDataInfoKHR -> IO b) -> IO b)
-> (Ptr PipelineBinaryDataInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineBinaryDataInfoKHR
p -> Ptr PipelineBinaryDataInfoKHR
-> PipelineBinaryDataInfoKHR -> IO b -> IO b
forall b.
Ptr PipelineBinaryDataInfoKHR
-> PipelineBinaryDataInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryDataInfoKHR
p PipelineBinaryDataInfoKHR
x (Ptr PipelineBinaryDataInfoKHR -> IO b
f Ptr PipelineBinaryDataInfoKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineBinaryDataInfoKHR
-> PipelineBinaryDataInfoKHR -> IO b -> IO b
pokeCStruct Ptr PipelineBinaryDataInfoKHR
p PipelineBinaryDataInfoKHR{PipelineBinaryKHR
pipelineBinary :: PipelineBinaryDataInfoKHR -> PipelineBinaryKHR
pipelineBinary :: PipelineBinaryKHR
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr PipelineBinaryKHR -> PipelineBinaryKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr PipelineBinaryKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineBinaryKHR)) (PipelineBinaryKHR
pipelineBinary)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineBinaryDataInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineBinaryDataInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr PipelineBinaryKHR -> PipelineBinaryKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr PipelineBinaryKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineBinaryKHR)) (PipelineBinaryKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PipelineBinaryDataInfoKHR where
  peekCStruct :: Ptr PipelineBinaryDataInfoKHR -> IO PipelineBinaryDataInfoKHR
peekCStruct Ptr PipelineBinaryDataInfoKHR
p = do
    pipelineBinary <- forall a. Storable a => Ptr a -> IO a
peek @PipelineBinaryKHR ((Ptr PipelineBinaryDataInfoKHR
p Ptr PipelineBinaryDataInfoKHR -> Int -> Ptr PipelineBinaryKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineBinaryKHR))
    pure $ PipelineBinaryDataInfoKHR
             pipelineBinary

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

instance Zero PipelineBinaryDataInfoKHR where
  zero :: PipelineBinaryDataInfoKHR
zero = PipelineBinaryKHR -> PipelineBinaryDataInfoKHR
PipelineBinaryDataInfoKHR
           PipelineBinaryKHR
forall a. Zero a => a
zero


-- | VkPipelineCreateInfoKHR - Structure specifying a pipeline createinfo
-- chain
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'PipelineBinaryCreateInfoKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'getPipelineKeyKHR'
data PipelineCreateInfoKHR = PipelineCreateInfoKHR
  {}
  deriving (Typeable, PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool
(PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool)
-> (PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool)
-> Eq PipelineCreateInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool
== :: PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool
$c/= :: PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool
/= :: PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineCreateInfoKHR)
#endif
deriving instance Show PipelineCreateInfoKHR

instance ToCStruct PipelineCreateInfoKHR where
  withCStruct :: forall b.
PipelineCreateInfoKHR
-> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
withCStruct PipelineCreateInfoKHR
x Ptr PipelineCreateInfoKHR -> IO b
f = Int -> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr PipelineCreateInfoKHR -> IO b) -> IO b)
-> (Ptr PipelineCreateInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCreateInfoKHR
p -> Ptr PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> IO b -> IO b
forall b.
Ptr PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCreateInfoKHR
p PipelineCreateInfoKHR
x (Ptr PipelineCreateInfoKHR -> IO b
f Ptr PipelineCreateInfoKHR
p)
  pokeCStruct :: forall b.
Ptr PipelineCreateInfoKHR -> PipelineCreateInfoKHR -> IO b -> IO b
pokeCStruct Ptr PipelineCreateInfoKHR
p PipelineCreateInfoKHR
PipelineCreateInfoKHR IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreateInfoKHR
p Ptr PipelineCreateInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreateInfoKHR
p Ptr PipelineCreateInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f
  cStructSize :: Int
cStructSize = Int
16
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PipelineCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCreateInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreateInfoKHR
p Ptr PipelineCreateInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCreateInfoKHR
p Ptr PipelineCreateInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct PipelineCreateInfoKHR where
  peekCStruct :: Ptr PipelineCreateInfoKHR -> IO PipelineCreateInfoKHR
peekCStruct Ptr PipelineCreateInfoKHR
_ = PipelineCreateInfoKHR -> IO PipelineCreateInfoKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineCreateInfoKHR -> IO PipelineCreateInfoKHR)
-> PipelineCreateInfoKHR -> IO PipelineCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ PipelineCreateInfoKHR
PipelineCreateInfoKHR
                           

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

instance Zero PipelineCreateInfoKHR where
  zero :: PipelineCreateInfoKHR
zero = PipelineCreateInfoKHR
PipelineCreateInfoKHR
           


-- | VkPhysicalDevicePipelineBinaryFeaturesKHR - Structure describing support
-- for pipeline binaries
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDevicePipelineBinaryFeaturesKHR' 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. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDevicePipelineBinaryFeaturesKHR', it /must/ add an instance of
-- the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePipelineBinaryFeaturesKHR = PhysicalDevicePipelineBinaryFeaturesKHR
  { -- | #features-pipelineBinaries# @pipelineBinaries@ indicates that the
    -- implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#pipelines-binaries>.
    PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
pipelineBinaries :: Bool }
  deriving (Typeable, PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
(PhysicalDevicePipelineBinaryFeaturesKHR
 -> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool)
-> (PhysicalDevicePipelineBinaryFeaturesKHR
    -> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool)
-> Eq PhysicalDevicePipelineBinaryFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
== :: PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
$c/= :: PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
/= :: PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePipelineBinaryFeaturesKHR)
#endif
deriving instance Show PhysicalDevicePipelineBinaryFeaturesKHR

instance ToCStruct PhysicalDevicePipelineBinaryFeaturesKHR where
  withCStruct :: forall b.
PhysicalDevicePipelineBinaryFeaturesKHR
-> (Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b) -> IO b
withCStruct PhysicalDevicePipelineBinaryFeaturesKHR
x Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b
f = Int
-> (Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p -> Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> IO b -> IO b
forall b.
Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p PhysicalDevicePipelineBinaryFeaturesKHR
x (Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b
f Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p)
  pokeCStruct :: forall b.
Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> PhysicalDevicePipelineBinaryFeaturesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p PhysicalDevicePipelineBinaryFeaturesKHR{Bool
pipelineBinaries :: PhysicalDevicePipelineBinaryFeaturesKHR -> Bool
pipelineBinaries :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> 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 PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaries))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> 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 PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> 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 PhysicalDevicePipelineBinaryFeaturesKHR where
  peekCStruct :: Ptr PhysicalDevicePipelineBinaryFeaturesKHR
-> IO PhysicalDevicePipelineBinaryFeaturesKHR
peekCStruct Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p = do
    pipelineBinaries <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePipelineBinaryFeaturesKHR
p Ptr PhysicalDevicePipelineBinaryFeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pure $ PhysicalDevicePipelineBinaryFeaturesKHR
             (bool32ToBool pipelineBinaries)

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

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


-- | VkDevicePipelineBinaryInternalCacheControlKHR - Structure specifying
-- parameter to disable the internal pipeline cache
--
-- = Description
--
-- If the 'Vulkan.Core10.Device.DeviceCreateInfo'::@pNext@ chain does not
-- include this structure, then @disableInternalCache@ defaults to
-- 'Vulkan.Core10.FundamentalTypes.FALSE'.
--
-- == Valid Usage
--
-- -   #VUID-VkDevicePipelineBinaryInternalCacheControlKHR-disableInternalCache-09602#
--     If
--     'PhysicalDevicePipelineBinaryPropertiesKHR'::@pipelineBinaryInternalCacheControl@
--     is 'Vulkan.Core10.FundamentalTypes.FALSE', @disableInternalCache@
--     /must/ be 'Vulkan.Core10.FundamentalTypes.FALSE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDevicePipelineBinaryInternalCacheControlKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DevicePipelineBinaryInternalCacheControlKHR = DevicePipelineBinaryInternalCacheControlKHR
  { -- | @disableInternalCache@ specifies whether or not to disable the
    -- implementation’s internal pipeline cache.
    DevicePipelineBinaryInternalCacheControlKHR -> Bool
disableInternalCache :: Bool }
  deriving (Typeable, DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> Bool
(DevicePipelineBinaryInternalCacheControlKHR
 -> DevicePipelineBinaryInternalCacheControlKHR -> Bool)
-> (DevicePipelineBinaryInternalCacheControlKHR
    -> DevicePipelineBinaryInternalCacheControlKHR -> Bool)
-> Eq DevicePipelineBinaryInternalCacheControlKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> Bool
== :: DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> Bool
$c/= :: DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> Bool
/= :: DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DevicePipelineBinaryInternalCacheControlKHR)
#endif
deriving instance Show DevicePipelineBinaryInternalCacheControlKHR

instance ToCStruct DevicePipelineBinaryInternalCacheControlKHR where
  withCStruct :: forall b.
DevicePipelineBinaryInternalCacheControlKHR
-> (Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b)
-> IO b
withCStruct DevicePipelineBinaryInternalCacheControlKHR
x Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b
f = Int
-> (Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b) -> IO b)
-> (Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr DevicePipelineBinaryInternalCacheControlKHR
p -> Ptr DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> IO b -> IO b
forall b.
Ptr DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DevicePipelineBinaryInternalCacheControlKHR
p DevicePipelineBinaryInternalCacheControlKHR
x (Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b
f Ptr DevicePipelineBinaryInternalCacheControlKHR
p)
  pokeCStruct :: forall b.
Ptr DevicePipelineBinaryInternalCacheControlKHR
-> DevicePipelineBinaryInternalCacheControlKHR -> IO b -> IO b
pokeCStruct Ptr DevicePipelineBinaryInternalCacheControlKHR
p DevicePipelineBinaryInternalCacheControlKHR{Bool
disableInternalCache :: DevicePipelineBinaryInternalCacheControlKHR -> Bool
disableInternalCache :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> 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 DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
disableInternalCache))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr DevicePipelineBinaryInternalCacheControlKHR -> IO b -> IO b
pokeZeroCStruct Ptr DevicePipelineBinaryInternalCacheControlKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> 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 DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> 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 DevicePipelineBinaryInternalCacheControlKHR where
  peekCStruct :: Ptr DevicePipelineBinaryInternalCacheControlKHR
-> IO DevicePipelineBinaryInternalCacheControlKHR
peekCStruct Ptr DevicePipelineBinaryInternalCacheControlKHR
p = do
    disableInternalCache <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr DevicePipelineBinaryInternalCacheControlKHR
p Ptr DevicePipelineBinaryInternalCacheControlKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pure $ DevicePipelineBinaryInternalCacheControlKHR
             (bool32ToBool disableInternalCache)

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

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


-- | VkPhysicalDevicePipelineBinaryPropertiesKHR - Structure describing
-- properties about the pipeline binary implementation
--
-- = Description
--
-- These properties tend to be platform specific and may change depending
-- on external configuration which is outside the scope of this
-- specification. These properties are intended to guide applications when
-- implementations have dedicated caching solutions available. In
-- particular, if the @pipelineBinaryPrefersInternalCache@ limit is
-- exposed, relying on the internal cache may provide some advantage
-- compared to an application-specific solution. An application with its
-- own dedicated solution may still use its own caching system even with
-- this limit exposed.
--
-- If the 'PhysicalDevicePipelineBinaryPropertiesKHR' structure is included
-- in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_pipeline_binary VK_KHR_pipeline_binary>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePipelineBinaryPropertiesKHR = PhysicalDevicePipelineBinaryPropertiesKHR
  { -- | #limits-pipelineBinaryInternalCache# @pipelineBinaryInternalCache@
    -- specifies that the implementation maintains a pipeline cache internal to
    -- the implementation. If this is 'Vulkan.Core10.FundamentalTypes.TRUE',
    -- applications /can/ create pipeline binaries with only a pipeline create
    -- info, and in this case, an implementation /may/ be able to create a
    -- pipeline binary directly without application needing to capture the
    -- binary itself.
    PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryInternalCache :: Bool
  , -- | #limits-pipelineBinaryInternalCacheControl#
    -- @pipelineBinaryInternalCacheControl@ specifies whether the driver’s
    -- internal cache /can/ be disabled. If this property is
    -- 'Vulkan.Core10.FundamentalTypes.TRUE'
    -- 'DevicePipelineBinaryInternalCacheControlKHR'::@disableInternalCache@
    -- /can/ be used to disable the driver’s internal cache, allowing an
    -- application to take full control of both memory and disk usage.
    PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryInternalCacheControl :: Bool
  , -- | #limits-pipelineBinaryPrefersInternalCache#
    -- @pipelineBinaryPrefersInternalCache@ specifies that the implementation
    -- prefers to maintain an internal cache, and applications /should/ not
    -- store pipeline binaries in their own on-disk caches to avoid increased
    -- on-disk storage requirements. Applications are encouraged to only store
    -- pipeline keys instead, and aim to create pipeline binaries from key
    -- alone on subsequent runs of the application.
    PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryPrefersInternalCache :: Bool
  , -- | #limits-pipelineBinaryPrecompiledInternalCache#
    -- @pipelineBinaryPrecompiledInternalCache@ specifies that the
    -- implementation /may/ have pipeline binaries in its internal cache, which
    -- is populated without the application ever having generated that pipeline
    -- itself. Applications /can/ attempt to create binaries without extracting
    -- pipeline binary data from the pipeline prior for a set of pipeline keys,
    -- including from previous runs of the application.
    PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryPrecompiledInternalCache :: Bool
  , -- | #limits-pipelineBinaryCompressedData# @pipelineBinaryCompressedData@
    -- specifies that the binary data is already compressed and so applications
    -- /should/ not attempt to compress it.
    PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryCompressedData :: Bool
  }
  deriving (Typeable, PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
(PhysicalDevicePipelineBinaryPropertiesKHR
 -> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool)
-> (PhysicalDevicePipelineBinaryPropertiesKHR
    -> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool)
-> Eq PhysicalDevicePipelineBinaryPropertiesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
== :: PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
$c/= :: PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
/= :: PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePipelineBinaryPropertiesKHR)
#endif
deriving instance Show PhysicalDevicePipelineBinaryPropertiesKHR

instance ToCStruct PhysicalDevicePipelineBinaryPropertiesKHR where
  withCStruct :: forall b.
PhysicalDevicePipelineBinaryPropertiesKHR
-> (Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b) -> IO b
withCStruct PhysicalDevicePipelineBinaryPropertiesKHR
x Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b
f = Int
-> (Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p -> Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> IO b -> IO b
forall b.
Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p PhysicalDevicePipelineBinaryPropertiesKHR
x (Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b
f Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p)
  pokeCStruct :: forall b.
Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> PhysicalDevicePipelineBinaryPropertiesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p PhysicalDevicePipelineBinaryPropertiesKHR{Bool
pipelineBinaryInternalCache :: PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryInternalCacheControl :: PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryPrefersInternalCache :: PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryPrecompiledInternalCache :: PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryCompressedData :: PhysicalDevicePipelineBinaryPropertiesKHR -> Bool
pipelineBinaryInternalCache :: Bool
pipelineBinaryInternalCacheControl :: Bool
pipelineBinaryPrefersInternalCache :: Bool
pipelineBinaryPrecompiledInternalCache :: Bool
pipelineBinaryCompressedData :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> 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 PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaryInternalCache))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaryInternalCacheControl))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaryPrefersInternalCache))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaryPrecompiledInternalCache))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineBinaryCompressedData))
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> 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 PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> 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))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDevicePipelineBinaryPropertiesKHR where
  peekCStruct :: Ptr PhysicalDevicePipelineBinaryPropertiesKHR
-> IO PhysicalDevicePipelineBinaryPropertiesKHR
peekCStruct Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p = do
    pipelineBinaryInternalCache <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePipelineBinaryPropertiesKHR
p Ptr PhysicalDevicePipelineBinaryPropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pipelineBinaryInternalCacheControl <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    pipelineBinaryPrefersInternalCache <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    pipelineBinaryPrecompiledInternalCache <- peek @Bool32 ((p `plusPtr` 28 :: Ptr Bool32))
    pipelineBinaryCompressedData <- peek @Bool32 ((p `plusPtr` 32 :: Ptr Bool32))
    pure $ PhysicalDevicePipelineBinaryPropertiesKHR
             (bool32ToBool pipelineBinaryInternalCache)
             (bool32ToBool pipelineBinaryInternalCacheControl)
             (bool32ToBool pipelineBinaryPrefersInternalCache)
             (bool32ToBool pipelineBinaryPrecompiledInternalCache)
             (bool32ToBool pipelineBinaryCompressedData)

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

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


type KHR_PIPELINE_BINARY_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_PIPELINE_BINARY_SPEC_VERSION"
pattern KHR_PIPELINE_BINARY_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_PIPELINE_BINARY_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_PIPELINE_BINARY_SPEC_VERSION :: forall a. Integral a => a
KHR_PIPELINE_BINARY_SPEC_VERSION = 1


type KHR_PIPELINE_BINARY_EXTENSION_NAME = "VK_KHR_pipeline_binary"

-- No documentation found for TopLevel "VK_KHR_PIPELINE_BINARY_EXTENSION_NAME"
pattern KHR_PIPELINE_BINARY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_PIPELINE_BINARY_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_PIPELINE_BINARY_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_PIPELINE_BINARY_EXTENSION_NAME = "VK_KHR_pipeline_binary"