{-# language CPP #-}
-- | = Name
--
-- VK_QCOM_data_graph_model - device extension
--
-- = VK_QCOM_data_graph_model
--
-- [__Name String__]
--     @VK_QCOM_data_graph_model@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     630
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_data_graph VK_ARM_data_graph>
--
-- [__Contact__]
--
--     -   Matthew Netsch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_QCOM_data_graph_model] @mnetsch%0A*Here describe the issue or question you have about the VK_QCOM_data_graph_model extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_QCOM_data_graph_model.adoc VK_QCOM_data_graph_model>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2025-06-24
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension interacts with @VK_ARM_tensors@
--
-- [__Contributors__]
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc
--
--     -   Rob VanReenen, Qualcomm Technologies, Inc
--
--     -   Balaji Calidas, Qualcomm Technologies, Inc
--
--     -   Jacob Yenney, Qualcomm Technologies, Inc
--
--     -   Kévin Petit, Arm Ltd.
--
-- == Description
--
-- This extension supports new
-- 'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphProcessingEngineTypeARM',
-- and
-- 'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphOperationTypeARM'
-- types for data graph pipelines added in @VK_ARM_data_graph@.
--
-- A new pipeline cache type is also added to seamlessly import ML models
-- such as ONNX through QNN workflow, and run them on the device or an
-- external compute engine.
--
-- == New Structures
--
-- -   'PipelineCacheHeaderVersionDataGraphQCOM'
--
-- -   Extending
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphPipelineCreateInfoARM':
--
--     -   'DataGraphPipelineBuiltinModelCreateInfoQCOM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceDataGraphModelFeaturesQCOM'
--
-- == New Enums
--
-- -   'DataGraphModelCacheTypeQCOM'
--
-- == New Enum Constants
--
-- -   'Vulkan.Core10.APIConstants.DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM'
--
-- -   'QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME'
--
-- -   'QCOM_DATA_GRAPH_MODEL_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphOperationTypeARM':
--
--     -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_BUILTIN_MODEL_QCOM'
--
--     -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_NEURAL_MODEL_QCOM'
--
-- -   Extending
--     'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphProcessingEngineTypeARM':
--
--     -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_COMPUTE_QCOM'
--
--     -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_NEURAL_QCOM'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PipelineCacheHeaderVersion':
--
--     -   'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PIPELINE_CACHE_HEADER_VERSION_DATA_GRAPH_QCOM'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DATA_GRAPH_PIPELINE_BUILTIN_MODEL_CREATE_INFO_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_DATA_GRAPH_MODEL_FEATURES_QCOM'
--
-- == Version History
--
-- -   Revision 1, 2025-06-24 (Matthew Netsch)
--
--     -   Initial revision
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_QCOM_data_graph_model Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_QCOM_data_graph_model  ( PipelineCacheHeaderVersionDataGraphQCOM(..)
                                                   , DataGraphPipelineBuiltinModelCreateInfoQCOM(..)
                                                   , PhysicalDeviceDataGraphModelFeaturesQCOM(..)
                                                   , DataGraphModelCacheTypeQCOM( DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM
                                                                                , ..
                                                                                )
                                                   , QCOM_DATA_GRAPH_MODEL_SPEC_VERSION
                                                   , pattern QCOM_DATA_GRAPH_MODEL_SPEC_VERSION
                                                   , QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME
                                                   , pattern QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME
                                                   , PhysicalDeviceDataGraphOperationSupportARM(..)
                                                   , PhysicalDeviceDataGraphProcessingEngineTypeARM(..)
                                                   , PhysicalDeviceDataGraphOperationTypeARM(..)
                                                   , MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM
                                                   , pattern MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM
                                                   , DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM
                                                   , pattern DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM
                                                   ) where

