{-# language CPP #-}
-- | = Name
--
-- VK_KHR_fragment_shader_barycentric - device extension
--
-- == VK_KHR_fragment_shader_barycentric
--
-- [__Name String__]
--     @VK_KHR_fragment_shader_barycentric@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     323
--
-- [__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>
--
-- [__Contact__]
--
--     -   Stu Smith
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_fragment_shader_barycentric.adoc VK_KHR_fragment_shader_barycentric>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-03-10
--
-- [__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_fragment_shader_barycentric.html SPV_KHR_fragment_shader_barycentric>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_fragment_shader_barycentric.txt GL_EXT_fragment_shader_barycentric>
--
-- [__Contributors__]
--
--     -   Stu Smith, AMD
--
--     -   Tobias Hector, AMD
--
--     -   Graeme Leese, Broadcom
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Slawek Grajewski, Intel
--
--     -   Pat Brown, NVIDIA
--
--     -   Hans-Kristian Arntzen, Valve
--
--     -   Contributors to the VK_NV_fragment_shader_barycentric
--         specification
--
-- == Description
--
-- This extension is based on the @VK_NV_fragment_shader_barycentric@
-- extension, and adds support for the following SPIR-V extension in
-- Vulkan:
--
-- -   <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_fragment_shader_barycentric.html SPV_KHR_fragment_shader_barycentric>
--
-- The extension provides access to three additional fragment shader
-- variable decorations in SPIR-V:
--
-- -   @PerVertexKHR@, which indicates that a fragment shader input will
--     not have interpolated values, but instead must be accessed with an
--     extra array index that identifies one of the vertices of the
--     primitive producing the fragment
--
-- -   @BaryCoordKHR@, which indicates that the variable is a
--     three-component floating-point vector holding barycentric weights
--     for the fragment produced using perspective interpolation
--
-- -   @BaryCoordNoPerspKHR@, which indicates that the variable is a
--     three-component floating-point vector holding barycentric weights
--     for the fragment produced using linear interpolation
--
-- When using GLSL source-based shader languages, the following variables
-- from @GL_EXT_fragment_shader_barycentric@ map to these SPIR-V built-in
-- decorations:
--
-- -   @in vec3 gl_BaryCoordEXT;@ → @BaryCoordKHR@
--
-- -   @in vec3 gl_BaryCoordNoPerspEXT;@ → @BaryCoordNoPerspKHR@
--
-- GLSL variables declared using the @pervertexEXT@ GLSL qualifier are
-- expected to be decorated with @PerVertexKHR@ in SPIR-V.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceFragmentShaderBarycentricFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceFragmentShaderBarycentricPropertiesKHR'
--
-- == New Enum Constants
--
-- -   'KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME'
--
-- -   'KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR'
--
-- == New Built-In Variables
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-barycoordkhr BaryCoordKHR>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-barycoordnoperspkhr BaryCoordNoPerspKHR>
--
-- == New SPIR-V Decorations
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#shaders-interpolation-decorations-pervertexkhr PerVertexKHR>
--
-- == New SPIR-V Capabilities
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-capabilities-table-FragmentBarycentricKHR FragmentBarycentricKHR>
--
-- == Issues
--
-- 1) What are the interactions with MSAA and how are @BaryCoordKHR@ and
-- @BaryCoordNoPerspKHR@ interpolated?
--
-- __RESOLVED__: The inputs decorated with @BaryCoordKHR@ or
-- @BaryCoordNoPerspKHR@ /may/ also be decorated with the @Centroid@ or
-- @Sample@ qualifiers to specify interpolation, like any other fragment
-- shader input. If
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-shaderSampleRateInterpolationFunctions shaderSampleRateInterpolationFunctions>
-- is enabled, the extended instructions InterpolateAtCentroid,
-- InterpolateAtOffset, and InterpolateAtSample from the GLSL.std.450 /may/
-- also be used with inputs decorated with @BaryCoordKHR@ or
-- @BaryCoordNoPerspKHR@.
--
-- == Version History
--
-- -   Revision 1, 2022-03-10 (Stu Smith)
--
--     -   Initial revision
--
-- == See Also
--
-- 'PhysicalDeviceFragmentShaderBarycentricFeaturesKHR',
-- 'PhysicalDeviceFragmentShaderBarycentricPropertiesKHR'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_fragment_shader_barycentric 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_fragment_shader_barycentric  ( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR(..)
                                                             , PhysicalDeviceFragmentShaderBarycentricPropertiesKHR(..)
                                                             , KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION
                                                             , pattern KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION
                                                             , KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME
                                                             , pattern KHR_FRAGMENT_SHADER_BARYCENTRIC_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_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR))
-- | VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR - Structure
-- describing barycentric support in fragment shaders that can be supported
-- by an implementation
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- See
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-barycentric Barycentric Interpolation>
-- for more information.
--
-- If the 'PhysicalDeviceFragmentShaderBarycentricFeaturesKHR' 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. 'PhysicalDeviceFragmentShaderBarycentricFeaturesKHR' /can/
-- also be used in the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' to selectively enable these
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_fragment_shader_barycentric VK_KHR_fragment_shader_barycentric>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentShaderBarycentricFeaturesKHR = PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
  { -- | #features-fragmentShaderBarycentric# @fragmentShaderBarycentric@
    -- indicates that the implementation supports the @BaryCoordKHR@ and
    -- @BaryCoordNoPerspKHR@ SPIR-V fragment shader built-ins and supports the
    -- @PerVertexKHR@ SPIR-V decoration on fragment shader input variables.
    PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
fragmentShaderBarycentric :: Bool }
  deriving (Typeable, PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
$c/= :: PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
== :: PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
$c== :: PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentShaderBarycentricFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceFragmentShaderBarycentricFeaturesKHR

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

instance FromCStruct PhysicalDeviceFragmentShaderBarycentricFeaturesKHR where
  peekCStruct :: Ptr PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
-> IO PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
peekCStruct Ptr PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
p = do
    Bool32
fragmentShaderBarycentric <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
PhysicalDeviceFragmentShaderBarycentricFeaturesKHR
             (Bool32 -> Bool
bool32ToBool Bool32
fragmentShaderBarycentric)

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

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


-- | VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR - Structure
-- describing fragment shader barycentric limits of an implementation
--
-- = Members
--
-- -   #limits-triStripVertexOrderIndependentOfProvokingVertex# When the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#vertexpostproc-flatshading provoking vertex mode>
--     is
--     'Vulkan.Extensions.VK_EXT_provoking_vertex.PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT',
--     and the primitive order is odd in a triangle strip, the ordering of
--     vertices is defined in
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-barycentric-order-table-last-vertex last vertex table>.
--     @triStripVertexOrderIndependentOfProvokingVertex@ equal to
--     'Vulkan.Core10.FundamentalTypes.TRUE' indicates that the
--     implementation ignores this and uses the vertex order defined by
--     'Vulkan.Extensions.VK_EXT_provoking_vertex.PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT'
--     instead.
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentShaderBarycentricPropertiesKHR' 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_fragment_shader_barycentric VK_KHR_fragment_shader_barycentric>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentShaderBarycentricPropertiesKHR = PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
  { -- No documentation found for Nested "VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR" "triStripVertexOrderIndependentOfProvokingVertex"
    PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
triStripVertexOrderIndependentOfProvokingVertex :: Bool }
  deriving (Typeable, PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
$c/= :: PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
== :: PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
$c== :: PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentShaderBarycentricPropertiesKHR)
#endif
deriving instance Show PhysicalDeviceFragmentShaderBarycentricPropertiesKHR

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

instance FromCStruct PhysicalDeviceFragmentShaderBarycentricPropertiesKHR where
  peekCStruct :: Ptr PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
-> IO PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
peekCStruct Ptr PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
p = do
    Bool32
triStripVertexOrderIndependentOfProvokingVertex <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
PhysicalDeviceFragmentShaderBarycentricPropertiesKHR
             (Bool32 -> Bool
bool32ToBool Bool32
triStripVertexOrderIndependentOfProvokingVertex)

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

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


type KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION"
pattern KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION :: forall a. Integral a => a
$mKHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION = 1


type KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME = "VK_KHR_fragment_shader_barycentric"

-- No documentation found for TopLevel "VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME"
pattern KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME = "VK_KHR_fragment_shader_barycentric"