{-# language CPP #-}
-- | = Name
--
-- VK_EXT_index_type_uint8 - device extension
--
-- == VK_EXT_index_type_uint8
--
-- [__Name String__]
--     @VK_EXT_index_type_uint8@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     266
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
-- [__Contact__]
--
--     -   Piers Daniell
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_index_type_uint8] @pdaniell-nv%0A*Here describe the issue or question you have about the VK_EXT_index_type_uint8 extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2019-05-02
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Jeff Bolz, NVIDIA
--
-- == Description
--
-- This extension allows @uint8_t@ indices to be used with
-- 'Vulkan.Core10.CommandBufferBuilding.cmdBindIndexBuffer'.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceIndexTypeUint8FeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_INDEX_TYPE_UINT8_EXTENSION_NAME'
--
-- -   'EXT_INDEX_TYPE_UINT8_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.IndexType.IndexType':
--
--     -   'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT8_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT'
--
-- == Version History
--
-- -   Revision 1, 2019-05-02 (Piers Daniell)
--
--     -   Internal revisions
--
-- == See Also
--
-- 'PhysicalDeviceIndexTypeUint8FeaturesEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_index_type_uint8 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_index_type_uint8  ( PhysicalDeviceIndexTypeUint8FeaturesEXT(..)
                                                  , EXT_INDEX_TYPE_UINT8_SPEC_VERSION
                                                  , pattern EXT_INDEX_TYPE_UINT8_SPEC_VERSION
                                                  , EXT_INDEX_TYPE_UINT8_EXTENSION_NAME
                                                  , pattern EXT_INDEX_TYPE_UINT8_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_INDEX_TYPE_UINT8_FEATURES_EXT))
-- | VkPhysicalDeviceIndexTypeUint8FeaturesEXT - Structure describing whether
-- uint8 index type can be used
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceIndexTypeUint8FeaturesEXT' 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. 'PhysicalDeviceIndexTypeUint8FeaturesEXT' /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_EXT_index_type_uint8 VK_EXT_index_type_uint8>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceIndexTypeUint8FeaturesEXT = PhysicalDeviceIndexTypeUint8FeaturesEXT
  { -- | #features-indexTypeUint8# @indexTypeUint8@ indicates that
    -- 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT8_EXT' can be used with
    -- 'Vulkan.Core10.CommandBufferBuilding.cmdBindIndexBuffer'.
    PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
indexTypeUint8 :: Bool }
  deriving (Typeable, PhysicalDeviceIndexTypeUint8FeaturesEXT
-> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
(PhysicalDeviceIndexTypeUint8FeaturesEXT
 -> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool)
-> (PhysicalDeviceIndexTypeUint8FeaturesEXT
    -> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool)
-> Eq PhysicalDeviceIndexTypeUint8FeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceIndexTypeUint8FeaturesEXT
-> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
$c/= :: PhysicalDeviceIndexTypeUint8FeaturesEXT
-> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
== :: PhysicalDeviceIndexTypeUint8FeaturesEXT
-> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
$c== :: PhysicalDeviceIndexTypeUint8FeaturesEXT
-> PhysicalDeviceIndexTypeUint8FeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceIndexTypeUint8FeaturesEXT)
#endif
deriving instance Show PhysicalDeviceIndexTypeUint8FeaturesEXT

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

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

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


type EXT_INDEX_TYPE_UINT8_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION"
pattern EXT_INDEX_TYPE_UINT8_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_INDEX_TYPE_UINT8_SPEC_VERSION :: forall a. Integral a => a
$mEXT_INDEX_TYPE_UINT8_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_INDEX_TYPE_UINT8_SPEC_VERSION = 1


type EXT_INDEX_TYPE_UINT8_EXTENSION_NAME = "VK_EXT_index_type_uint8"

-- No documentation found for TopLevel "VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME"
pattern EXT_INDEX_TYPE_UINT8_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_INDEX_TYPE_UINT8_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_INDEX_TYPE_UINT8_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_INDEX_TYPE_UINT8_EXTENSION_NAME = "VK_EXT_index_type_uint8"