import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Control.Monad (unless)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.APIConstants (DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM)
import Vulkan.Extensions.VK_ARM_data_graph (PhysicalDeviceDataGraphOperationSupportARM)
import Vulkan.Core10.Enums.PipelineCacheHeaderVersion (PipelineCacheHeaderVersion)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.APIConstants (pattern DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DATA_GRAPH_PIPELINE_BUILTIN_MODEL_CREATE_INFO_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DATA_GRAPH_MODEL_FEATURES_QCOM))
import Vulkan.Core10.APIConstants (DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM)
import Vulkan.Core10.APIConstants (MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM)
import Vulkan.Extensions.VK_ARM_data_graph (PhysicalDeviceDataGraphOperationSupportARM(..))
import Vulkan.Extensions.VK_ARM_data_graph (PhysicalDeviceDataGraphOperationTypeARM(..))
import Vulkan.Extensions.VK_ARM_data_graph (PhysicalDeviceDataGraphProcessingEngineTypeARM(..))
import Vulkan.Core10.APIConstants (pattern DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM)
import Vulkan.Core10.APIConstants (pattern MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM)
-- | VkPipelineCacheHeaderVersionDataGraphQCOM - Structure describing the
-- layout of the pipeline cache header for data graphs
--
-- = Description
--
-- The application /should/ verify that the header info is compatible with
-- the
-- 'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'
-- passed during pipeline creation. Implementations /may/ return
-- 'Vulkan.Extensions.VK_EXT_pipeline_creation_cache_control.PIPELINE_COMPILE_REQUIRED_EXT'
-- from 'Vulkan.Extensions.VK_ARM_data_graph.createDataGraphPipelinesARM'
-- if the cache is not compatible.
--
-- This cache type is built using offline compilation, therefore Vulkan
-- does not define engine compatibility. The application should refer to
-- the offline compiler used to create the cache for guidance on
-- compatibility.
--
-- Unlike most structures declared by the Vulkan API, all fields of this
-- structure are written with the least significant byte first, regardless
-- of host byte-order.
--
-- The C language specification does not define the packing of structure
-- members. This layout assumes tight structure member packing, with
-- members laid out in the order listed in the structure, and the intended
-- size of the structure is 28 bytes. If a compiler produces code that
-- diverges from that pattern, applications /must/ employ another method to
-- set values at the correct offsets.
--
-- == Valid Usage
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-None-11835# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-dataGraphModelQCOM dataGraphModel>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-headerSize-11836#
--     @headerSize@ /must/ be 28
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-headerVersion-11837#
--     @headerVersion@ /must/ be
--     'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PIPELINE_CACHE_HEADER_VERSION_DATA_GRAPH_QCOM'
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-headerSize-11838#
--     @headerSize@ /must/ not exceed the size of the pipeline cache
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-headerVersion-parameter#
--     @headerVersion@ /must/ be a valid
--     'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PipelineCacheHeaderVersion'
--     value
--
-- -   #VUID-VkPipelineCacheHeaderVersionDataGraphQCOM-cacheType-parameter#
--     @cacheType@ /must/ be a valid 'DataGraphModelCacheTypeQCOM' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_data_graph_model VK_QCOM_data_graph_model>,
-- 'DataGraphModelCacheTypeQCOM',
-- 'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PipelineCacheHeaderVersion'
data PipelineCacheHeaderVersionDataGraphQCOM = PipelineCacheHeaderVersionDataGraphQCOM
  { -- | @headerSize@ is the length in bytes of the pipeline cache header.
    PipelineCacheHeaderVersionDataGraphQCOM -> Word32
headerSize :: Word32
  , -- | @headerVersion@ is a
    -- 'Vulkan.Core10.Enums.PipelineCacheHeaderVersion.PipelineCacheHeaderVersion'
    -- value specifying the version of the header. A consumer of the pipeline
    -- cache /should/ use the cache version to interpret the remainder of the
    -- cache header. @headerVersion@ /must/ be written as exactly 4 bytes.
    PipelineCacheHeaderVersionDataGraphQCOM
-> PipelineCacheHeaderVersion
headerVersion :: PipelineCacheHeaderVersion
  , -- | @cacheType@ is the 'DataGraphModelCacheTypeQCOM' type of data graph
    -- cache encoded in the data.
    PipelineCacheHeaderVersionDataGraphQCOM
-> DataGraphModelCacheTypeQCOM
cacheType :: DataGraphModelCacheTypeQCOM
  , -- | @cacheVersion@ is the version of the encoding of the data graph cache.
    PipelineCacheHeaderVersionDataGraphQCOM -> Word32
cacheVersion :: Word32
  , -- | @toolchainVersion@ is a null-terminated UTF-8 string specifying the
    -- version of the compiler that built the data graph cache.
    PipelineCacheHeaderVersionDataGraphQCOM -> Vector Word32
toolchainVersion :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineCacheHeaderVersionDataGraphQCOM)
#endif
deriving instance Show PipelineCacheHeaderVersionDataGraphQCOM

