{-# language CPP #-}
module Vulkan.Core10.Enums.IndexType  (IndexType( INDEX_TYPE_UINT16
                                                , INDEX_TYPE_UINT32
                                                , INDEX_TYPE_UINT8_EXT
                                                , INDEX_TYPE_NONE_KHR
                                                , ..
                                                )) where

import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Zero (Zero)
-- | VkIndexType - Type of index buffer indices
--
-- = See Also
--
-- 'Vulkan.Extensions.VK_KHR_ray_tracing.AccelerationStructureCreateGeometryTypeInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing.AccelerationStructureGeometryTrianglesDataKHR',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.BindIndexBufferIndirectCommandNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.GeometryTrianglesNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.IndirectCommandsLayoutTokenNV',
-- 'Vulkan.Core10.CommandBufferBuilding.cmdBindIndexBuffer'
newtype IndexType = IndexType Int32
  deriving newtype (IndexType -> IndexType -> Bool
(IndexType -> IndexType -> Bool)
-> (IndexType -> IndexType -> Bool) -> Eq IndexType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexType -> IndexType -> Bool
$c/= :: IndexType -> IndexType -> Bool
== :: IndexType -> IndexType -> Bool
$c== :: IndexType -> IndexType -> Bool
Eq, Eq IndexType
Eq IndexType =>
(IndexType -> IndexType -> Ordering)
-> (IndexType -> IndexType -> Bool)
-> (IndexType -> IndexType -> Bool)
-> (IndexType -> IndexType -> Bool)
-> (IndexType -> IndexType -> Bool)
-> (IndexType -> IndexType -> IndexType)
-> (IndexType -> IndexType -> IndexType)
-> Ord IndexType
IndexType -> IndexType -> Bool
IndexType -> IndexType -> Ordering
IndexType -> IndexType -> IndexType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: IndexType -> IndexType -> IndexType
$cmin :: IndexType -> IndexType -> IndexType
max :: IndexType -> IndexType -> IndexType
$cmax :: IndexType -> IndexType -> IndexType
>= :: IndexType -> IndexType -> Bool
$c>= :: IndexType -> IndexType -> Bool
> :: IndexType -> IndexType -> Bool
$c> :: IndexType -> IndexType -> Bool
<= :: IndexType -> IndexType -> Bool
$c<= :: IndexType -> IndexType -> Bool
< :: IndexType -> IndexType -> Bool
$c< :: IndexType -> IndexType -> Bool
compare :: IndexType -> IndexType -> Ordering
$ccompare :: IndexType -> IndexType -> Ordering
$cp1Ord :: Eq IndexType
Ord, Ptr b -> Int -> IO IndexType
Ptr b -> Int -> IndexType -> IO ()
Ptr IndexType -> IO IndexType
Ptr IndexType -> Int -> IO IndexType
Ptr IndexType -> Int -> IndexType -> IO ()
Ptr IndexType -> IndexType -> IO ()
IndexType -> Int
(IndexType -> Int)
-> (IndexType -> Int)
-> (Ptr IndexType -> Int -> IO IndexType)
-> (Ptr IndexType -> Int -> IndexType -> IO ())
-> (forall b. Ptr b -> Int -> IO IndexType)
-> (forall b. Ptr b -> Int -> IndexType -> IO ())
-> (Ptr IndexType -> IO IndexType)
-> (Ptr IndexType -> IndexType -> IO ())
-> Storable IndexType
forall b. Ptr b -> Int -> IO IndexType
forall b. Ptr b -> Int -> IndexType -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr IndexType -> IndexType -> IO ()
$cpoke :: Ptr IndexType -> IndexType -> IO ()
peek :: Ptr IndexType -> IO IndexType
$cpeek :: Ptr IndexType -> IO IndexType
pokeByteOff :: Ptr b -> Int -> IndexType -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> IndexType -> IO ()
peekByteOff :: Ptr b -> Int -> IO IndexType
$cpeekByteOff :: forall b. Ptr b -> Int -> IO IndexType
pokeElemOff :: Ptr IndexType -> Int -> IndexType -> IO ()
$cpokeElemOff :: Ptr IndexType -> Int -> IndexType -> IO ()
peekElemOff :: Ptr IndexType -> Int -> IO IndexType
$cpeekElemOff :: Ptr IndexType -> Int -> IO IndexType
alignment :: IndexType -> Int
$calignment :: IndexType -> Int
sizeOf :: IndexType -> Int
$csizeOf :: IndexType -> Int
Storable, IndexType
IndexType -> Zero IndexType
forall a. a -> Zero a
zero :: IndexType
$czero :: IndexType
Zero)

-- | 'INDEX_TYPE_UINT16' specifies that indices are 16-bit unsigned integer
-- values.
pattern $bINDEX_TYPE_UINT16 :: IndexType
$mINDEX_TYPE_UINT16 :: forall r. IndexType -> (Void# -> r) -> (Void# -> r) -> r
INDEX_TYPE_UINT16 = IndexType 0
-- | 'INDEX_TYPE_UINT32' specifies that indices are 32-bit unsigned integer
-- values.
pattern $bINDEX_TYPE_UINT32 :: IndexType
$mINDEX_TYPE_UINT32 :: forall r. IndexType -> (Void# -> r) -> (Void# -> r) -> r
INDEX_TYPE_UINT32 = IndexType 1
-- | 'INDEX_TYPE_UINT8_EXT' specifies that indices are 8-bit unsigned integer
-- values.
pattern $bINDEX_TYPE_UINT8_EXT :: IndexType
$mINDEX_TYPE_UINT8_EXT :: forall r. IndexType -> (Void# -> r) -> (Void# -> r) -> r
INDEX_TYPE_UINT8_EXT = IndexType 1000265000
-- | 'INDEX_TYPE_NONE_KHR' specifies that no indices are provided.
pattern $bINDEX_TYPE_NONE_KHR :: IndexType
$mINDEX_TYPE_NONE_KHR :: forall r. IndexType -> (Void# -> r) -> (Void# -> r) -> r
INDEX_TYPE_NONE_KHR = IndexType 1000165000
{-# complete INDEX_TYPE_UINT16,
             INDEX_TYPE_UINT32,
             INDEX_TYPE_UINT8_EXT,
             INDEX_TYPE_NONE_KHR :: IndexType #-}

instance Show IndexType where
  showsPrec :: Int -> IndexType -> ShowS
showsPrec p :: Int
p = \case
    INDEX_TYPE_UINT16 -> String -> ShowS
showString "INDEX_TYPE_UINT16"
    INDEX_TYPE_UINT32 -> String -> ShowS
showString "INDEX_TYPE_UINT32"
    INDEX_TYPE_UINT8_EXT -> String -> ShowS
showString "INDEX_TYPE_UINT8_EXT"
    INDEX_TYPE_NONE_KHR -> String -> ShowS
showString "INDEX_TYPE_NONE_KHR"
    IndexType x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "IndexType " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read IndexType where
  readPrec :: ReadPrec IndexType
readPrec = ReadPrec IndexType -> ReadPrec IndexType
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec IndexType)] -> ReadPrec IndexType
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("INDEX_TYPE_UINT16", IndexType -> ReadPrec IndexType
forall (f :: * -> *) a. Applicative f => a -> f a
pure IndexType
INDEX_TYPE_UINT16)
                            , ("INDEX_TYPE_UINT32", IndexType -> ReadPrec IndexType
forall (f :: * -> *) a. Applicative f => a -> f a
pure IndexType
INDEX_TYPE_UINT32)
                            , ("INDEX_TYPE_UINT8_EXT", IndexType -> ReadPrec IndexType
forall (f :: * -> *) a. Applicative f => a -> f a
pure IndexType
INDEX_TYPE_UINT8_EXT)
                            , ("INDEX_TYPE_NONE_KHR", IndexType -> ReadPrec IndexType
forall (f :: * -> *) a. Applicative f => a -> f a
pure IndexType
INDEX_TYPE_NONE_KHR)]
                     ReadPrec IndexType -> ReadPrec IndexType -> ReadPrec IndexType
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec IndexType -> ReadPrec IndexType
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "IndexType")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       IndexType -> ReadPrec IndexType
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> IndexType
IndexType Int32
v)))