{-# language CPP #-}
-- | = Name
--
-- VK_EXT_validation_cache - device extension
--
-- == VK_EXT_validation_cache
--
-- [__Name String__]
--     @VK_EXT_validation_cache@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     161
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
-- [__Contact__]
--
--     -   Cort Stratton
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_EXT_validation_cache:%20&body=@cdwfs%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2017-08-29
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Cort Stratton, Google
--
--     -   Chris Forbes, Google
--
-- == Description
--
-- This extension provides a mechanism for caching the results of
-- potentially expensive internal validation operations across multiple
-- runs of a Vulkan application. At the core is the
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT' object type, which is
-- managed similarly to the existing 'Vulkan.Core10.Handles.PipelineCache'.
--
-- The new struct 'ShaderModuleValidationCacheCreateInfoEXT' can be
-- included in the @pNext@ chain at
-- 'Vulkan.Core10.Shader.createShaderModule' time. It contains a
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT' to use when validating
-- the 'Vulkan.Core10.Handles.ShaderModule'.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.ValidationCacheEXT'
--
-- == New Commands
--
-- -   'createValidationCacheEXT'
--
-- -   'destroyValidationCacheEXT'
--
-- -   'getValidationCacheDataEXT'
--
-- -   'mergeValidationCachesEXT'
--
-- == New Structures
--
-- -   'ValidationCacheCreateInfoEXT'
--
-- -   Extending 'Vulkan.Core10.Shader.ShaderModuleCreateInfo':
--
--     -   'ShaderModuleValidationCacheCreateInfoEXT'
--
-- == New Enums
--
-- -   'ValidationCacheHeaderVersionEXT'
--
-- == New Bitmasks
--
-- -   'ValidationCacheCreateFlagsEXT'
--
-- == New Enum Constants
--
-- -   'EXT_VALIDATION_CACHE_EXTENSION_NAME'
--
-- -   'EXT_VALIDATION_CACHE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_VALIDATION_CACHE_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT'
--
-- == Version History
--
-- -   Revision 1, 2017-08-29 (Cort Stratton)
--
--     -   Initial draft
--
-- = See Also
--
-- 'ShaderModuleValidationCacheCreateInfoEXT',
-- 'ValidationCacheCreateFlagsEXT', 'ValidationCacheCreateInfoEXT',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT',
-- 'ValidationCacheHeaderVersionEXT', 'createValidationCacheEXT',
-- 'destroyValidationCacheEXT', 'getValidationCacheDataEXT',
-- 'mergeValidationCachesEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_validation_cache Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_validation_cache  ( createValidationCacheEXT
                                                  , withValidationCacheEXT
                                                  , destroyValidationCacheEXT
                                                  , getValidationCacheDataEXT
                                                  , mergeValidationCachesEXT
                                                  , ValidationCacheCreateInfoEXT(..)
                                                  , ShaderModuleValidationCacheCreateInfoEXT(..)
                                                  , ValidationCacheCreateFlagsEXT(..)
                                                  , ValidationCacheHeaderVersionEXT( VALIDATION_CACHE_HEADER_VERSION_ONE_EXT
                                                                                   , ..
                                                                                   )
                                                  , EXT_VALIDATION_CACHE_SPEC_VERSION
                                                  , pattern EXT_VALIDATION_CACHE_SPEC_VERSION
                                                  , EXT_VALIDATION_CACHE_EXTENSION_NAME
                                                  , pattern EXT_VALIDATION_CACHE_EXTENSION_NAME
                                                  , ValidationCacheEXT(..)
                                                  ) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
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 GHC.Show (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
import Data.ByteString (packCStringLen)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Foreign.C.Types (CSize(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
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 Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Dynamic (DeviceCmds(pVkCreateValidationCacheEXT))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyValidationCacheEXT))
import Vulkan.Dynamic (DeviceCmds(pVkGetValidationCacheDataEXT))
import Vulkan.Dynamic (DeviceCmds(pVkMergeValidationCachesEXT))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Extensions.Handles (ValidationCacheEXT)
import Vulkan.Extensions.Handles (ValidationCacheEXT(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (ValidationCacheEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateValidationCacheEXT
  :: FunPtr (Ptr Device_T -> Ptr ValidationCacheCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr ValidationCacheEXT -> IO Result) -> Ptr Device_T -> Ptr ValidationCacheCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr ValidationCacheEXT -> IO Result

-- | vkCreateValidationCacheEXT - Creates a new validation cache
--
-- = Description
--
-- Note
--
-- Applications /can/ track and manage the total host memory size of a
-- validation cache object using the @pAllocator@. Applications /can/ limit
-- the amount of data retrieved from a validation cache object in
-- 'getValidationCacheDataEXT'. Implementations /should/ not internally
-- limit the total number of entries added to a validation cache object or
-- the total host memory consumed.
--
-- Once created, a validation cache /can/ be passed to the
-- 'Vulkan.Core10.Shader.createShaderModule' command by adding this object
-- to the 'Vulkan.Core10.Shader.ShaderModuleCreateInfo' structure’s @pNext@
-- chain. If a 'ShaderModuleValidationCacheCreateInfoEXT' object is
-- included in the 'Vulkan.Core10.Shader.ShaderModuleCreateInfo'::@pNext@
-- chain, and its @validationCache@ field is not
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE', the implementation will query
-- it for possible reuse opportunities and update it with new content. The
-- use of the validation cache object in these commands is internally
-- synchronized, and the same validation cache object /can/ be used in
-- multiple threads simultaneously.
--
-- Note
--
-- Implementations /should/ make every effort to limit any critical
-- sections to the actual accesses to the cache, which is expected to be
-- significantly shorter than the duration of the
-- 'Vulkan.Core10.Shader.createShaderModule' command.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateValidationCacheEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'ValidationCacheCreateInfoEXT' structure
--
-- -   #VUID-vkCreateValidationCacheEXT-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateValidationCacheEXT-pValidationCache-parameter#
--     @pValidationCache@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'ValidationCacheCreateInfoEXT',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT'
createValidationCacheEXT :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device that creates the validation cache object.
                            Device
                         -> -- | @pCreateInfo@ is a pointer to a 'ValidationCacheCreateInfoEXT' structure
                            -- containing the initial parameters for the validation cache object.
                            ValidationCacheCreateInfoEXT
                         -> -- | @pAllocator@ controls host memory allocation as described in the
                            -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                            -- chapter.
                            ("allocator" ::: Maybe AllocationCallbacks)
                         -> io (ValidationCacheEXT)
createValidationCacheEXT :: Device
-> ValidationCacheCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ValidationCacheEXT
createValidationCacheEXT device :: Device
device createInfo :: ValidationCacheCreateInfoEXT
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO ValidationCacheEXT -> io ValidationCacheEXT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ValidationCacheEXT -> io ValidationCacheEXT)
-> (ContT ValidationCacheEXT IO ValidationCacheEXT
    -> IO ValidationCacheEXT)
-> ContT ValidationCacheEXT IO ValidationCacheEXT
-> io ValidationCacheEXT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ValidationCacheEXT IO ValidationCacheEXT
-> IO ValidationCacheEXT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ValidationCacheEXT IO ValidationCacheEXT
 -> io ValidationCacheEXT)
-> ContT ValidationCacheEXT IO ValidationCacheEXT
-> io ValidationCacheEXT
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateValidationCacheEXTPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkCreateValidationCacheEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
      -> IO Result)
pVkCreateValidationCacheEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT ValidationCacheEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ValidationCacheEXT IO ())
-> IO () -> ContT ValidationCacheEXT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkCreateValidationCacheEXTPtr FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateValidationCacheEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateValidationCacheEXT' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
vkCreateValidationCacheEXT' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
mkVkCreateValidationCacheEXT FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkCreateValidationCacheEXTPtr
  "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
