{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeSynonymInstances #-}

module Data.SpirV.Enum.RayFlags where

import Data.Bits (Bits, FiniteBits, (.|.))
import Data.Word (Word32)
import Foreign.Storable (Storable)

type RayFlags = RayFlagsBits

newtype RayFlagsBits = RayFlagsBits Word32
  deriving newtype (RayFlagsBits -> RayFlagsBits -> Bool
(RayFlagsBits -> RayFlagsBits -> Bool)
-> (RayFlagsBits -> RayFlagsBits -> Bool) -> Eq RayFlagsBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RayFlagsBits -> RayFlagsBits -> Bool
== :: RayFlagsBits -> RayFlagsBits -> Bool
$c/= :: RayFlagsBits -> RayFlagsBits -> Bool
/= :: RayFlagsBits -> RayFlagsBits -> Bool
Eq, Eq RayFlagsBits
Eq RayFlagsBits =>
(RayFlagsBits -> RayFlagsBits -> Ordering)
-> (RayFlagsBits -> RayFlagsBits -> Bool)
-> (RayFlagsBits -> RayFlagsBits -> Bool)
-> (RayFlagsBits -> RayFlagsBits -> Bool)
-> (RayFlagsBits -> RayFlagsBits -> Bool)
-> (RayFlagsBits -> RayFlagsBits -> RayFlagsBits)
-> (RayFlagsBits -> RayFlagsBits -> RayFlagsBits)
-> Ord RayFlagsBits
RayFlagsBits -> RayFlagsBits -> Bool
RayFlagsBits -> RayFlagsBits -> Ordering
RayFlagsBits -> RayFlagsBits -> RayFlagsBits
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
$ccompare :: RayFlagsBits -> RayFlagsBits -> Ordering
compare :: RayFlagsBits -> RayFlagsBits -> Ordering
$c< :: RayFlagsBits -> RayFlagsBits -> Bool
< :: RayFlagsBits -> RayFlagsBits -> Bool
$c<= :: RayFlagsBits -> RayFlagsBits -> Bool
<= :: RayFlagsBits -> RayFlagsBits -> Bool
$c> :: RayFlagsBits -> RayFlagsBits -> Bool
> :: RayFlagsBits -> RayFlagsBits -> Bool
$c>= :: RayFlagsBits -> RayFlagsBits -> Bool
>= :: RayFlagsBits -> RayFlagsBits -> Bool
$cmax :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
max :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
$cmin :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
min :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
Ord, Ptr RayFlagsBits -> IO RayFlagsBits
Ptr RayFlagsBits -> Int -> IO RayFlagsBits
Ptr RayFlagsBits -> Int -> RayFlagsBits -> IO ()
Ptr RayFlagsBits -> RayFlagsBits -> IO ()
RayFlagsBits -> Int
(RayFlagsBits -> Int)
-> (RayFlagsBits -> Int)
-> (Ptr RayFlagsBits -> Int -> IO RayFlagsBits)
-> (Ptr RayFlagsBits -> Int -> RayFlagsBits -> IO ())
-> (forall b. Ptr b -> Int -> IO RayFlagsBits)
-> (forall b. Ptr b -> Int -> RayFlagsBits -> IO ())
-> (Ptr RayFlagsBits -> IO RayFlagsBits)
-> (Ptr RayFlagsBits -> RayFlagsBits -> IO ())
-> Storable RayFlagsBits
forall b. Ptr b -> Int -> IO RayFlagsBits
forall b. Ptr b -> Int -> RayFlagsBits -> 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
$csizeOf :: RayFlagsBits -> Int
sizeOf :: RayFlagsBits -> Int
$calignment :: RayFlagsBits -> Int
alignment :: RayFlagsBits -> Int
$cpeekElemOff :: Ptr RayFlagsBits -> Int -> IO RayFlagsBits
peekElemOff :: Ptr RayFlagsBits -> Int -> IO RayFlagsBits
$cpokeElemOff :: Ptr RayFlagsBits -> Int -> RayFlagsBits -> IO ()
pokeElemOff :: Ptr RayFlagsBits -> Int -> RayFlagsBits -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO RayFlagsBits
peekByteOff :: forall b. Ptr b -> Int -> IO RayFlagsBits
$cpokeByteOff :: forall b. Ptr b -> Int -> RayFlagsBits -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> RayFlagsBits -> IO ()
$cpeek :: Ptr RayFlagsBits -> IO RayFlagsBits
peek :: Ptr RayFlagsBits -> IO RayFlagsBits
$cpoke :: Ptr RayFlagsBits -> RayFlagsBits -> IO ()
poke :: Ptr RayFlagsBits -> RayFlagsBits -> IO ()
Storable, Eq RayFlagsBits
RayFlagsBits
Eq RayFlagsBits =>
(RayFlagsBits -> RayFlagsBits -> RayFlagsBits)
-> (RayFlagsBits -> RayFlagsBits -> RayFlagsBits)
-> (RayFlagsBits -> RayFlagsBits -> RayFlagsBits)
-> (RayFlagsBits -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> RayFlagsBits
-> (Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> Bool)
-> (RayFlagsBits -> Maybe Int)
-> (RayFlagsBits -> Int)
-> (RayFlagsBits -> Bool)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int -> RayFlagsBits)
-> (RayFlagsBits -> Int)
-> Bits RayFlagsBits
Int -> RayFlagsBits
RayFlagsBits -> Bool
RayFlagsBits -> Int
RayFlagsBits -> Maybe Int
RayFlagsBits -> RayFlagsBits
RayFlagsBits -> Int -> Bool
RayFlagsBits -> Int -> RayFlagsBits
RayFlagsBits -> RayFlagsBits -> RayFlagsBits
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
$c.&. :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
.&. :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
$c.|. :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
.|. :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
$cxor :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
xor :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
$ccomplement :: RayFlagsBits -> RayFlagsBits
complement :: RayFlagsBits -> RayFlagsBits
$cshift :: RayFlagsBits -> Int -> RayFlagsBits
shift :: RayFlagsBits -> Int -> RayFlagsBits
$crotate :: RayFlagsBits -> Int -> RayFlagsBits
rotate :: RayFlagsBits -> Int -> RayFlagsBits
$czeroBits :: RayFlagsBits
zeroBits :: RayFlagsBits
$cbit :: Int -> RayFlagsBits
bit :: Int -> RayFlagsBits
$csetBit :: RayFlagsBits -> Int -> RayFlagsBits
setBit :: RayFlagsBits -> Int -> RayFlagsBits
$cclearBit :: RayFlagsBits -> Int -> RayFlagsBits
clearBit :: RayFlagsBits -> Int -> RayFlagsBits
$ccomplementBit :: RayFlagsBits -> Int -> RayFlagsBits
complementBit :: RayFlagsBits -> Int -> RayFlagsBits
$ctestBit :: RayFlagsBits -> Int -> Bool
testBit :: RayFlagsBits -> Int -> Bool
$cbitSizeMaybe :: RayFlagsBits -> Maybe Int
bitSizeMaybe :: RayFlagsBits -> Maybe Int
$cbitSize :: RayFlagsBits -> Int
bitSize :: RayFlagsBits -> Int
$cisSigned :: RayFlagsBits -> Bool
isSigned :: RayFlagsBits -> Bool
$cshiftL :: RayFlagsBits -> Int -> RayFlagsBits
shiftL :: RayFlagsBits -> Int -> RayFlagsBits
$cunsafeShiftL :: RayFlagsBits -> Int -> RayFlagsBits
unsafeShiftL :: RayFlagsBits -> Int -> RayFlagsBits
$cshiftR :: RayFlagsBits -> Int -> RayFlagsBits
shiftR :: RayFlagsBits -> Int -> RayFlagsBits
$cunsafeShiftR :: RayFlagsBits -> Int -> RayFlagsBits
unsafeShiftR :: RayFlagsBits -> Int -> RayFlagsBits
$crotateL :: RayFlagsBits -> Int -> RayFlagsBits
rotateL :: RayFlagsBits -> Int -> RayFlagsBits
$crotateR :: RayFlagsBits -> Int -> RayFlagsBits
rotateR :: RayFlagsBits -> Int -> RayFlagsBits
$cpopCount :: RayFlagsBits -> Int
popCount :: RayFlagsBits -> Int
Bits, Bits RayFlagsBits
Bits RayFlagsBits =>
(RayFlagsBits -> Int)
-> (RayFlagsBits -> Int)
-> (RayFlagsBits -> Int)
-> FiniteBits RayFlagsBits
RayFlagsBits -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: RayFlagsBits -> Int
finiteBitSize :: RayFlagsBits -> Int
$ccountLeadingZeros :: RayFlagsBits -> Int
countLeadingZeros :: RayFlagsBits -> Int
$ccountTrailingZeros :: RayFlagsBits -> Int
countTrailingZeros :: RayFlagsBits -> Int
FiniteBits)

instance Semigroup RayFlags where
  (RayFlagsBits Word32
a) <> :: RayFlagsBits -> RayFlagsBits -> RayFlagsBits
<> (RayFlagsBits Word32
b) = Word32 -> RayFlagsBits
RayFlagsBits (Word32
a Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
b)

instance Monoid RayFlags where
  mempty :: RayFlagsBits
mempty = Word32 -> RayFlagsBits
RayFlagsBits Word32
0

pattern OpaqueKHR :: RayFlagsBits
pattern $mOpaqueKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bOpaqueKHR :: RayFlagsBits
OpaqueKHR = RayFlagsBits 0x00000001

pattern NoOpaqueKHR :: RayFlagsBits
pattern $mNoOpaqueKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bNoOpaqueKHR :: RayFlagsBits
NoOpaqueKHR = RayFlagsBits 0x00000002

pattern TerminateOnFirstHitKHR :: RayFlagsBits
pattern $mTerminateOnFirstHitKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bTerminateOnFirstHitKHR :: RayFlagsBits
TerminateOnFirstHitKHR = RayFlagsBits 0x00000004

pattern SkipClosestHitShaderKHR :: RayFlagsBits
pattern $mSkipClosestHitShaderKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bSkipClosestHitShaderKHR :: RayFlagsBits
SkipClosestHitShaderKHR = RayFlagsBits 0x00000008

pattern CullBackFacingTrianglesKHR :: RayFlagsBits
pattern $mCullBackFacingTrianglesKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bCullBackFacingTrianglesKHR :: RayFlagsBits
CullBackFacingTrianglesKHR = RayFlagsBits 0x00000010

pattern CullFrontFacingTrianglesKHR :: RayFlagsBits
pattern $mCullFrontFacingTrianglesKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bCullFrontFacingTrianglesKHR :: RayFlagsBits
CullFrontFacingTrianglesKHR = RayFlagsBits 0x00000020

pattern CullOpaqueKHR :: RayFlagsBits
pattern $mCullOpaqueKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bCullOpaqueKHR :: RayFlagsBits
CullOpaqueKHR = RayFlagsBits 0x00000040

pattern CullNoOpaqueKHR :: RayFlagsBits
pattern $mCullNoOpaqueKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bCullNoOpaqueKHR :: RayFlagsBits
CullNoOpaqueKHR = RayFlagsBits 0x00000080

pattern SkipTrianglesKHR :: RayFlagsBits
pattern $mSkipTrianglesKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bSkipTrianglesKHR :: RayFlagsBits
SkipTrianglesKHR = RayFlagsBits 0x00000100

pattern SkipAABBsKHR :: RayFlagsBits
pattern $mSkipAABBsKHR :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bSkipAABBsKHR :: RayFlagsBits
SkipAABBsKHR = RayFlagsBits 0x00000200

pattern ForceOpacityMicromap2StateEXT :: RayFlagsBits
pattern $mForceOpacityMicromap2StateEXT :: forall {r}. RayFlagsBits -> ((# #) -> r) -> ((# #) -> r) -> r
$bForceOpacityMicromap2StateEXT :: RayFlagsBits
ForceOpacityMicromap2StateEXT = RayFlagsBits 0x00000400