{-# language CPP #-}
module Vulkan.Core10.Enums.SampleCountFlagBits  ( SampleCountFlagBits( SAMPLE_COUNT_1_BIT
                                                                     , SAMPLE_COUNT_2_BIT
                                                                     , SAMPLE_COUNT_4_BIT
                                                                     , SAMPLE_COUNT_8_BIT
                                                                     , SAMPLE_COUNT_16_BIT
                                                                     , SAMPLE_COUNT_32_BIT
                                                                     , SAMPLE_COUNT_64_BIT
                                                                     , ..
                                                                     )
                                                , SampleCountFlags
                                                ) where

import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Zero (Zero)
-- | VkSampleCountFlagBits - Bitmask specifying sample counts supported for
-- an image used for storage operations
--
-- = See Also
--
-- 'Vulkan.Core10.Pass.AttachmentDescription',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentDescription2',
-- 'Vulkan.Extensions.VK_NV_coverage_reduction_mode.FramebufferMixedSamplesCombinationNV',
-- 'Vulkan.Core10.Image.ImageCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceSparseImageFormatInfo2',
-- 'Vulkan.Core10.Pipeline.PipelineMultisampleStateCreateInfo',
-- 'SampleCountFlags',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.SampleLocationsInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.getPhysicalDeviceMultisamplePropertiesEXT',
-- 'Vulkan.Core10.SparseResourceMemoryManagement.getPhysicalDeviceSparseImageFormatProperties'
newtype SampleCountFlagBits = SampleCountFlagBits Flags
  deriving newtype (SampleCountFlagBits -> SampleCountFlagBits -> Bool
(SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> Eq SampleCountFlagBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c/= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
== :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c== :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
Eq, Eq SampleCountFlagBits
Eq SampleCountFlagBits =>
(SampleCountFlagBits -> SampleCountFlagBits -> Ordering)
-> (SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits -> SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits
    -> SampleCountFlagBits -> SampleCountFlagBits)
-> (SampleCountFlagBits
    -> SampleCountFlagBits -> SampleCountFlagBits)
-> Ord SampleCountFlagBits
SampleCountFlagBits -> SampleCountFlagBits -> Bool
SampleCountFlagBits -> SampleCountFlagBits -> Ordering
SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
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 :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$cmin :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
max :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$cmax :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
>= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c>= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
> :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c> :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
<= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c<= :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
< :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
$c< :: SampleCountFlagBits -> SampleCountFlagBits -> Bool
compare :: SampleCountFlagBits -> SampleCountFlagBits -> Ordering
$ccompare :: SampleCountFlagBits -> SampleCountFlagBits -> Ordering
$cp1Ord :: Eq SampleCountFlagBits
Ord, Ptr b -> Int -> IO SampleCountFlagBits
Ptr b -> Int -> SampleCountFlagBits -> IO ()
Ptr SampleCountFlagBits -> IO SampleCountFlagBits
Ptr SampleCountFlagBits -> Int -> IO SampleCountFlagBits
Ptr SampleCountFlagBits -> Int -> SampleCountFlagBits -> IO ()
Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
SampleCountFlagBits -> Int
(SampleCountFlagBits -> Int)
-> (SampleCountFlagBits -> Int)
-> (Ptr SampleCountFlagBits -> Int -> IO SampleCountFlagBits)
-> (Ptr SampleCountFlagBits -> Int -> SampleCountFlagBits -> IO ())
-> (forall b. Ptr b -> Int -> IO SampleCountFlagBits)
-> (forall b. Ptr b -> Int -> SampleCountFlagBits -> IO ())
-> (Ptr SampleCountFlagBits -> IO SampleCountFlagBits)
-> (Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ())
-> Storable SampleCountFlagBits
forall b. Ptr b -> Int -> IO SampleCountFlagBits
forall b. Ptr b -> Int -> SampleCountFlagBits -> 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 SampleCountFlagBits -> SampleCountFlagBits -> IO ()
$cpoke :: Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
peek :: Ptr SampleCountFlagBits -> IO SampleCountFlagBits
$cpeek :: Ptr SampleCountFlagBits -> IO SampleCountFlagBits
pokeByteOff :: Ptr b -> Int -> SampleCountFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> SampleCountFlagBits -> IO ()
peekByteOff :: Ptr b -> Int -> IO SampleCountFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SampleCountFlagBits
pokeElemOff :: Ptr SampleCountFlagBits -> Int -> SampleCountFlagBits -> IO ()
$cpokeElemOff :: Ptr SampleCountFlagBits -> Int -> SampleCountFlagBits -> IO ()
peekElemOff :: Ptr SampleCountFlagBits -> Int -> IO SampleCountFlagBits
$cpeekElemOff :: Ptr SampleCountFlagBits -> Int -> IO SampleCountFlagBits
alignment :: SampleCountFlagBits -> Int
$calignment :: SampleCountFlagBits -> Int
sizeOf :: SampleCountFlagBits -> Int
$csizeOf :: SampleCountFlagBits -> Int
Storable, SampleCountFlagBits
SampleCountFlagBits -> Zero SampleCountFlagBits
forall a. a -> Zero a
zero :: SampleCountFlagBits
$czero :: SampleCountFlagBits
Zero, Eq SampleCountFlagBits
SampleCountFlagBits
Eq SampleCountFlagBits =>
(SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits)
-> (SampleCountFlagBits
    -> SampleCountFlagBits -> SampleCountFlagBits)
-> (SampleCountFlagBits
    -> SampleCountFlagBits -> SampleCountFlagBits)
-> (SampleCountFlagBits -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> SampleCountFlagBits
-> (Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> Bool)
-> (SampleCountFlagBits -> Maybe Int)
-> (SampleCountFlagBits -> Int)
-> (SampleCountFlagBits -> Bool)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int -> SampleCountFlagBits)
-> (SampleCountFlagBits -> Int)
-> Bits SampleCountFlagBits
Int -> SampleCountFlagBits
SampleCountFlagBits -> Bool
SampleCountFlagBits -> Int
SampleCountFlagBits -> Maybe Int
SampleCountFlagBits -> SampleCountFlagBits
SampleCountFlagBits -> Int -> Bool
SampleCountFlagBits -> Int -> SampleCountFlagBits
SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: SampleCountFlagBits -> Int
$cpopCount :: SampleCountFlagBits -> Int
rotateR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$crotateR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
rotateL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$crotateL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
unsafeShiftR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cunsafeShiftR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
shiftR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cshiftR :: SampleCountFlagBits -> Int -> SampleCountFlagBits
unsafeShiftL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cunsafeShiftL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
shiftL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cshiftL :: SampleCountFlagBits -> Int -> SampleCountFlagBits
isSigned :: SampleCountFlagBits -> Bool
$cisSigned :: SampleCountFlagBits -> Bool
bitSize :: SampleCountFlagBits -> Int
$cbitSize :: SampleCountFlagBits -> Int
bitSizeMaybe :: SampleCountFlagBits -> Maybe Int
$cbitSizeMaybe :: SampleCountFlagBits -> Maybe Int
testBit :: SampleCountFlagBits -> Int -> Bool
$ctestBit :: SampleCountFlagBits -> Int -> Bool
complementBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$ccomplementBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
clearBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cclearBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
setBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$csetBit :: SampleCountFlagBits -> Int -> SampleCountFlagBits
bit :: Int -> SampleCountFlagBits
$cbit :: Int -> SampleCountFlagBits
zeroBits :: SampleCountFlagBits
$czeroBits :: SampleCountFlagBits
rotate :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$crotate :: SampleCountFlagBits -> Int -> SampleCountFlagBits
shift :: SampleCountFlagBits -> Int -> SampleCountFlagBits
$cshift :: SampleCountFlagBits -> Int -> SampleCountFlagBits
complement :: SampleCountFlagBits -> SampleCountFlagBits
$ccomplement :: SampleCountFlagBits -> SampleCountFlagBits
xor :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$cxor :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
.|. :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$c.|. :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
.&. :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$c.&. :: SampleCountFlagBits -> SampleCountFlagBits -> SampleCountFlagBits
$cp1Bits :: Eq SampleCountFlagBits
Bits)

-- | 'SAMPLE_COUNT_1_BIT' specifies an image with one sample per pixel.
pattern $bSAMPLE_COUNT_1_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_1_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_1_BIT = SampleCountFlagBits 0x00000001
-- | 'SAMPLE_COUNT_2_BIT' specifies an image with 2 samples per pixel.
pattern $bSAMPLE_COUNT_2_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_2_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_2_BIT = SampleCountFlagBits 0x00000002
-- | 'SAMPLE_COUNT_4_BIT' specifies an image with 4 samples per pixel.
pattern $bSAMPLE_COUNT_4_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_4_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_4_BIT = SampleCountFlagBits 0x00000004
-- | 'SAMPLE_COUNT_8_BIT' specifies an image with 8 samples per pixel.
pattern $bSAMPLE_COUNT_8_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_8_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_8_BIT = SampleCountFlagBits 0x00000008
-- | 'SAMPLE_COUNT_16_BIT' specifies an image with 16 samples per pixel.
pattern $bSAMPLE_COUNT_16_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_16_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_16_BIT = SampleCountFlagBits 0x00000010
-- | 'SAMPLE_COUNT_32_BIT' specifies an image with 32 samples per pixel.
pattern $bSAMPLE_COUNT_32_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_32_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_32_BIT = SampleCountFlagBits 0x00000020
-- | 'SAMPLE_COUNT_64_BIT' specifies an image with 64 samples per pixel.
pattern $bSAMPLE_COUNT_64_BIT :: SampleCountFlagBits
$mSAMPLE_COUNT_64_BIT :: forall r. SampleCountFlagBits -> (Void# -> r) -> (Void# -> r) -> r
SAMPLE_COUNT_64_BIT = SampleCountFlagBits 0x00000040

type SampleCountFlags = SampleCountFlagBits

instance Show SampleCountFlagBits where
  showsPrec :: Int -> SampleCountFlagBits -> ShowS
showsPrec p :: Int
p = \case
    SAMPLE_COUNT_1_BIT -> String -> ShowS
showString "SAMPLE_COUNT_1_BIT"
    SAMPLE_COUNT_2_BIT -> String -> ShowS
showString "SAMPLE_COUNT_2_BIT"
    SAMPLE_COUNT_4_BIT -> String -> ShowS
showString "SAMPLE_COUNT_4_BIT"
    SAMPLE_COUNT_8_BIT -> String -> ShowS
showString "SAMPLE_COUNT_8_BIT"
    SAMPLE_COUNT_16_BIT -> String -> ShowS
showString "SAMPLE_COUNT_16_BIT"
    SAMPLE_COUNT_32_BIT -> String -> ShowS
showString "SAMPLE_COUNT_32_BIT"
    SAMPLE_COUNT_64_BIT -> String -> ShowS
showString "SAMPLE_COUNT_64_BIT"
    SampleCountFlagBits x :: Flags
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "SampleCountFlagBits 0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flags -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read SampleCountFlagBits where
  readPrec :: ReadPrec SampleCountFlagBits
readPrec = ReadPrec SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec SampleCountFlagBits)]
-> ReadPrec SampleCountFlagBits
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("SAMPLE_COUNT_1_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_1_BIT)
                            , ("SAMPLE_COUNT_2_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_2_BIT)
                            , ("SAMPLE_COUNT_4_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_4_BIT)
                            , ("SAMPLE_COUNT_8_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_8_BIT)
                            , ("SAMPLE_COUNT_16_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_16_BIT)
                            , ("SAMPLE_COUNT_32_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_32_BIT)
                            , ("SAMPLE_COUNT_64_BIT", SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure SampleCountFlagBits
SAMPLE_COUNT_64_BIT)]
                     ReadPrec SampleCountFlagBits
-> ReadPrec SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "SampleCountFlagBits")
                       Flags
v <- ReadPrec Flags -> ReadPrec Flags
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Flags
forall a. Read a => ReadPrec a
readPrec
                       SampleCountFlagBits -> ReadPrec SampleCountFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Flags -> SampleCountFlagBits
SampleCountFlagBits Flags
v)))