instance ToCStruct PipelineCacheHeaderVersionDataGraphQCOM where
  withCStruct :: forall b.
PipelineCacheHeaderVersionDataGraphQCOM
-> (Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b) -> IO b
withCStruct PipelineCacheHeaderVersionDataGraphQCOM
x Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b
f = Int
-> (Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
28 ((Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b) -> IO b)
-> (Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineCacheHeaderVersionDataGraphQCOM
p -> Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> PipelineCacheHeaderVersionDataGraphQCOM -> IO b -> IO b
forall b.
Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> PipelineCacheHeaderVersionDataGraphQCOM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineCacheHeaderVersionDataGraphQCOM
p PipelineCacheHeaderVersionDataGraphQCOM
x (Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b
f Ptr PipelineCacheHeaderVersionDataGraphQCOM
p)
  pokeCStruct :: forall b.
Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> PipelineCacheHeaderVersionDataGraphQCOM -> IO b -> IO b
pokeCStruct Ptr PipelineCacheHeaderVersionDataGraphQCOM
p PipelineCacheHeaderVersionDataGraphQCOM{Word32
Vector Word32
PipelineCacheHeaderVersion
DataGraphModelCacheTypeQCOM
headerSize :: PipelineCacheHeaderVersionDataGraphQCOM -> Word32
headerVersion :: PipelineCacheHeaderVersionDataGraphQCOM
-> PipelineCacheHeaderVersion
cacheType :: PipelineCacheHeaderVersionDataGraphQCOM
-> DataGraphModelCacheTypeQCOM
cacheVersion :: PipelineCacheHeaderVersionDataGraphQCOM -> Word32
toolchainVersion :: PipelineCacheHeaderVersionDataGraphQCOM -> Vector Word32
headerSize :: Word32
headerVersion :: PipelineCacheHeaderVersion
cacheType :: DataGraphModelCacheTypeQCOM
cacheVersion :: Word32
toolchainVersion :: Vector Word32
..} IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
headerSize)
    Ptr PipelineCacheHeaderVersion
-> PipelineCacheHeaderVersion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int -> Ptr PipelineCacheHeaderVersion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr PipelineCacheHeaderVersion)) (PipelineCacheHeaderVersion
headerVersion)
    Ptr DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int -> Ptr DataGraphModelCacheTypeQCOM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DataGraphModelCacheTypeQCOM)) (DataGraphModelCacheTypeQCOM
cacheType)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
cacheVersion)
    Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32 -> Int) -> Vector Word32 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word32
toolchainVersion)) Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
forall a. Integral a => a
DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
      IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"toolchainVersion is too long, a maximum of DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM elements are allowed" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
    (Int -> Word32 -> IO ()) -> Vector Word32 -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr
  (FixedArray DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM Word32)
-> Ptr Word32
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int
-> Ptr
     (FixedArray DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM Word32)))) Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (Vector Word32
toolchainVersion)
    IO b
f
  cStructSize :: Int
cStructSize = Int
28
  cStructAlignment :: Int
cStructAlignment = Int
4
  pokeZeroCStruct :: forall b.
