{-# language CPP #-}
module Graphics.Vulkan.Core11.Enums.SubgroupFeatureFlagBits ( SubgroupFeatureFlagBits( SUBGROUP_FEATURE_BASIC_BIT
, SUBGROUP_FEATURE_VOTE_BIT
, SUBGROUP_FEATURE_ARITHMETIC_BIT
, SUBGROUP_FEATURE_BALLOT_BIT
, SUBGROUP_FEATURE_SHUFFLE_BIT
, SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT
, SUBGROUP_FEATURE_CLUSTERED_BIT
, SUBGROUP_FEATURE_QUAD_BIT
, SUBGROUP_FEATURE_PARTITIONED_BIT_NV
, ..
)
, SubgroupFeatureFlags
) 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 Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.Zero (Zero)
newtype SubgroupFeatureFlagBits = SubgroupFeatureFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern SUBGROUP_FEATURE_BASIC_BIT = SubgroupFeatureFlagBits 0x00000001
pattern SUBGROUP_FEATURE_VOTE_BIT = SubgroupFeatureFlagBits 0x00000002
pattern SUBGROUP_FEATURE_ARITHMETIC_BIT = SubgroupFeatureFlagBits 0x00000004
pattern SUBGROUP_FEATURE_BALLOT_BIT = SubgroupFeatureFlagBits 0x00000008
pattern SUBGROUP_FEATURE_SHUFFLE_BIT = SubgroupFeatureFlagBits 0x00000010
pattern SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = SubgroupFeatureFlagBits 0x00000020
pattern SUBGROUP_FEATURE_CLUSTERED_BIT = SubgroupFeatureFlagBits 0x00000040
pattern SUBGROUP_FEATURE_QUAD_BIT = SubgroupFeatureFlagBits 0x00000080
pattern SUBGROUP_FEATURE_PARTITIONED_BIT_NV = SubgroupFeatureFlagBits 0x00000100
type SubgroupFeatureFlags = SubgroupFeatureFlagBits
instance Show SubgroupFeatureFlagBits where
showsPrec p = \case
SUBGROUP_FEATURE_BASIC_BIT -> showString "SUBGROUP_FEATURE_BASIC_BIT"
SUBGROUP_FEATURE_VOTE_BIT -> showString "SUBGROUP_FEATURE_VOTE_BIT"
SUBGROUP_FEATURE_ARITHMETIC_BIT -> showString "SUBGROUP_FEATURE_ARITHMETIC_BIT"
SUBGROUP_FEATURE_BALLOT_BIT -> showString "SUBGROUP_FEATURE_BALLOT_BIT"
SUBGROUP_FEATURE_SHUFFLE_BIT -> showString "SUBGROUP_FEATURE_SHUFFLE_BIT"
SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT -> showString "SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT"
SUBGROUP_FEATURE_CLUSTERED_BIT -> showString "SUBGROUP_FEATURE_CLUSTERED_BIT"
SUBGROUP_FEATURE_QUAD_BIT -> showString "SUBGROUP_FEATURE_QUAD_BIT"
SUBGROUP_FEATURE_PARTITIONED_BIT_NV -> showString "SUBGROUP_FEATURE_PARTITIONED_BIT_NV"
SubgroupFeatureFlagBits x -> showParen (p >= 11) (showString "SubgroupFeatureFlagBits 0x" . showHex x)
instance Read SubgroupFeatureFlagBits where
readPrec = parens (choose [("SUBGROUP_FEATURE_BASIC_BIT", pure SUBGROUP_FEATURE_BASIC_BIT)
, ("SUBGROUP_FEATURE_VOTE_BIT", pure SUBGROUP_FEATURE_VOTE_BIT)
, ("SUBGROUP_FEATURE_ARITHMETIC_BIT", pure SUBGROUP_FEATURE_ARITHMETIC_BIT)
, ("SUBGROUP_FEATURE_BALLOT_BIT", pure SUBGROUP_FEATURE_BALLOT_BIT)
, ("SUBGROUP_FEATURE_SHUFFLE_BIT", pure SUBGROUP_FEATURE_SHUFFLE_BIT)
, ("SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT", pure SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT)
, ("SUBGROUP_FEATURE_CLUSTERED_BIT", pure SUBGROUP_FEATURE_CLUSTERED_BIT)
, ("SUBGROUP_FEATURE_QUAD_BIT", pure SUBGROUP_FEATURE_QUAD_BIT)
, ("SUBGROUP_FEATURE_PARTITIONED_BIT_NV", pure SUBGROUP_FEATURE_PARTITIONED_BIT_NV)]
+++
prec 10 (do
expectP (Ident "SubgroupFeatureFlagBits")
v <- step readPrec
pure (SubgroupFeatureFlagBits v)))