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

module Data.SpirV.Enum.SamplerAddressingMode where

import Data.Word (Word32)
import Foreign.Storable (Storable)

newtype SamplerAddressingMode = SamplerAddressingMode Word32
  deriving newtype (SamplerAddressingMode -> SamplerAddressingMode -> Bool
(SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> (SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> Eq SamplerAddressingMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
== :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
$c/= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
/= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
Eq, Eq SamplerAddressingMode
Eq SamplerAddressingMode =>
(SamplerAddressingMode -> SamplerAddressingMode -> Ordering)
-> (SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> (SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> (SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> (SamplerAddressingMode -> SamplerAddressingMode -> Bool)
-> (SamplerAddressingMode
    -> SamplerAddressingMode -> SamplerAddressingMode)
-> (SamplerAddressingMode
    -> SamplerAddressingMode -> SamplerAddressingMode)
-> Ord SamplerAddressingMode
SamplerAddressingMode -> SamplerAddressingMode -> Bool
SamplerAddressingMode -> SamplerAddressingMode -> Ordering
SamplerAddressingMode
-> SamplerAddressingMode -> SamplerAddressingMode
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 :: SamplerAddressingMode -> SamplerAddressingMode -> Ordering
compare :: SamplerAddressingMode -> SamplerAddressingMode -> Ordering
$c< :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
< :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
$c<= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
<= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
$c> :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
> :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
$c>= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
>= :: SamplerAddressingMode -> SamplerAddressingMode -> Bool
$cmax :: SamplerAddressingMode
-> SamplerAddressingMode -> SamplerAddressingMode
max :: SamplerAddressingMode
-> SamplerAddressingMode -> SamplerAddressingMode
$cmin :: SamplerAddressingMode
-> SamplerAddressingMode -> SamplerAddressingMode
min :: SamplerAddressingMode
-> SamplerAddressingMode -> SamplerAddressingMode
Ord, Ptr SamplerAddressingMode -> IO SamplerAddressingMode
Ptr SamplerAddressingMode -> Int -> IO SamplerAddressingMode
Ptr SamplerAddressingMode -> Int -> SamplerAddressingMode -> IO ()
Ptr SamplerAddressingMode -> SamplerAddressingMode -> IO ()
SamplerAddressingMode -> Int
(SamplerAddressingMode -> Int)
-> (SamplerAddressingMode -> Int)
-> (Ptr SamplerAddressingMode -> Int -> IO SamplerAddressingMode)
-> (Ptr SamplerAddressingMode
    -> Int -> SamplerAddressingMode -> IO ())
-> (forall b. Ptr b -> Int -> IO SamplerAddressingMode)
-> (forall b. Ptr b -> Int -> SamplerAddressingMode -> IO ())
-> (Ptr SamplerAddressingMode -> IO SamplerAddressingMode)
-> (Ptr SamplerAddressingMode -> SamplerAddressingMode -> IO ())
-> Storable SamplerAddressingMode
forall b. Ptr b -> Int -> IO SamplerAddressingMode
forall b. Ptr b -> Int -> SamplerAddressingMode -> 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 :: SamplerAddressingMode -> Int
sizeOf :: SamplerAddressingMode -> Int
$calignment :: SamplerAddressingMode -> Int
alignment :: SamplerAddressingMode -> Int
$cpeekElemOff :: Ptr SamplerAddressingMode -> Int -> IO SamplerAddressingMode
peekElemOff :: Ptr SamplerAddressingMode -> Int -> IO SamplerAddressingMode
$cpokeElemOff :: Ptr SamplerAddressingMode -> Int -> SamplerAddressingMode -> IO ()
pokeElemOff :: Ptr SamplerAddressingMode -> Int -> SamplerAddressingMode -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SamplerAddressingMode
peekByteOff :: forall b. Ptr b -> Int -> IO SamplerAddressingMode
$cpokeByteOff :: forall b. Ptr b -> Int -> SamplerAddressingMode -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SamplerAddressingMode -> IO ()
$cpeek :: Ptr SamplerAddressingMode -> IO SamplerAddressingMode
peek :: Ptr SamplerAddressingMode -> IO SamplerAddressingMode
$cpoke :: Ptr SamplerAddressingMode -> SamplerAddressingMode -> IO ()
poke :: Ptr SamplerAddressingMode -> SamplerAddressingMode -> IO ()
Storable)

instance Show SamplerAddressingMode where
  showsPrec :: Int -> SamplerAddressingMode -> ShowS
showsPrec Int
p (SamplerAddressingMode Word32
v) = case Word32
v of
    Word32
0 -> String -> ShowS
showString String
"None"
    Word32
1 -> String -> ShowS
showString String
"ClampToEdge"
    Word32
2 -> String -> ShowS
showString String
"Clamp"
    Word32
3 -> String -> ShowS
showString String
"Repeat"
    Word32
4 -> String -> ShowS
showString String
"RepeatMirrored"
    Word32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String -> ShowS
showString String
"SamplerAddressingMode " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Word32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec (Int
p Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Word32
x

pattern None :: SamplerAddressingMode
pattern $mNone :: forall {r}.
SamplerAddressingMode -> ((# #) -> r) -> ((# #) -> r) -> r
$bNone :: SamplerAddressingMode
None = SamplerAddressingMode 0

pattern ClampToEdge :: SamplerAddressingMode
pattern $mClampToEdge :: forall {r}.
SamplerAddressingMode -> ((# #) -> r) -> ((# #) -> r) -> r
$bClampToEdge :: SamplerAddressingMode
ClampToEdge = SamplerAddressingMode 1

pattern Clamp :: SamplerAddressingMode
pattern $mClamp :: forall {r}.
SamplerAddressingMode -> ((# #) -> r) -> ((# #) -> r) -> r
$bClamp :: SamplerAddressingMode
Clamp = SamplerAddressingMode 2

pattern Repeat :: SamplerAddressingMode
pattern $mRepeat :: forall {r}.
SamplerAddressingMode -> ((# #) -> r) -> ((# #) -> r) -> r
$bRepeat :: SamplerAddressingMode
Repeat = SamplerAddressingMode 3

pattern RepeatMirrored :: SamplerAddressingMode
pattern $mRepeatMirrored :: forall {r}.
SamplerAddressingMode -> ((# #) -> r) -> ((# #) -> r) -> r
$bRepeatMirrored :: SamplerAddressingMode
RepeatMirrored = SamplerAddressingMode 4