Ptr PipelineCacheHeaderVersionDataGraphQCOM -> IO b -> IO b
pokeZeroCStruct Ptr PipelineCacheHeaderVersionDataGraphQCOM
p IO b
f = do
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr PipelineCacheHeaderVersion
-> PipelineCacheHeaderVersion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int -> Ptr PipelineCacheHeaderVersion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr PipelineCacheHeaderVersion)) (PipelineCacheHeaderVersion
forall a. Zero a => a
zero)
    Ptr DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int -> Ptr DataGraphModelCacheTypeQCOM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DataGraphModelCacheTypeQCOM)) (DataGraphModelCacheTypeQCOM
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PipelineCacheHeaderVersionDataGraphQCOM where
  peekCStruct :: Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> IO PipelineCacheHeaderVersionDataGraphQCOM
peekCStruct Ptr PipelineCacheHeaderVersionDataGraphQCOM
p = do
    headerSize <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
    headerVersion <- peek @PipelineCacheHeaderVersion ((p `plusPtr` 4 :: Ptr PipelineCacheHeaderVersion))
    cacheType <- peek @DataGraphModelCacheTypeQCOM ((p `plusPtr` 8 :: Ptr DataGraphModelCacheTypeQCOM))
    cacheVersion <- peek @Word32 ((p `plusPtr` 12 :: Ptr Word32))
    toolchainVersion <- generateM (DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Word32 ((Ptr PipelineCacheHeaderVersionDataGraphQCOM
p Ptr PipelineCacheHeaderVersionDataGraphQCOM
-> Int
-> Ptr
     (FixedArray DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (FixedArray DATA_GRAPH_MODEL_TOOLCHAIN_VERSION_LENGTH_QCOM Word32)))) Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    pure $ PipelineCacheHeaderVersionDataGraphQCOM
             headerSize headerVersion cacheType cacheVersion toolchainVersion

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

instance Zero PipelineCacheHeaderVersionDataGraphQCOM where
  zero :: PipelineCacheHeaderVersionDataGraphQCOM
zero = Word32
-> PipelineCacheHeaderVersion
-> DataGraphModelCacheTypeQCOM
-> Word32
-> Vector Word32
-> PipelineCacheHeaderVersionDataGraphQCOM
PipelineCacheHeaderVersionDataGraphQCOM
           Word32
forall a. Zero a => a
zero
           PipelineCacheHeaderVersion
forall a. Zero a => a
zero
           DataGraphModelCacheTypeQCOM
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Vector Word32
forall a. Monoid a => a
mempty


-- | VkDataGraphPipelineBuiltinModelCreateInfoQCOM - Structure specifying a
-- built-in model for the newly created data graph pipeline
--
-- = Description
--
-- The @pipelineCache@ is ignored for the creation of this pipeline.
--
-- Applications /can/ specify arguments to the built-in operation named in
-- @pOperation@ with
-- 'Vulkan.Extensions.VK_ARM_data_graph.DataGraphPipelineCompilerControlCreateInfoARM'.
--
-- Applications /should/ verify that the @pVendorOptions@, @layout@, and
-- other state included with this pipeline creation are compatible with the
-- @pOperation@. Implementations /may/ fail if any state is not compatible
-- and return 'Vulkan.Core10.Enums.Result.PIPELINE_COMPILE_REQUIRED'.
--
-- Built-in models are defined by the provider of the model, therefore
-- Vulkan does not define model compatibility. The application should refer
-- to the provider of the built-in model for guidance on compatibility.
--
-- == Valid Usage
--
-- -   #VUID-VkDataGraphPipelineBuiltinModelCreateInfoQCOM-pOperation-11842#
--     All members of @pOperation@ /must/ be identical to a
--     'Vulkan.Extensions.VK_ARM_data_graph.QueueFamilyDataGraphPropertiesARM'::@operation@
--     retrieved from
--     'Vulkan.Extensions.VK_ARM_data_graph.getPhysicalDeviceQueueFamilyDataGraphPropertiesARM'
--     with the @physicalDevice@ that was used to create @device@ and
--     paired in the retrieved results with a
--     'Vulkan.Extensions.VK_ARM_data_graph.QueueFamilyDataGraphPropertiesARM'::@engine@
--     identical to an element of
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'::@pProcessingEngines@
--     provided in the @pNext@ chain
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDataGraphPipelineBuiltinModelCreateInfoQCOM-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DATA_GRAPH_PIPELINE_BUILTIN_MODEL_CREATE_INFO_QCOM'
--
-- -   #VUID-VkDataGraphPipelineBuiltinModelCreateInfoQCOM-pOperation-parameter#
--     @pOperation@ /must/ be a valid pointer to a valid
--     'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphOperationSupportARM'
--     structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_data_graph_model VK_QCOM_data_graph_model>,
-- 'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphOperationSupportARM',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DataGraphPipelineBuiltinModelCreateInfoQCOM = DataGraphPipelineBuiltinModelCreateInfoQCOM
  { -- | @pOperation@ is a
    -- 'Vulkan.Extensions.VK_ARM_data_graph.PhysicalDeviceDataGraphOperationSupportARM'
    -- specifying the built-in operation.
    DataGraphPipelineBuiltinModelCreateInfoQCOM
-> PhysicalDeviceDataGraphOperationSupportARM
operation :: PhysicalDeviceDataGraphOperationSupportARM }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DataGraphPipelineBuiltinModelCreateInfoQCOM)
#endif
deriving instance Show DataGraphPipelineBuiltinModelCreateInfoQCOM

instance ToCStruct DataGraphPipelineBuiltinModelCreateInfoQCOM where
  withCStruct :: forall b.
DataGraphPipelineBuiltinModelCreateInfoQCOM
-> (Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b)
-> IO b
withCStruct DataGraphPipelineBuiltinModelCreateInfoQCOM
x Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b
f = Int
-> (Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b) -> IO b)
-> (Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p -> Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b -> IO b
forall b.
Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p DataGraphPipelineBuiltinModelCreateInfoQCOM
x (Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b
f Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p)
  pokeCStruct :: forall b.
Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b -> IO b
pokeCStruct Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p DataGraphPipelineBuiltinModelCreateInfoQCOM{PhysicalDeviceDataGraphOperationSupportARM
operation :: DataGraphPipelineBuiltinModelCreateInfoQCOM
-> PhysicalDeviceDataGraphOperationSupportARM
operation :: PhysicalDeviceDataGraphOperationSupportARM
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DATA_GRAPH_PIPELINE_BUILTIN_MODEL_CREATE_INFO_QCOM)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    pOperation'' <- ((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b)
-> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b)
 -> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM))