pCreateInfo <- ((("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
  -> IO ValidationCacheEXT)
 -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT
     IO
     ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
   -> IO ValidationCacheEXT)
  -> IO ValidationCacheEXT)
 -> ContT
      ValidationCacheEXT
      IO
      ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT))
-> ((("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
     -> IO ValidationCacheEXT)
    -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT
     IO
     ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
forall a b. (a -> b) -> a -> b
$ ValidationCacheCreateInfoEXT
-> (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
    -> IO ValidationCacheEXT)
-> IO ValidationCacheEXT
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ValidationCacheCreateInfoEXT
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
     ValidationCacheEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
  -> IO ValidationCacheEXT)
 -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ValidationCacheEXT)
  -> IO ValidationCacheEXT)
 -> ContT
      ValidationCacheEXT IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
     -> IO ValidationCacheEXT)
    -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
    -> IO ValidationCacheEXT)
-> IO ValidationCacheEXT
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pValidationCache" ::: Ptr ValidationCacheEXT
pPValidationCache <- ((("pValidationCache" ::: Ptr ValidationCacheEXT)
  -> IO ValidationCacheEXT)
 -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT
     IO
     ("pValidationCache" ::: Ptr ValidationCacheEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO ValidationCacheEXT)
  -> IO ValidationCacheEXT)
 -> ContT
      ValidationCacheEXT
      IO
      ("pValidationCache" ::: Ptr ValidationCacheEXT))
-> ((("pValidationCache" ::: Ptr ValidationCacheEXT)
     -> IO ValidationCacheEXT)
    -> IO ValidationCacheEXT)
-> ContT
     ValidationCacheEXT
     IO
     ("pValidationCache" ::: Ptr ValidationCacheEXT)
forall a b. (a -> b) -> a -> b
$ IO ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> (("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ())
-> (("pValidationCache" ::: Ptr ValidationCacheEXT)
    -> IO ValidationCacheEXT)
-> IO ValidationCacheEXT
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pValidationCache" ::: Ptr ValidationCacheEXT)
forall a. Int -> IO (Ptr a)
callocBytes @ValidationCacheEXT 8) ("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT ValidationCacheEXT IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ValidationCacheEXT IO Result)
-> IO Result -> ContT ValidationCacheEXT IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateValidationCacheEXT" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
vkCreateValidationCacheEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pValidationCache" ::: Ptr ValidationCacheEXT
pPValidationCache))
  IO () -> ContT ValidationCacheEXT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ValidationCacheEXT IO ())
-> IO () -> ContT ValidationCacheEXT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  ValidationCacheEXT
pValidationCache <- IO ValidationCacheEXT
-> ContT ValidationCacheEXT IO ValidationCacheEXT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ValidationCacheEXT
 -> ContT ValidationCacheEXT IO ValidationCacheEXT)
-> IO ValidationCacheEXT
-> ContT ValidationCacheEXT IO ValidationCacheEXT
forall a b. (a -> b) -> a -> b
$ ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO ValidationCacheEXT
forall a. Storable a => Ptr a -> IO a
peek @ValidationCacheEXT "pValidationCache" ::: Ptr ValidationCacheEXT
pPValidationCache
  ValidationCacheEXT
-> ContT ValidationCacheEXT IO ValidationCacheEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ValidationCacheEXT
 -> ContT ValidationCacheEXT IO ValidationCacheEXT)
-> ValidationCacheEXT
-> ContT ValidationCacheEXT IO ValidationCacheEXT
forall a b. (a -> b) -> a -> b
$ (ValidationCacheEXT
pValidationCache)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createValidationCacheEXT' and 'destroyValidationCacheEXT'
--
-- To ensure that 'destroyValidationCacheEXT' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withValidationCacheEXT :: forall io r . MonadIO io => Device -> ValidationCacheCreateInfoEXT -> Maybe AllocationCallbacks -> (io ValidationCacheEXT -> (ValidationCacheEXT -> io ()) -> r) -> r
withValidationCacheEXT :: Device
-> ValidationCacheCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io ValidationCacheEXT -> (ValidationCacheEXT -> io ()) -> r)
-> r
withValidationCacheEXT device :: Device
device pCreateInfo :: ValidationCacheCreateInfoEXT
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io ValidationCacheEXT -> (ValidationCacheEXT -> io ()) -> r
b =
  io ValidationCacheEXT -> (ValidationCacheEXT -> io ()) -> r
