{-# language CPP #-}
-- | = Name
--
-- VK_KHR_compute_shader_derivatives - device extension
--
-- = VK_KHR_compute_shader_derivatives
--
-- [__Name String__]
--     @VK_KHR_compute_shader_derivatives@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     512
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Vulkan Version 1.1>
--
-- [__SPIR-V Dependencies__]
--
--     -   <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_compute_shader_derivatives.html SPV_KHR_compute_shader_derivatives>
--
-- [__Contact__]
--
--     -   Jean-Noe Morissette
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_compute_shader_derivatives] @MagicPoncho%0A*Here describe the issue or question you have about the VK_KHR_compute_shader_derivatives extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_compute_shader_derivatives.adoc VK_KHR_compute_shader_derivatives>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2024-06-26
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_compute_shader_derivatives.html SPV_KHR_compute_shader_derivatives>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/main/extensions/khr/GLSL_KHR_compute_shader_derivatives.txt GL_KHR_compute_shader_derivatives>
--
-- [__Contributors__]
--
--     -   Jean-Noe Morissette, Epic Games
--
--     -   Daniel Koch, NVIDIA
--
--     -   Pat Brown, NVIDIA
--
--     -   Stu Smith, AMD
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Tobias Hector, AMD
--
--     -   Ralph Potter, Samsung
--
--     -   Pan Gao, Huawei
--
--     -   Samuel (Sheng-Wen) Huang, MediaTek
--
--     -   Graeme Leese, Broadcom
--
--     -   Hans-Kristian Arntzen, Valve
--
--     -   Matthew Netsch, Qualcomm
--
-- == Description
--
-- This extension adds Vulkan support for the
-- <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_compute_shader_derivatives.html SPV_KHR_compute_shader_derivatives>
-- SPIR-V extension.
--
-- The SPIR-V extension provides two new execution modes, both of which
-- allow execution models with defined workgroups to use built-ins that
-- evaluate derivatives explicitly or implicitly. Derivatives will be
-- computed via differencing over a 2x2 group of shader invocations. The
-- @DerivativeGroupQuadsKHR@ execution mode assembles shader invocations
-- into 2x2 groups, where each group has x and y coordinates of the local
-- invocation ID of the form (2m+{0,1}, 2n+{0,1}). The
-- @DerivativeGroupLinearKHR@ execution mode assembles shader invocations
-- into 2x2 groups, where each group has local invocation index values of
-- the form 4m+{0,1,2,3}.
--
-- The new execution modes are supported in compute shaders and optionally
-- (see
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-meshAndTaskShaderDerivatives meshAndTaskShaderDerivatives>)
-- in mesh and task shaders.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceComputeShaderDerivativesFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceComputeShaderDerivativesPropertiesKHR'
--
-- == New Enum Constants
--
-- -   'KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME'
--
-- -   'KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR'
--
-- == New SPIR-V Capability
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-ComputeDerivativeGroupQuadsKHR ComputeDerivativeGroupQuadsKHR>
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-ComputeDerivativeGroupLinearKHR ComputeDerivativeGroupLinearKHR>
--
-- == Examples
--
-- None.
--
-- == Version History
--
-- -   Revision 1, 2023-02-27 (Jean-Noe Morissette)
--
--     -   Initial draft
--
--     -   Add properties and clarify mesh and task support (Daniel Koch)
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_KHR_compute_shader_derivatives Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_compute_shader_derivatives  ( PhysicalDeviceComputeShaderDerivativesFeaturesKHR(..)
                                                            , PhysicalDeviceComputeShaderDerivativesPropertiesKHR(..)
                                                            , KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION
                                                            , pattern KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION
                                                            , KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME
                                                            , pattern KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME
                                                            ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
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 Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR))
-- | VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR - Structure
-- describing compute shader derivative features that can be supported by
-- an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- See
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#shaders-scope-quad Quad shader scope>
-- for more information.
--
-- If the 'PhysicalDeviceComputeShaderDerivativesFeaturesKHR'. 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
-- 'PhysicalDeviceComputeShaderDerivativesFeaturesKHR'., it /must/ add an
-- instance of the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_compute_shader_derivatives VK_KHR_compute_shader_derivatives>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_compute_shader_derivatives VK_NV_compute_shader_derivatives>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceComputeShaderDerivativesFeaturesKHR = PhysicalDeviceComputeShaderDerivativesFeaturesKHR
  { -- | #features-computeDerivativeGroupQuads# @computeDerivativeGroupQuads@
    -- indicates that the implementation supports the
    -- @ComputeDerivativeGroupQuadsKHR@ SPIR-V capability.
    PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
computeDerivativeGroupQuads :: Bool
  , -- | #features-computeDerivativeGroupLinear# @computeDerivativeGroupLinear@
    -- indicates that the implementation supports the
    -- @ComputeDerivativeGroupLinearKHR@ SPIR-V capability.
    PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
computeDerivativeGroupLinear :: Bool
  }
  deriving (Typeable, PhysicalDeviceComputeShaderDerivativesFeaturesKHR
-> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
(PhysicalDeviceComputeShaderDerivativesFeaturesKHR
 -> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool)
-> (PhysicalDeviceComputeShaderDerivativesFeaturesKHR
    -> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool)
-> Eq PhysicalDeviceComputeShaderDerivativesFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceComputeShaderDerivativesFeaturesKHR
-> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
== :: PhysicalDeviceComputeShaderDerivativesFeaturesKHR
-> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
$c/= :: PhysicalDeviceComputeShaderDerivativesFeaturesKHR
-> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
/= :: PhysicalDeviceComputeShaderDerivativesFeaturesKHR
-> PhysicalDeviceComputeShaderDerivativesFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceComputeShaderDerivativesFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceComputeShaderDerivativesFeaturesKHR

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

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

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

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


-- | VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR - Structure
-- describing compute shader derivative operations supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceComputeShaderDerivativesPropertiesKHR'
-- structure describe the following:
--
-- = Description
--
-- If the 'PhysicalDeviceComputeShaderDerivativesPropertiesKHR' structure
-- is included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_compute_shader_derivatives VK_KHR_compute_shader_derivatives>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceComputeShaderDerivativesPropertiesKHR = PhysicalDeviceComputeShaderDerivativesPropertiesKHR
  { -- | #limits-meshAndTaskShaderDerivatives# @meshAndTaskShaderDerivatives@
    -- indicates whether the mesh and task shader stages support the
    -- @ComputeDerivativeGroupQuadsKHR@ and @ComputeDerivativeGroupLinearKHR@
    -- SPIR-V capabilities.
    PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
meshAndTaskShaderDerivatives :: Bool }
  deriving (Typeable, PhysicalDeviceComputeShaderDerivativesPropertiesKHR
-> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
(PhysicalDeviceComputeShaderDerivativesPropertiesKHR
 -> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool)
-> (PhysicalDeviceComputeShaderDerivativesPropertiesKHR
    -> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool)
-> Eq PhysicalDeviceComputeShaderDerivativesPropertiesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceComputeShaderDerivativesPropertiesKHR
-> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
== :: PhysicalDeviceComputeShaderDerivativesPropertiesKHR
-> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
$c/= :: PhysicalDeviceComputeShaderDerivativesPropertiesKHR
-> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
/= :: PhysicalDeviceComputeShaderDerivativesPropertiesKHR
-> PhysicalDeviceComputeShaderDerivativesPropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceComputeShaderDerivativesPropertiesKHR)
#endif
deriving instance Show PhysicalDeviceComputeShaderDerivativesPropertiesKHR

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

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

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


type KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION"
pattern KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION :: forall a. Integral a => a
KHR_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION = 1


type KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME = "VK_KHR_compute_shader_derivatives"

-- No documentation found for TopLevel "VK_KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME"
pattern KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME = "VK_KHR_compute_shader_derivatives"