-> ((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b)
    -> IO b)
-> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall a b. (a -> b) -> a -> b
$ PhysicalDeviceDataGraphOperationSupportARM
-> (Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PhysicalDeviceDataGraphOperationSupportARM
-> (Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b
withCStruct (PhysicalDeviceDataGraphOperationSupportARM
operation)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr PhysicalDeviceDataGraphOperationSupportARM))) pOperation''
    lift $ f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM -> IO b -> IO b
pokeZeroCStruct Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DATA_GRAPH_PIPELINE_BUILTIN_MODEL_CREATE_INFO_QCOM)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    pOperation'' <- ((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b)
-> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b)
 -> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM))
-> ((Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b)
    -> IO b)
-> ContT b IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall a b. (a -> b) -> a -> b
$ PhysicalDeviceDataGraphOperationSupportARM
-> (Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PhysicalDeviceDataGraphOperationSupportARM
-> (Ptr PhysicalDeviceDataGraphOperationSupportARM -> IO b) -> IO b
withCStruct (PhysicalDeviceDataGraphOperationSupportARM
forall a. Zero a => a
zero)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr PhysicalDeviceDataGraphOperationSupportARM))) pOperation''
    lift $ f

instance FromCStruct DataGraphPipelineBuiltinModelCreateInfoQCOM where
  peekCStruct :: Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> IO DataGraphPipelineBuiltinModelCreateInfoQCOM