b (Device
-> ValidationCacheCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ValidationCacheEXT
forall (io :: * -> *).
MonadIO io =>
Device
-> ValidationCacheCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ValidationCacheEXT
createValidationCacheEXT Device
device ValidationCacheCreateInfoEXT
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(ValidationCacheEXT
o0) -> Device
-> ValidationCacheEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> ValidationCacheEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyValidationCacheEXT Device
device ValidationCacheEXT
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


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

-- | vkDestroyValidationCacheEXT - Destroy a validation cache object
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyValidationCacheEXT-validationCache-01537# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @validationCache@ was created, a compatible set of
--     callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyValidationCacheEXT-validationCache-01538# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @validationCache@ was created, @pAllocator@ /must/ be
--     @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyValidationCacheEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyValidationCacheEXT-validationCache-parameter# If
--     @validationCache@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @validationCache@ /must/ be a valid
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' handle
--
-- -   #VUID-vkDestroyValidationCacheEXT-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyValidationCacheEXT-validationCache-parent# If
--     @validationCache@ is a valid handle, it /must/ have been created,
--     allocated, or retrieved from @device@
--
-- == Host Synchronization
--
-- -   Host access to @validationCache@ /must/ be externally synchronized
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT'
destroyValidationCacheEXT :: forall io
                           . (MonadIO io)
                          => -- | @device@ is the logical device that destroys the validation cache
                             -- object.
                             Device
                          -> -- | @validationCache@ is the handle of the validation cache to destroy.
                             ValidationCacheEXT
                          -> -- | @pAllocator@ controls host memory allocation as described in the
                             -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                             -- chapter.
                             ("allocator" ::: Maybe AllocationCallbacks)
                          -> io ()
destroyValidationCacheEXT :: Device
-> ValidationCacheEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyValidationCacheEXT device :: Device
device validationCache :: ValidationCacheEXT
validationCache allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyValidationCacheEXTPtr :: FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyValidationCacheEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyValidationCacheEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyValidationCacheEXTPtr FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkDestroyValidationCacheEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyValidationCacheEXT' :: Ptr Device_T
-> ValidationCacheEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyValidationCacheEXT' = FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> ValidationCacheEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyValidationCacheEXT FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyValidationCacheEXTPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
 -> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkDestroyValidationCacheEXT" (Ptr Device_T
-> ValidationCacheEXT
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyValidationCacheEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) (ValidationCacheEXT
validationCache) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkGetValidationCacheDataEXT - Get the data store from a validation cache
--
-- = Description
--
-- If @pData@ is @NULL@, then the maximum size of the data that /can/ be
-- retrieved from the validation cache, in bytes, is returned in
-- @pDataSize@. Otherwise, @pDataSize@ /must/ point to a variable set by
-- the user to the size of the buffer, in bytes, pointed to by @pData@, and
-- on return the variable is overwritten with the amount of data actually
-- written to @pData@.
--
-- If @pDataSize@ is less than the maximum size that /can/ be retrieved by
-- the validation cache, at most @pDataSize@ bytes will be written to
-- @pData@, and 'getValidationCacheDataEXT' will return
-- 'Vulkan.Core10.Enums.Result.INCOMPLETE'. Any data written to @pData@ is
-- valid and /can/ be provided as the @pInitialData@ member of the
-- 'ValidationCacheCreateInfoEXT' structure passed to
-- 'createValidationCacheEXT'.
--
-- Two calls to 'getValidationCacheDataEXT' with the same parameters /must/
-- retrieve the same data unless a command that modifies the contents of
-- the cache is called between them.
--
-- Applications /can/ store the data retrieved from the validation cache,
-- and use these data, possibly in a future run of the application, to
-- populate new validation cache objects. The results of validation,
-- however, /may/ depend on the vendor ID, device ID, driver version, and
-- other details of the device. To enable applications to detect when
-- previously retrieved data is incompatible with the device, the initial
-- bytes written to @pData@ /must/ be a header consisting of the following
-- members:
--
-- +--------+----------------------------------------+--------------------------------------------------+
-- | Offset | Size                                   | Meaning                                          |
-- +========+========================================+==================================================+
-- | 0      | 4                                      | length in bytes of the entire validation cache   |
-- |        |                                        | header written as a stream of bytes, with the    |
-- |        |                                        | least significant byte first                     |
-- +--------+----------------------------------------+--------------------------------------------------+
-- | 4      | 4                                      | a 'ValidationCacheHeaderVersionEXT' value        |
-- |        |                                        | written as a stream of bytes, with the least     |
-- |        |                                        | significant byte first                           |
-- +--------+----------------------------------------+--------------------------------------------------+
-- | 8      | 'Vulkan.Core10.APIConstants.UUID_SIZE' | a layer commit ID expressed as a UUID, which     |
-- |        |                                        | uniquely identifies the version of the           |
-- |        |                                        | validation layers used to generate these         |
-- |        |                                        | validation results                               |
-- +--------+----------------------------------------+--------------------------------------------------+
--
-- Layout for validation cache header version
-- 'VALIDATION_CACHE_HEADER_VERSION_ONE_EXT'
--
-- The first four bytes encode the length of the entire validation cache
-- header, in bytes. This value includes all fields in the header including
-- the validation cache version field and the size of the length field.
--
-- The next four bytes encode the validation cache version, as described
-- for 'ValidationCacheHeaderVersionEXT'. A consumer of the validation
-- cache /should/ use the cache version to interpret the remainder of the
-- cache header.
--
-- If @pDataSize@ is less than what is necessary to store this header,
-- nothing will be written to @pData@ and zero will be written to
-- @pDataSize@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetValidationCacheDataEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetValidationCacheDataEXT-validationCache-parameter#
--     @validationCache@ /must/ be a valid
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' handle
--
-- -   #VUID-vkGetValidationCacheDataEXT-pDataSize-parameter# @pDataSize@
--     /must/ be a valid pointer to a @size_t@ value
--
-- -   #VUID-vkGetValidationCacheDataEXT-pData-parameter# If the value
--     referenced by @pDataSize@ is not @0@, and @pData@ is not @NULL@,
--     @pData@ /must/ be a valid pointer to an array of @pDataSize@ bytes
--
-- -   #VUID-vkGetValidationCacheDataEXT-validationCache-parent#
--     @validationCache@ /must/ have been created, allocated, or retrieved
--     from @device@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT'
getValidationCacheDataEXT :: forall io
                           . (MonadIO io)
                          => -- | @device@ is the logical device that owns the validation cache.
                             Device
                          -> -- | @validationCache@ is the validation cache to retrieve data from.
                             ValidationCacheEXT
                          -> io (Result, ("data" ::: ByteString))
getValidationCacheDataEXT :: Device -> ValidationCacheEXT -> io (Result, "data" ::: ByteString)
getValidationCacheDataEXT device :: Device
device validationCache :: ValidationCacheEXT
validationCache = IO (Result, "data" ::: ByteString)
-> io (Result, "data" ::: ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "data" ::: ByteString)
 -> io (Result, "data" ::: ByteString))
-> (ContT
      (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
    -> IO (Result, "data" ::: ByteString))
-> ContT
     (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
-> io (Result, "data" ::: ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
-> IO (Result, "data" ::: ByteString)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
 -> io (Result, "data" ::: ByteString))
-> ContT
     (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
-> io (Result, "data" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetValidationCacheDataEXTPtr :: FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
vkGetValidationCacheDataEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("pDataSize" ::: Ptr CSize)
      -> ("pData" ::: Ptr ())
      -> IO Result)
pVkGetValidationCacheDataEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "data" ::: ByteString) IO ())
-> IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
vkGetValidationCacheDataEXTPtr FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("pDataSize" ::: Ptr CSize)
      -> ("pData" ::: Ptr ())
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetValidationCacheDataEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetValidationCacheDataEXT' :: Ptr Device_T
-> ValidationCacheEXT
-> ("pDataSize" ::: Ptr CSize)
-> ("pData" ::: Ptr ())
-> IO Result
vkGetValidationCacheDataEXT' = FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
-> Ptr Device_T
-> ValidationCacheEXT
-> ("pDataSize" ::: Ptr CSize)
-> ("pData" ::: Ptr ())
-> IO Result
mkVkGetValidationCacheDataEXT FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("pDataSize" ::: Ptr CSize)
   -> ("pData" ::: Ptr ())
   -> IO Result)
vkGetValidationCacheDataEXTPtr
  let device' :: Ptr Device_T
device' = Device -> Ptr Device_T
deviceHandle (Device
device)
  "pDataSize" ::: Ptr CSize
pPDataSize <- ((("pDataSize" ::: Ptr CSize)
  -> IO (Result, "data" ::: ByteString))
 -> IO (Result, "data" ::: ByteString))
-> ContT
     (Result, "data" ::: ByteString) IO ("pDataSize" ::: Ptr CSize)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pDataSize" ::: Ptr CSize)
   -> IO (Result, "data" ::: ByteString))
  -> IO (Result, "data" ::: ByteString))
 -> ContT
      (Result, "data" ::: ByteString) IO ("pDataSize" ::: Ptr CSize))
-> ((("pDataSize" ::: Ptr CSize)
     -> IO (Result, "data" ::: ByteString))
    -> IO (Result, "data" ::: ByteString))
-> ContT
     (Result, "data" ::: ByteString) IO ("pDataSize" ::: Ptr CSize)
forall a b. (a -> b) -> a -> b
$ IO ("pDataSize" ::: Ptr CSize)
-> (("pDataSize" ::: Ptr CSize) -> IO ())
-> (("pDataSize" ::: Ptr CSize)
    -> IO (Result, "data" ::: ByteString))
-> IO (Result, "data" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pDataSize" ::: Ptr CSize)
forall a. Int -> IO (Ptr a)
callocBytes @CSize 8) ("pDataSize" ::: Ptr CSize) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT (Result, "data" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, "data" ::: ByteString) IO Result)
-> IO Result -> ContT (Result, "data" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetValidationCacheDataEXT" (Ptr Device_T
-> ValidationCacheEXT
-> ("pDataSize" ::: Ptr CSize)
-> ("pData" ::: Ptr ())
-> IO Result
vkGetValidationCacheDataEXT' Ptr Device_T
device' (ValidationCacheEXT
validationCache) ("pDataSize" ::: Ptr CSize
pPDataSize) ("pData" ::: Ptr ()
forall a. Ptr a
nullPtr))
  IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "data" ::: ByteString) IO ())
-> IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  CSize
pDataSize <- IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize)
-> IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize
forall a b. (a -> b) -> a -> b
$ ("pDataSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize "pDataSize" ::: Ptr CSize
pPDataSize
  "pData" ::: Ptr ()
pPData <- ((("pData" ::: Ptr ()) -> IO (Result, "data" ::: ByteString))
 -> IO (Result, "data" ::: ByteString))
-> ContT (Result, "data" ::: ByteString) IO ("pData" ::: Ptr ())
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pData" ::: Ptr ()) -> IO (Result, "data" ::: ByteString))
  -> IO (Result, "data" ::: ByteString))
 -> ContT (Result, "data" ::: ByteString) IO ("pData" ::: Ptr ()))
-> ((("pData" ::: Ptr ()) -> IO (Result, "data" ::: ByteString))
    -> IO (Result, "data" ::: ByteString))
-> ContT (Result, "data" ::: ByteString) IO ("pData" ::: Ptr ())
forall a b. (a -> b) -> a -> b
$ IO ("pData" ::: Ptr ())
-> (("pData" ::: Ptr ()) -> IO ())
-> (("pData" ::: Ptr ()) -> IO (Result, "data" ::: ByteString))
-> IO (Result, "data" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pData" ::: Ptr ())
forall a. Int -> IO (Ptr a)
callocBytes @(()) (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (((\(CSize a :: Word64
a) -> Word64
a) CSize
pDataSize)))) ("pData" ::: Ptr ()) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r' <- IO Result -> ContT (Result, "data" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, "data" ::: ByteString) IO Result)
-> IO Result -> ContT (Result, "data" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetValidationCacheDataEXT" (Ptr Device_T
-> ValidationCacheEXT
-> ("pDataSize" ::: Ptr CSize)
-> ("pData" ::: Ptr ())
-> IO Result
vkGetValidationCacheDataEXT' Ptr Device_T
device' (ValidationCacheEXT
validationCache) ("pDataSize" ::: Ptr CSize
pPDataSize) ("pData" ::: Ptr ()
pPData))
  IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "data" ::: ByteString) IO ())
-> IO () -> ContT (Result, "data" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  CSize
pDataSize'' <- IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize)
-> IO CSize -> ContT (Result, "data" ::: ByteString) IO CSize
forall a b. (a -> b) -> a -> b
$ ("pDataSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize "pDataSize" ::: Ptr CSize
pPDataSize
  "data" ::: ByteString
pData' <- IO ("data" ::: ByteString)
-> ContT (Result, "data" ::: ByteString) IO ("data" ::: ByteString)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("data" ::: ByteString)
 -> ContT
      (Result, "data" ::: ByteString) IO ("data" ::: ByteString))
-> IO ("data" ::: ByteString)
-> ContT (Result, "data" ::: ByteString) IO ("data" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ CStringLen -> IO ("data" ::: ByteString)
packCStringLen  (("pData" ::: Ptr ()) -> Ptr CChar
forall a b. Ptr a -> Ptr b
castPtr @() @CChar "pData" ::: Ptr ()
pPData, (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (((\(CSize a :: Word64
a) -> Word64
a) CSize
pDataSize''))))
  (Result, "data" ::: ByteString)
-> ContT
     (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "data" ::: ByteString)
 -> ContT
      (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString))
-> (Result, "data" ::: ByteString)
-> ContT
     (Result, "data" ::: ByteString) IO (Result, "data" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ((Result
r'), "data" ::: ByteString
pData')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkMergeValidationCachesEXT
  :: FunPtr (Ptr Device_T -> ValidationCacheEXT -> Word32 -> Ptr ValidationCacheEXT -> IO Result) -> Ptr Device_T -> ValidationCacheEXT -> Word32 -> Ptr ValidationCacheEXT -> IO Result

-- | vkMergeValidationCachesEXT - Combine the data stores of validation
-- caches
--
-- = Description
--
-- Note
--
-- The details of the merge operation are implementation dependent, but
-- implementations /should/ merge the contents of the specified validation
-- caches and prune duplicate entries.
--
-- == Valid Usage
--
-- -   #VUID-vkMergeValidationCachesEXT-dstCache-01536# @dstCache@ /must/
--     not appear in the list of source caches
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkMergeValidationCachesEXT-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkMergeValidationCachesEXT-dstCache-parameter# @dstCache@
--     /must/ be a valid 'Vulkan.Extensions.Handles.ValidationCacheEXT'
--     handle
--
-- -   #VUID-vkMergeValidationCachesEXT-pSrcCaches-parameter# @pSrcCaches@
--     /must/ be a valid pointer to an array of @srcCacheCount@ valid
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' handles
--
-- -   #VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength#
--     @srcCacheCount@ /must/ be greater than @0@
--
-- -   #VUID-vkMergeValidationCachesEXT-dstCache-parent# @dstCache@ /must/
--     have been created, allocated, or retrieved from @device@
--
-- -   #VUID-vkMergeValidationCachesEXT-pSrcCaches-parent# Each element of
--     @pSrcCaches@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @dstCache@ /must/ be externally synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT'
mergeValidationCachesEXT :: forall io
                          . (MonadIO io)
                         => -- | @device@ is the logical device that owns the validation cache objects.
                            Device
                         -> -- | @dstCache@ is the handle of the validation cache to merge results into.
                            ("dstCache" ::: ValidationCacheEXT)
                         -> -- | @pSrcCaches@ is a pointer to an array of validation cache handles, which
                            -- will be merged into @dstCache@. The previous contents of @dstCache@ are
                            -- included after the merge.
                            ("srcCaches" ::: Vector ValidationCacheEXT)
                         -> io ()
mergeValidationCachesEXT :: Device
-> ValidationCacheEXT
-> ("srcCaches" ::: Vector ValidationCacheEXT)
-> io ()
mergeValidationCachesEXT device :: Device
device dstCache :: ValidationCacheEXT
dstCache srcCaches :: "srcCaches" ::: Vector ValidationCacheEXT
srcCaches = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkMergeValidationCachesEXTPtr :: FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkMergeValidationCachesEXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("srcCacheCount" ::: Word32)
      -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
      -> IO Result)
pVkMergeValidationCachesEXT (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkMergeValidationCachesEXTPtr FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ValidationCacheEXT
      -> ("srcCacheCount" ::: Word32)
      -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkMergeValidationCachesEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkMergeValidationCachesEXT' :: Ptr Device_T
-> ValidationCacheEXT
-> ("srcCacheCount" ::: Word32)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
vkMergeValidationCachesEXT' = FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
-> Ptr Device_T
-> ValidationCacheEXT
-> ("srcCacheCount" ::: Word32)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
mkVkMergeValidationCachesEXT FunPtr
  (Ptr Device_T
   -> ValidationCacheEXT
   -> ("srcCacheCount" ::: Word32)
   -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
   -> IO Result)
vkMergeValidationCachesEXTPtr
  "pValidationCache" ::: Ptr ValidationCacheEXT
pPSrcCaches <- ((("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ())
 -> IO ())
-> ContT () IO ("pValidationCache" ::: Ptr ValidationCacheEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ())
  -> IO ())
 -> ContT () IO ("pValidationCache" ::: Ptr ValidationCacheEXT))
-> ((("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ())
    -> IO ())
-> ContT () IO ("pValidationCache" ::: Ptr ValidationCacheEXT)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pValidationCache" ::: Ptr ValidationCacheEXT) -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ValidationCacheEXT ((("srcCaches" ::: Vector ValidationCacheEXT) -> Int
forall a. Vector a -> Int
Data.Vector.length ("srcCaches" ::: Vector ValidationCacheEXT
srcCaches)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ValidationCacheEXT -> IO ())
-> ("srcCaches" ::: Vector ValidationCacheEXT) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ValidationCacheEXT
e -> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> ValidationCacheEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pValidationCache" ::: Ptr ValidationCacheEXT
pPSrcCaches ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> Int -> "pValidationCache" ::: Ptr ValidationCacheEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ValidationCacheEXT) (ValidationCacheEXT
e)) ("srcCaches" ::: Vector ValidationCacheEXT
srcCaches)
  Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkMergeValidationCachesEXT" (Ptr Device_T
-> ValidationCacheEXT
-> ("srcCacheCount" ::: Word32)
-> ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO Result
vkMergeValidationCachesEXT' (Device -> Ptr Device_T
deviceHandle (Device
device)) (ValidationCacheEXT
dstCache) ((Int -> "srcCacheCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("srcCaches" ::: Vector ValidationCacheEXT) -> Int
forall a. Vector a -> Int
Data.Vector.length (("srcCaches" ::: Vector ValidationCacheEXT) -> Int)
-> ("srcCaches" ::: Vector ValidationCacheEXT) -> Int
forall a b. (a -> b) -> a -> b
$ ("srcCaches" ::: Vector ValidationCacheEXT
srcCaches)) :: Word32)) ("pValidationCache" ::: Ptr ValidationCacheEXT
pPSrcCaches))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


