{-# language CPP #-}
-- | = Name
--
-- VK_EXT_legacy_vertex_attributes - device extension
--
-- = VK_EXT_legacy_vertex_attributes
--
-- [__Name String__]
--     @VK_EXT_legacy_vertex_attributes@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     496
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_vertex_input_dynamic_state VK_EXT_vertex_input_dynamic_state>
--
-- [__Special Use__]
--
--     -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#extendingvulkan-compatibility-specialuse OpenGL \/ ES support>
--
-- [__Contact__]
--
--     -   Mike Blumenkrantz
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_legacy_vertex_attributes] @zmike%0A*Here describe the issue or question you have about the VK_EXT_legacy_vertex_attributes extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_EXT_legacy_vertex_attributes.adoc VK_EXT_legacy_vertex_attributes>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2024-02-23
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Mike Blumenkrantz, Valve
--
--     -   Piers Daniell, NVIDIA
--
--     -   Spencer Fricke, LunarG
--
--     -   Alyssa Rosenzweig, Valve
--
-- == Description
--
-- This extension adds support for legacy features of (non-64-bit) vertex
-- attributes as found in OpenGL:
--
-- -   Vertex attributes loaded from arbitrary buffer alignments
--
-- -   Vertex attributes using arbitrary strides
--
-- -   Vertex attributes where the component data type of the binding does
--     not match the component numeric type of the shader input
--
-- These features are only usable with dynamic vertex input. Unaligned
-- loads of vertex attributes may incur performance penalties, indicated
-- with a property.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceLegacyVertexAttributesFeaturesEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceLegacyVertexAttributesPropertiesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME'
--
-- -   'EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT'
--
-- == Issues
--
-- 1.) Should implementations convert float\/integer values?
--
-- __RESOLVED__: No. When fetching an integer data type from float values
-- or float data types from integer values, the resulting shader values are
-- implementation-dependent.
--
-- == Version History
--
-- -   Revision 1, 2024-02-16 (Mike Blumenkrantz)
--
--     -   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_EXT_legacy_vertex_attributes Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_legacy_vertex_attributes  ( PhysicalDeviceLegacyVertexAttributesFeaturesEXT(..)
                                                          , PhysicalDeviceLegacyVertexAttributesPropertiesEXT(..)
                                                          , EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION
                                                          , pattern EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION
                                                          , EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME
                                                          , pattern EXT_LEGACY_VERTEX_ATTRIBUTES_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_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT))
-- | VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT - Structure describing
-- compatibility features for vertex attributes
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceLegacyVertexAttributesFeaturesEXT' 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
-- 'PhysicalDeviceLegacyVertexAttributesFeaturesEXT', 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_EXT_legacy_vertex_attributes VK_EXT_legacy_vertex_attributes>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceLegacyVertexAttributesFeaturesEXT = PhysicalDeviceLegacyVertexAttributesFeaturesEXT
  { -- | #features-legacyVertexAttributes# @legacyVertexAttributes@ specifies
    -- whether compatibility features for vertex attributes are supported when
    -- using dynamic vertex input state.
    PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
legacyVertexAttributes :: Bool }
  deriving (Typeable, PhysicalDeviceLegacyVertexAttributesFeaturesEXT
-> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
(PhysicalDeviceLegacyVertexAttributesFeaturesEXT
 -> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool)
-> (PhysicalDeviceLegacyVertexAttributesFeaturesEXT
    -> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool)
-> Eq PhysicalDeviceLegacyVertexAttributesFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceLegacyVertexAttributesFeaturesEXT
-> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
== :: PhysicalDeviceLegacyVertexAttributesFeaturesEXT
-> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
$c/= :: PhysicalDeviceLegacyVertexAttributesFeaturesEXT
-> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
/= :: PhysicalDeviceLegacyVertexAttributesFeaturesEXT
-> PhysicalDeviceLegacyVertexAttributesFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLegacyVertexAttributesFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceLegacyVertexAttributesFeaturesEXT

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

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

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


-- | VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT - Structure
-- describing properties for legacy vertex attributes
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceLegacyVertexAttributesPropertiesEXT' 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
-- 'PhysicalDeviceLegacyVertexAttributesPropertiesEXT', 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_EXT_legacy_vertex_attributes VK_EXT_legacy_vertex_attributes>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceLegacyVertexAttributesPropertiesEXT = PhysicalDeviceLegacyVertexAttributesPropertiesEXT
  { -- | #limits-nativeUnalignedPerformance# @nativeUnalignedPerformance@
    -- specifies whether unaligned vertex fetches do not incur significant
    -- performance penalties as compared to aligned fetches.
    PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
nativeUnalignedPerformance :: Bool }
  deriving (Typeable, PhysicalDeviceLegacyVertexAttributesPropertiesEXT
-> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
(PhysicalDeviceLegacyVertexAttributesPropertiesEXT
 -> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool)
-> (PhysicalDeviceLegacyVertexAttributesPropertiesEXT
    -> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool)
-> Eq PhysicalDeviceLegacyVertexAttributesPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceLegacyVertexAttributesPropertiesEXT
-> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
== :: PhysicalDeviceLegacyVertexAttributesPropertiesEXT
-> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
$c/= :: PhysicalDeviceLegacyVertexAttributesPropertiesEXT
-> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
/= :: PhysicalDeviceLegacyVertexAttributesPropertiesEXT
-> PhysicalDeviceLegacyVertexAttributesPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLegacyVertexAttributesPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceLegacyVertexAttributesPropertiesEXT

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

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

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


type EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION"
pattern EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION :: forall a . Integral a => a
pattern $mEXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION :: forall a. Integral a => a
EXT_LEGACY_VERTEX_ATTRIBUTES_SPEC_VERSION = 1


type EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME = "VK_EXT_legacy_vertex_attributes"

-- No documentation found for TopLevel "VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME"
pattern EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mEXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME = "VK_EXT_legacy_vertex_attributes"