peekCStruct Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p = do
    pOperation <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PhysicalDeviceDataGraphOperationSupportARM (Ptr PhysicalDeviceDataGraphOperationSupportARM
 -> IO PhysicalDeviceDataGraphOperationSupportARM)
-> IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
-> IO PhysicalDeviceDataGraphOperationSupportARM
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr PhysicalDeviceDataGraphOperationSupportARM)
-> IO (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall a. Storable a => Ptr a -> IO a
peek ((Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
p Ptr DataGraphPipelineBuiltinModelCreateInfoQCOM
-> Int -> Ptr (Ptr PhysicalDeviceDataGraphOperationSupportARM)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr PhysicalDeviceDataGraphOperationSupportARM)))
    pure $ DataGraphPipelineBuiltinModelCreateInfoQCOM
             pOperation

instance Zero DataGraphPipelineBuiltinModelCreateInfoQCOM where
  zero :: DataGraphPipelineBuiltinModelCreateInfoQCOM
zero = PhysicalDeviceDataGraphOperationSupportARM
-> DataGraphPipelineBuiltinModelCreateInfoQCOM
DataGraphPipelineBuiltinModelCreateInfoQCOM
           PhysicalDeviceDataGraphOperationSupportARM
forall a. Zero a => a
zero


-- | VkPhysicalDeviceDataGraphModelFeaturesQCOM - Structure describing
-- features to control data graph model
--
-- = Description
--
-- If the 'PhysicalDeviceDataGraphModelFeaturesQCOM' structure is included
-- in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceDataGraphModelFeaturesQCOM', it /must/ add an instance of
-- the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_data_graph_model VK_QCOM_data_graph_model>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDataGraphModelFeaturesQCOM = PhysicalDeviceDataGraphModelFeaturesQCOM
  { -- | #features-dataGraphModelQCOM# @dataGraphModel@ specifies whether the
    -- functionality defined by this extension is available, and guarantees
    -- that the implementation supports a data graph queue family with at least
    -- one of the following engine types:
    --
    -- -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_NEURAL_QCOM'
    --
    -- -   'Vulkan.Extensions.VK_ARM_data_graph.PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_COMPUTE_QCOM'
    PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
dataGraphModel :: Bool }
  deriving (Typeable, PhysicalDeviceDataGraphModelFeaturesQCOM
-> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
(PhysicalDeviceDataGraphModelFeaturesQCOM
 -> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool)
-> (PhysicalDeviceDataGraphModelFeaturesQCOM
    -> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool)
-> Eq PhysicalDeviceDataGraphModelFeaturesQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceDataGraphModelFeaturesQCOM
-> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
== :: PhysicalDeviceDataGraphModelFeaturesQCOM
-> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
$c/= :: PhysicalDeviceDataGraphModelFeaturesQCOM
-> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
/= :: PhysicalDeviceDataGraphModelFeaturesQCOM
-> PhysicalDeviceDataGraphModelFeaturesQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDataGraphModelFeaturesQCOM)
#endif
deriving instance Show PhysicalDeviceDataGraphModelFeaturesQCOM

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

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

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

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


-- | VkDataGraphModelCacheTypeQCOM - Encode pipeline data graph cache type
--
-- = Description
--
-- -   'DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM' specifies a
--     general binary layout type.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_data_graph_model VK_QCOM_data_graph_model>,
-- 'PipelineCacheHeaderVersionDataGraphQCOM'
newtype DataGraphModelCacheTypeQCOM = DataGraphModelCacheTypeQCOM Int32
  deriving newtype (DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
(DataGraphModelCacheTypeQCOM
 -> DataGraphModelCacheTypeQCOM -> Bool)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> Bool)