-- | VkValidationCacheCreateInfoEXT - Structure specifying parameters of a
-- newly created validation cache
--
-- == Valid Usage
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01534# If
--     @initialDataSize@ is not @0@, it /must/ be equal to the size of
--     @pInitialData@, as returned by 'getValidationCacheDataEXT' when
--     @pInitialData@ was originally retrieved
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-initialDataSize-01535# If
--     @initialDataSize@ is not @0@, @pInitialData@ /must/ have been
--     retrieved from a previous call to 'getValidationCacheDataEXT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT'
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask# @flags@
--     /must/ be @0@
--
-- -   #VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter# If
--     @initialDataSize@ is not @0@, @pInitialData@ /must/ be a valid
--     pointer to an array of @initialDataSize@ bytes
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'ValidationCacheCreateFlagsEXT', 'createValidationCacheEXT'
data ValidationCacheCreateInfoEXT = ValidationCacheCreateInfoEXT
  { -- | @flags@ is reserved for future use.
    ValidationCacheCreateInfoEXT -> ValidationCacheCreateFlagsEXT
flags :: ValidationCacheCreateFlagsEXT
  , -- | @initialDataSize@ is the number of bytes in @pInitialData@. If
    -- @initialDataSize@ is zero, the validation cache will initially be empty.
    ValidationCacheCreateInfoEXT -> Word64
initialDataSize :: Word64
  , -- | @pInitialData@ is a pointer to previously retrieved validation cache
    -- data. If the validation cache data is incompatible (as defined below)
    -- with the device, the validation cache will be initially empty. If
    -- @initialDataSize@ is zero, @pInitialData@ is ignored.
    ValidationCacheCreateInfoEXT -> "pData" ::: Ptr ()
initialData :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ValidationCacheCreateInfoEXT)
#endif
deriving instance Show ValidationCacheCreateInfoEXT

instance ToCStruct ValidationCacheCreateInfoEXT where
  withCStruct :: ValidationCacheCreateInfoEXT
-> (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b)
-> IO b
withCStruct x :: ValidationCacheCreateInfoEXT
x f :: ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p -> ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> ValidationCacheCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ValidationCacheCreateInfoEXT
x (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT) -> IO b
f "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> ValidationCacheCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ValidationCacheCreateInfoEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT)
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ValidationCacheCreateFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ValidationCacheCreateFlagsEXT)) (ValidationCacheCreateFlagsEXT
flags)
    ("pDataSize" ::: Ptr CSize) -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> "pDataSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
initialDataSize))
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
initialData)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT)
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ValidationCacheCreateInfoEXT where
  peekCStruct :: ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> IO ValidationCacheCreateInfoEXT
peekCStruct p :: "pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p = do
    ValidationCacheCreateFlagsEXT
flags <- Ptr ValidationCacheCreateFlagsEXT
-> IO ValidationCacheCreateFlagsEXT
forall a. Storable a => Ptr a -> IO a
peek @ValidationCacheCreateFlagsEXT (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ValidationCacheCreateFlagsEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ValidationCacheCreateFlagsEXT))
    CSize
initialDataSize <- ("pDataSize" ::: Ptr CSize) -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> "pDataSize" ::: Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize))
    "pData" ::: Ptr ()
pInitialData <- Ptr ("pData" ::: Ptr ()) -> IO ("pData" ::: Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) (("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT
p ("pCreateInfo" ::: Ptr ValidationCacheCreateInfoEXT)
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr ())))
    ValidationCacheCreateInfoEXT -> IO ValidationCacheCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ValidationCacheCreateInfoEXT -> IO ValidationCacheCreateInfoEXT)
-> ValidationCacheCreateInfoEXT -> IO ValidationCacheCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ ValidationCacheCreateFlagsEXT
-> Word64 -> ("pData" ::: Ptr ()) -> ValidationCacheCreateInfoEXT
ValidationCacheCreateInfoEXT
             ValidationCacheCreateFlagsEXT
flags ((\(CSize a :: Word64
a) -> Word64
a) CSize
initialDataSize) "pData" ::: Ptr ()
pInitialData

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

instance Zero ValidationCacheCreateInfoEXT where
  zero :: ValidationCacheCreateInfoEXT
zero = ValidationCacheCreateFlagsEXT
-> Word64 -> ("pData" ::: Ptr ()) -> ValidationCacheCreateInfoEXT
ValidationCacheCreateInfoEXT
           ValidationCacheCreateFlagsEXT
forall a. Zero a => a
zero
           Word64
forall a. Zero a => a
zero
           "pData" ::: Ptr ()
forall a. Zero a => a
zero


-- | VkShaderModuleValidationCacheCreateInfoEXT - Specify validation cache to
-- use during shader module creation
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.ValidationCacheEXT'
data ShaderModuleValidationCacheCreateInfoEXT = ShaderModuleValidationCacheCreateInfoEXT
  { -- | @validationCache@ is the validation cache object from which the results
    -- of prior validation attempts will be written, and to which new
    -- validation results for this 'Vulkan.Core10.Handles.ShaderModule' will be
    -- written (if not already present).
    --
    -- #VUID-VkShaderModuleValidationCacheCreateInfoEXT-validationCache-parameter#
    -- @validationCache@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.ValidationCacheEXT' handle
    ShaderModuleValidationCacheCreateInfoEXT -> ValidationCacheEXT
validationCache :: ValidationCacheEXT }
  deriving (Typeable, ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> Bool
(ShaderModuleValidationCacheCreateInfoEXT
 -> ShaderModuleValidationCacheCreateInfoEXT -> Bool)
-> (ShaderModuleValidationCacheCreateInfoEXT
    -> ShaderModuleValidationCacheCreateInfoEXT -> Bool)
-> Eq ShaderModuleValidationCacheCreateInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> Bool
$c/= :: ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> Bool
== :: ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> Bool
$c== :: ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ShaderModuleValidationCacheCreateInfoEXT)
#endif
deriving instance Show ShaderModuleValidationCacheCreateInfoEXT