-> Eq DataGraphModelCacheTypeQCOM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
== :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
$c/= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
/= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
Eq, Eq DataGraphModelCacheTypeQCOM
Eq DataGraphModelCacheTypeQCOM =>
(DataGraphModelCacheTypeQCOM
 -> DataGraphModelCacheTypeQCOM -> Ordering)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> Bool)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> Bool)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> Bool)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> Bool)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM)
-> (DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM)
-> Ord DataGraphModelCacheTypeQCOM
DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> Ordering
DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM
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
$ccompare :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> Ordering
compare :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> Ordering
$c< :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
< :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
$c<= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
<= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
$c> :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
> :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
$c>= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
>= :: DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM -> Bool
$cmax :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM
max :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM
$cmin :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM
min :: DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> DataGraphModelCacheTypeQCOM
Ord, Ptr DataGraphModelCacheTypeQCOM -> IO DataGraphModelCacheTypeQCOM
Ptr DataGraphModelCacheTypeQCOM
-> Int -> IO DataGraphModelCacheTypeQCOM
Ptr DataGraphModelCacheTypeQCOM
-> Int -> DataGraphModelCacheTypeQCOM -> IO ()
Ptr DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> IO ()
DataGraphModelCacheTypeQCOM -> Int
(DataGraphModelCacheTypeQCOM -> Int)
-> (DataGraphModelCacheTypeQCOM -> Int)
-> (Ptr DataGraphModelCacheTypeQCOM
    -> Int -> IO DataGraphModelCacheTypeQCOM)
-> (Ptr DataGraphModelCacheTypeQCOM
    -> Int -> DataGraphModelCacheTypeQCOM -> IO ())
-> (forall b. Ptr b -> Int -> IO DataGraphModelCacheTypeQCOM)
-> (forall b. Ptr b -> Int -> DataGraphModelCacheTypeQCOM -> IO ())
-> (Ptr DataGraphModelCacheTypeQCOM
    -> IO DataGraphModelCacheTypeQCOM)
-> (Ptr DataGraphModelCacheTypeQCOM
    -> DataGraphModelCacheTypeQCOM -> IO ())
-> Storable DataGraphModelCacheTypeQCOM
forall b. Ptr b -> Int -> IO DataGraphModelCacheTypeQCOM
forall b. Ptr b -> Int -> DataGraphModelCacheTypeQCOM -> 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
$csizeOf :: DataGraphModelCacheTypeQCOM -> Int
sizeOf :: DataGraphModelCacheTypeQCOM -> Int
$calignment :: DataGraphModelCacheTypeQCOM -> Int
alignment :: DataGraphModelCacheTypeQCOM -> Int
$cpeekElemOff :: Ptr DataGraphModelCacheTypeQCOM
-> Int -> IO DataGraphModelCacheTypeQCOM
peekElemOff :: Ptr DataGraphModelCacheTypeQCOM
-> Int -> IO DataGraphModelCacheTypeQCOM
$cpokeElemOff :: Ptr DataGraphModelCacheTypeQCOM
-> Int -> DataGraphModelCacheTypeQCOM -> IO ()
pokeElemOff :: Ptr DataGraphModelCacheTypeQCOM
-> Int -> DataGraphModelCacheTypeQCOM -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DataGraphModelCacheTypeQCOM
peekByteOff :: forall b. Ptr b -> Int -> IO DataGraphModelCacheTypeQCOM
$cpokeByteOff :: forall b. Ptr b -> Int -> DataGraphModelCacheTypeQCOM -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> DataGraphModelCacheTypeQCOM -> IO ()
$cpeek :: Ptr DataGraphModelCacheTypeQCOM -> IO DataGraphModelCacheTypeQCOM
peek :: Ptr DataGraphModelCacheTypeQCOM -> IO DataGraphModelCacheTypeQCOM
$cpoke :: Ptr DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> IO ()
poke :: Ptr DataGraphModelCacheTypeQCOM
-> DataGraphModelCacheTypeQCOM -> IO ()
Storable, DataGraphModelCacheTypeQCOM
DataGraphModelCacheTypeQCOM -> Zero DataGraphModelCacheTypeQCOM
forall a. a -> Zero a
$czero :: DataGraphModelCacheTypeQCOM
zero :: DataGraphModelCacheTypeQCOM
Zero)