instance ToCStruct ShaderModuleValidationCacheCreateInfoEXT where
  withCStruct :: ShaderModuleValidationCacheCreateInfoEXT
-> (Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b) -> IO b
withCStruct x :: ShaderModuleValidationCacheCreateInfoEXT
x f :: Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b
f = Int
-> Int
-> (Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b) -> IO b)
-> (Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ShaderModuleValidationCacheCreateInfoEXT
p -> Ptr ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ShaderModuleValidationCacheCreateInfoEXT
p ShaderModuleValidationCacheCreateInfoEXT
x (Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b
f Ptr ShaderModuleValidationCacheCreateInfoEXT
p)
  pokeCStruct :: Ptr ShaderModuleValidationCacheCreateInfoEXT
-> ShaderModuleValidationCacheCreateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr ShaderModuleValidationCacheCreateInfoEXT
p ShaderModuleValidationCacheCreateInfoEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT)
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> ValidationCacheEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> "pValidationCache" ::: Ptr ValidationCacheEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ValidationCacheEXT)) (ValidationCacheEXT
validationCache)
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr ShaderModuleValidationCacheCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ShaderModuleValidationCacheCreateInfoEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT)
    Ptr ("pData" ::: Ptr ()) -> ("pData" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> Ptr ("pData" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("pData" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> ValidationCacheEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> "pValidationCache" ::: Ptr ValidationCacheEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ValidationCacheEXT)) (ValidationCacheEXT
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ShaderModuleValidationCacheCreateInfoEXT where
  peekCStruct :: Ptr ShaderModuleValidationCacheCreateInfoEXT
-> IO ShaderModuleValidationCacheCreateInfoEXT
peekCStruct p :: Ptr ShaderModuleValidationCacheCreateInfoEXT
p = do
    ValidationCacheEXT
validationCache <- ("pValidationCache" ::: Ptr ValidationCacheEXT)
-> IO ValidationCacheEXT
forall a. Storable a => Ptr a -> IO a
peek @ValidationCacheEXT ((Ptr ShaderModuleValidationCacheCreateInfoEXT
p Ptr ShaderModuleValidationCacheCreateInfoEXT
-> Int -> "pValidationCache" ::: Ptr ValidationCacheEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ValidationCacheEXT))
    ShaderModuleValidationCacheCreateInfoEXT
-> IO ShaderModuleValidationCacheCreateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ShaderModuleValidationCacheCreateInfoEXT
 -> IO ShaderModuleValidationCacheCreateInfoEXT)
-> ShaderModuleValidationCacheCreateInfoEXT
-> IO ShaderModuleValidationCacheCreateInfoEXT
forall a b. (a -> b) -> a -> b
$ ValidationCacheEXT -> ShaderModuleValidationCacheCreateInfoEXT
ShaderModuleValidationCacheCreateInfoEXT
             ValidationCacheEXT
validationCache

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

instance Zero ShaderModuleValidationCacheCreateInfoEXT where
  zero :: ShaderModuleValidationCacheCreateInfoEXT
zero = ValidationCacheEXT -> ShaderModuleValidationCacheCreateInfoEXT
ShaderModuleValidationCacheCreateInfoEXT
           ValidationCacheEXT
forall a. Zero a => a
zero


-- | VkValidationCacheCreateFlagsEXT - Reserved for future use
--
-- = Description
--
-- 'ValidationCacheCreateFlagsEXT' is a bitmask type for setting a mask,
-- but is currently reserved for future use.
--
-- = See Also
--
-- 'ValidationCacheCreateInfoEXT'
newtype ValidationCacheCreateFlagsEXT = ValidationCacheCreateFlagsEXT Flags
  deriving newtype (ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
(ValidationCacheCreateFlagsEXT
 -> ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> Bool)
-> Eq ValidationCacheCreateFlagsEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c/= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
== :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c== :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
Eq, Eq ValidationCacheCreateFlagsEXT
Eq ValidationCacheCreateFlagsEXT =>
(ValidationCacheCreateFlagsEXT
 -> ValidationCacheCreateFlagsEXT -> Ordering)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> Ord ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Ordering
ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$cmin :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
max :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$cmax :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
>= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c>= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
> :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c> :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
<= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c<= :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
< :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
$c< :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Bool
compare :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Ordering
$ccompare :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> Ordering
$cp1Ord :: Eq ValidationCacheCreateFlagsEXT
Ord, Ptr b -> Int -> IO ValidationCacheCreateFlagsEXT
Ptr b -> Int -> ValidationCacheCreateFlagsEXT -> IO ()
Ptr ValidationCacheCreateFlagsEXT
-> IO ValidationCacheCreateFlagsEXT
Ptr ValidationCacheCreateFlagsEXT
-> Int -> IO ValidationCacheCreateFlagsEXT
Ptr ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT -> IO ()
Ptr ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> IO ()
ValidationCacheCreateFlagsEXT -> Int
(ValidationCacheCreateFlagsEXT -> Int)
-> (ValidationCacheCreateFlagsEXT -> Int)
-> (Ptr ValidationCacheCreateFlagsEXT
    -> Int -> IO ValidationCacheCreateFlagsEXT)
-> (Ptr ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO ValidationCacheCreateFlagsEXT)
-> (forall b.
    Ptr b -> Int -> ValidationCacheCreateFlagsEXT -> IO ())
-> (Ptr ValidationCacheCreateFlagsEXT
    -> IO ValidationCacheCreateFlagsEXT)
-> (Ptr ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> IO ())
-> Storable ValidationCacheCreateFlagsEXT
forall b. Ptr b -> Int -> IO ValidationCacheCreateFlagsEXT
forall b. Ptr b -> Int -> ValidationCacheCreateFlagsEXT -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> IO ()
$cpoke :: Ptr ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> IO ()
peek :: Ptr ValidationCacheCreateFlagsEXT
-> IO ValidationCacheCreateFlagsEXT
$cpeek :: Ptr ValidationCacheCreateFlagsEXT
-> IO ValidationCacheCreateFlagsEXT
pokeByteOff :: Ptr b -> Int -> ValidationCacheCreateFlagsEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ValidationCacheCreateFlagsEXT -> IO ()
peekByteOff :: Ptr b -> Int -> IO ValidationCacheCreateFlagsEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ValidationCacheCreateFlagsEXT
pokeElemOff :: Ptr ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT -> IO ()
$cpokeElemOff :: Ptr ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT -> IO ()
peekElemOff :: Ptr ValidationCacheCreateFlagsEXT
-> Int -> IO ValidationCacheCreateFlagsEXT
$cpeekElemOff :: Ptr ValidationCacheCreateFlagsEXT
-> Int -> IO ValidationCacheCreateFlagsEXT
alignment :: ValidationCacheCreateFlagsEXT -> Int
$calignment :: ValidationCacheCreateFlagsEXT -> Int
sizeOf :: ValidationCacheCreateFlagsEXT -> Int
$csizeOf :: ValidationCacheCreateFlagsEXT -> Int
Storable, ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT -> Zero ValidationCacheCreateFlagsEXT
forall a. a -> Zero a
zero :: ValidationCacheCreateFlagsEXT
$czero :: ValidationCacheCreateFlagsEXT
Zero, Eq ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT
Eq ValidationCacheCreateFlagsEXT =>
(ValidationCacheCreateFlagsEXT
 -> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> ValidationCacheCreateFlagsEXT
-> (Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT -> Int -> Bool)
-> (ValidationCacheCreateFlagsEXT -> Maybe Int)
-> (ValidationCacheCreateFlagsEXT -> Int)
-> (ValidationCacheCreateFlagsEXT -> Bool)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT
    -> Int -> ValidationCacheCreateFlagsEXT)
-> (ValidationCacheCreateFlagsEXT -> Int)
-> Bits ValidationCacheCreateFlagsEXT
Int -> ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT -> Bool
ValidationCacheCreateFlagsEXT -> Int
ValidationCacheCreateFlagsEXT -> Maybe Int
ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT -> Int -> Bool
ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: ValidationCacheCreateFlagsEXT -> Int
$cpopCount :: ValidationCacheCreateFlagsEXT -> Int
rotateR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$crotateR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
rotateL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$crotateL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
unsafeShiftR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cunsafeShiftR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
shiftR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cshiftR :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
unsafeShiftL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cunsafeShiftL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
shiftL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cshiftL :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
isSigned :: ValidationCacheCreateFlagsEXT -> Bool
$cisSigned :: ValidationCacheCreateFlagsEXT -> Bool
bitSize :: ValidationCacheCreateFlagsEXT -> Int
$cbitSize :: ValidationCacheCreateFlagsEXT -> Int
bitSizeMaybe :: ValidationCacheCreateFlagsEXT -> Maybe Int
$cbitSizeMaybe :: ValidationCacheCreateFlagsEXT -> Maybe Int
testBit :: ValidationCacheCreateFlagsEXT -> Int -> Bool
$ctestBit :: ValidationCacheCreateFlagsEXT -> Int -> Bool
complementBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$ccomplementBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
clearBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cclearBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
setBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$csetBit :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
bit :: Int -> ValidationCacheCreateFlagsEXT
$cbit :: Int -> ValidationCacheCreateFlagsEXT
zeroBits :: ValidationCacheCreateFlagsEXT
$czeroBits :: ValidationCacheCreateFlagsEXT
rotate :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$crotate :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
shift :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
$cshift :: ValidationCacheCreateFlagsEXT
-> Int -> ValidationCacheCreateFlagsEXT
complement :: ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$ccomplement :: ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
xor :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$cxor :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
.|. :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$c.|. :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
.&. :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$c.&. :: ValidationCacheCreateFlagsEXT
-> ValidationCacheCreateFlagsEXT -> ValidationCacheCreateFlagsEXT
$cp1Bits :: Eq ValidationCacheCreateFlagsEXT
Bits, Bits ValidationCacheCreateFlagsEXT
Bits ValidationCacheCreateFlagsEXT =>
(ValidationCacheCreateFlagsEXT -> Int)
-> (ValidationCacheCreateFlagsEXT -> Int)
-> (ValidationCacheCreateFlagsEXT -> Int)
-> FiniteBits ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: ValidationCacheCreateFlagsEXT -> Int
$ccountTrailingZeros :: ValidationCacheCreateFlagsEXT -> Int
countLeadingZeros :: ValidationCacheCreateFlagsEXT -> Int
$ccountLeadingZeros :: ValidationCacheCreateFlagsEXT -> Int
finiteBitSize :: ValidationCacheCreateFlagsEXT -> Int
$cfiniteBitSize :: ValidationCacheCreateFlagsEXT -> Int
$cp1FiniteBits :: Bits ValidationCacheCreateFlagsEXT
FiniteBits)



conNameValidationCacheCreateFlagsEXT :: String
conNameValidationCacheCreateFlagsEXT :: String
conNameValidationCacheCreateFlagsEXT = "ValidationCacheCreateFlagsEXT"

enumPrefixValidationCacheCreateFlagsEXT :: String
enumPrefixValidationCacheCreateFlagsEXT :: String
enumPrefixValidationCacheCreateFlagsEXT = ""

showTableValidationCacheCreateFlagsEXT :: [(ValidationCacheCreateFlagsEXT, String)]
showTableValidationCacheCreateFlagsEXT :: [(ValidationCacheCreateFlagsEXT, String)]
showTableValidationCacheCreateFlagsEXT = []

instance Show ValidationCacheCreateFlagsEXT where
  showsPrec :: Int -> ValidationCacheCreateFlagsEXT -> ShowS
showsPrec = String
-> [(ValidationCacheCreateFlagsEXT, String)]
-> String
-> (ValidationCacheCreateFlagsEXT -> "srcCacheCount" ::: Word32)
-> (("srcCacheCount" ::: Word32) -> ShowS)
-> Int
-> ValidationCacheCreateFlagsEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixValidationCacheCreateFlagsEXT
                            [(ValidationCacheCreateFlagsEXT, String)]
showTableValidationCacheCreateFlagsEXT
                            String
conNameValidationCacheCreateFlagsEXT
                            (\(ValidationCacheCreateFlagsEXT x :: "srcCacheCount" ::: Word32
x) -> "srcCacheCount" ::: Word32
x)
                            (\x :: "srcCacheCount" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("srcCacheCount" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "srcCacheCount" ::: Word32
x)

instance Read ValidationCacheCreateFlagsEXT where
  readPrec :: ReadPrec ValidationCacheCreateFlagsEXT
readPrec = String
-> [(ValidationCacheCreateFlagsEXT, String)]
-> String
-> (("srcCacheCount" ::: Word32) -> ValidationCacheCreateFlagsEXT)
-> ReadPrec ValidationCacheCreateFlagsEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixValidationCacheCreateFlagsEXT
                          [(ValidationCacheCreateFlagsEXT, String)]
showTableValidationCacheCreateFlagsEXT
                          String
conNameValidationCacheCreateFlagsEXT
                          ("srcCacheCount" ::: Word32) -> ValidationCacheCreateFlagsEXT
ValidationCacheCreateFlagsEXT


-- | VkValidationCacheHeaderVersionEXT - Encode validation cache version
--
-- = See Also
--
-- 'createValidationCacheEXT', 'getValidationCacheDataEXT'
newtype ValidationCacheHeaderVersionEXT = ValidationCacheHeaderVersionEXT Int32
  deriving newtype (ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
(ValidationCacheHeaderVersionEXT
 -> ValidationCacheHeaderVersionEXT -> Bool)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> Bool)
-> Eq ValidationCacheHeaderVersionEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c/= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
== :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c== :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
Eq, Eq ValidationCacheHeaderVersionEXT
Eq ValidationCacheHeaderVersionEXT =>
(ValidationCacheHeaderVersionEXT
 -> ValidationCacheHeaderVersionEXT -> Ordering)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> Bool)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> Bool)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> Bool)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> Bool)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT)
-> (ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT)
-> Ord ValidationCacheHeaderVersionEXT
ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Ordering
ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
$cmin :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
max :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
$cmax :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT
>= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c>= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
> :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c> :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
<= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c<= :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
< :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
$c< :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Bool
compare :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Ordering
$ccompare :: ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> Ordering
$cp1Ord :: Eq ValidationCacheHeaderVersionEXT
Ord, Ptr b -> Int -> IO ValidationCacheHeaderVersionEXT
Ptr b -> Int -> ValidationCacheHeaderVersionEXT -> IO ()
Ptr ValidationCacheHeaderVersionEXT
-> IO ValidationCacheHeaderVersionEXT
Ptr ValidationCacheHeaderVersionEXT
-> Int -> IO ValidationCacheHeaderVersionEXT
Ptr ValidationCacheHeaderVersionEXT
-> Int -> ValidationCacheHeaderVersionEXT -> IO ()
Ptr ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> IO ()
ValidationCacheHeaderVersionEXT -> Int
(ValidationCacheHeaderVersionEXT -> Int)
-> (ValidationCacheHeaderVersionEXT -> Int)
-> (Ptr ValidationCacheHeaderVersionEXT
    -> Int -> IO ValidationCacheHeaderVersionEXT)
-> (Ptr ValidationCacheHeaderVersionEXT
    -> Int -> ValidationCacheHeaderVersionEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO ValidationCacheHeaderVersionEXT)