-- No documentation found for Nested "VkDataGraphModelCacheTypeQCOM" "VK_DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM"
pattern $mDATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM :: forall {r}.
DataGraphModelCacheTypeQCOM -> ((# #) -> r) -> ((# #) -> r) -> r
$bDATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM :: DataGraphModelCacheTypeQCOM
DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM = DataGraphModelCacheTypeQCOM 0

{-# COMPLETE DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM :: DataGraphModelCacheTypeQCOM #-}

conNameDataGraphModelCacheTypeQCOM :: String
conNameDataGraphModelCacheTypeQCOM :: String
conNameDataGraphModelCacheTypeQCOM = String
"DataGraphModelCacheTypeQCOM"

enumPrefixDataGraphModelCacheTypeQCOM :: String
enumPrefixDataGraphModelCacheTypeQCOM :: String
enumPrefixDataGraphModelCacheTypeQCOM = String
"DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM"

showTableDataGraphModelCacheTypeQCOM :: [(DataGraphModelCacheTypeQCOM, String)]
showTableDataGraphModelCacheTypeQCOM :: [(DataGraphModelCacheTypeQCOM, String)]
showTableDataGraphModelCacheTypeQCOM =
  [
    ( DataGraphModelCacheTypeQCOM
DATA_GRAPH_MODEL_CACHE_TYPE_GENERIC_BINARY_QCOM
    , String
""
    )
  ]

instance Show DataGraphModelCacheTypeQCOM where
  showsPrec :: Int -> DataGraphModelCacheTypeQCOM -> ShowS
showsPrec =
    String
-> [(DataGraphModelCacheTypeQCOM, String)]
-> String
-> (DataGraphModelCacheTypeQCOM -> Int32)
-> (Int32 -> ShowS)
-> Int
-> DataGraphModelCacheTypeQCOM
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixDataGraphModelCacheTypeQCOM
      [(DataGraphModelCacheTypeQCOM, String)]
showTableDataGraphModelCacheTypeQCOM
      String
conNameDataGraphModelCacheTypeQCOM
      (\(DataGraphModelCacheTypeQCOM Int32
x) -> Int32
x)
      (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read DataGraphModelCacheTypeQCOM where
  readPrec :: ReadPrec DataGraphModelCacheTypeQCOM
readPrec =
    String
-> [(DataGraphModelCacheTypeQCOM, String)]
-> String
-> (Int32 -> DataGraphModelCacheTypeQCOM)
-> ReadPrec DataGraphModelCacheTypeQCOM
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixDataGraphModelCacheTypeQCOM
      [(DataGraphModelCacheTypeQCOM, String)]
showTableDataGraphModelCacheTypeQCOM
      String
conNameDataGraphModelCacheTypeQCOM
      Int32 -> DataGraphModelCacheTypeQCOM
DataGraphModelCacheTypeQCOM

type QCOM_DATA_GRAPH_MODEL_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_QCOM_DATA_GRAPH_MODEL_SPEC_VERSION"
pattern QCOM_DATA_GRAPH_MODEL_SPEC_VERSION :: forall a . Integral a => a
pattern $mQCOM_DATA_GRAPH_MODEL_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bQCOM_DATA_GRAPH_MODEL_SPEC_VERSION :: forall a. Integral a => a
QCOM_DATA_GRAPH_MODEL_SPEC_VERSION = 1


type QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME = "VK_QCOM_data_graph_model"

-- No documentation found for TopLevel "VK_QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME"
pattern QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mQCOM_DATA_GRAPH_MODEL_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bQCOM_DATA_GRAPH_MODEL_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
QCOM_DATA_GRAPH_MODEL_EXTENSION_NAME = "VK_QCOM_data_graph_model"