-> (forall b.
    Ptr b -> Int -> ValidationCacheHeaderVersionEXT -> IO ())
-> (Ptr ValidationCacheHeaderVersionEXT
    -> IO ValidationCacheHeaderVersionEXT)
-> (Ptr ValidationCacheHeaderVersionEXT
    -> ValidationCacheHeaderVersionEXT -> IO ())
-> Storable ValidationCacheHeaderVersionEXT
forall b. Ptr b -> Int -> IO ValidationCacheHeaderVersionEXT
forall b. Ptr b -> Int -> ValidationCacheHeaderVersionEXT -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> IO ()
$cpoke :: Ptr ValidationCacheHeaderVersionEXT
-> ValidationCacheHeaderVersionEXT -> IO ()
peek :: Ptr ValidationCacheHeaderVersionEXT
-> IO ValidationCacheHeaderVersionEXT
$cpeek :: Ptr ValidationCacheHeaderVersionEXT
-> IO ValidationCacheHeaderVersionEXT
pokeByteOff :: Ptr b -> Int -> ValidationCacheHeaderVersionEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ValidationCacheHeaderVersionEXT -> IO ()
peekByteOff :: Ptr b -> Int -> IO ValidationCacheHeaderVersionEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ValidationCacheHeaderVersionEXT
pokeElemOff :: Ptr ValidationCacheHeaderVersionEXT
-> Int -> ValidationCacheHeaderVersionEXT -> IO ()
$cpokeElemOff :: Ptr ValidationCacheHeaderVersionEXT
-> Int -> ValidationCacheHeaderVersionEXT -> IO ()
peekElemOff :: Ptr ValidationCacheHeaderVersionEXT
-> Int -> IO ValidationCacheHeaderVersionEXT
$cpeekElemOff :: Ptr ValidationCacheHeaderVersionEXT
-> Int -> IO ValidationCacheHeaderVersionEXT
alignment :: ValidationCacheHeaderVersionEXT -> Int
$calignment :: ValidationCacheHeaderVersionEXT -> Int
sizeOf :: ValidationCacheHeaderVersionEXT -> Int
$csizeOf :: ValidationCacheHeaderVersionEXT -> Int
Storable, ValidationCacheHeaderVersionEXT
ValidationCacheHeaderVersionEXT
-> Zero ValidationCacheHeaderVersionEXT
forall a. a -> Zero a
zero :: ValidationCacheHeaderVersionEXT
$czero :: ValidationCacheHeaderVersionEXT
Zero)
-- Note that the zero instance does not produce a valid value, passing 'zero' to Vulkan will result in an error

-- | 'VALIDATION_CACHE_HEADER_VERSION_ONE_EXT' specifies version one of the
-- validation cache.
pattern $bVALIDATION_CACHE_HEADER_VERSION_ONE_EXT :: ValidationCacheHeaderVersionEXT
$mVALIDATION_CACHE_HEADER_VERSION_ONE_EXT :: forall r.
ValidationCacheHeaderVersionEXT
-> (Void# -> r) -> (Void# -> r) -> r
VALIDATION_CACHE_HEADER_VERSION_ONE_EXT = ValidationCacheHeaderVersionEXT 1
{-# complete VALIDATION_CACHE_HEADER_VERSION_ONE_EXT :: ValidationCacheHeaderVersionEXT #-}

conNameValidationCacheHeaderVersionEXT :: String
conNameValidationCacheHeaderVersionEXT :: String
conNameValidationCacheHeaderVersionEXT = "ValidationCacheHeaderVersionEXT"

enumPrefixValidationCacheHeaderVersionEXT :: String
enumPrefixValidationCacheHeaderVersionEXT :: String
enumPrefixValidationCacheHeaderVersionEXT = "VALIDATION_CACHE_HEADER_VERSION_ONE_EXT"

showTableValidationCacheHeaderVersionEXT :: [(ValidationCacheHeaderVersionEXT, String)]
showTableValidationCacheHeaderVersionEXT :: [(ValidationCacheHeaderVersionEXT, String)]
showTableValidationCacheHeaderVersionEXT = [(ValidationCacheHeaderVersionEXT
VALIDATION_CACHE_HEADER_VERSION_ONE_EXT, "")]

instance Show ValidationCacheHeaderVersionEXT where
  showsPrec :: Int -> ValidationCacheHeaderVersionEXT -> ShowS
showsPrec = String
-> [(ValidationCacheHeaderVersionEXT, String)]
-> String
-> (ValidationCacheHeaderVersionEXT -> Int32)
-> (Int32 -> ShowS)
-> Int
-> ValidationCacheHeaderVersionEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixValidationCacheHeaderVersionEXT
                            [(ValidationCacheHeaderVersionEXT, String)]
showTableValidationCacheHeaderVersionEXT
                            String
conNameValidationCacheHeaderVersionEXT
                            (\(ValidationCacheHeaderVersionEXT x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read ValidationCacheHeaderVersionEXT where
  readPrec :: ReadPrec ValidationCacheHeaderVersionEXT
readPrec = String
-> [(ValidationCacheHeaderVersionEXT, String)]
-> String
-> (Int32 -> ValidationCacheHeaderVersionEXT)
-> ReadPrec ValidationCacheHeaderVersionEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixValidationCacheHeaderVersionEXT
                          [(ValidationCacheHeaderVersionEXT, String)]
showTableValidationCacheHeaderVersionEXT
                          String
conNameValidationCacheHeaderVersionEXT
                          Int32 -> ValidationCacheHeaderVersionEXT
ValidationCacheHeaderVersionEXT


type EXT_VALIDATION_CACHE_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_VALIDATION_CACHE_SPEC_VERSION"
pattern EXT_VALIDATION_CACHE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_VALIDATION_CACHE_SPEC_VERSION :: a
$mEXT_VALIDATION_CACHE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_VALIDATION_CACHE_SPEC_VERSION = 1


type EXT_VALIDATION_CACHE_EXTENSION_NAME = "VK_EXT_validation_cache"

-- No documentation found for TopLevel "VK_EXT_VALIDATION_CACHE_EXTENSION_NAME"
pattern EXT_VALIDATION_CACHE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_VALIDATION_CACHE_EXTENSION_NAME :: a
$mEXT_VALIDATION_CACHE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_VALIDATION_CACHE_EXTENSION_NAME = "VK_EXT_validation_cache"