{-# language CPP #-}
module Vulkan.Core10.Enums.AttachmentLoadOp  (AttachmentLoadOp( ATTACHMENT_LOAD_OP_LOAD
                                                              , ATTACHMENT_LOAD_OP_CLEAR
                                                              , ATTACHMENT_LOAD_OP_DONT_CARE
                                                              , ..
                                                              )) 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)
-- | VkAttachmentLoadOp - Specify how contents of an attachment are treated
-- at the beginning of a subpass
--
-- = See Also
--
-- 'Vulkan.Core10.Pass.AttachmentDescription',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentDescription2'
newtype AttachmentLoadOp = AttachmentLoadOp Int32
  deriving newtype (AttachmentLoadOp -> AttachmentLoadOp -> Bool
(AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> (AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> Eq AttachmentLoadOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c/= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
== :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c== :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
Eq, Eq AttachmentLoadOp
Eq AttachmentLoadOp =>
(AttachmentLoadOp -> AttachmentLoadOp -> Ordering)
-> (AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> (AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> (AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> (AttachmentLoadOp -> AttachmentLoadOp -> Bool)
-> (AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp)
-> (AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp)
-> Ord AttachmentLoadOp
AttachmentLoadOp -> AttachmentLoadOp -> Bool
AttachmentLoadOp -> AttachmentLoadOp -> Ordering
AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp
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 :: AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp
$cmin :: AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp
max :: AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp
$cmax :: AttachmentLoadOp -> AttachmentLoadOp -> AttachmentLoadOp
>= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c>= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
> :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c> :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
<= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c<= :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
< :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
$c< :: AttachmentLoadOp -> AttachmentLoadOp -> Bool
compare :: AttachmentLoadOp -> AttachmentLoadOp -> Ordering
$ccompare :: AttachmentLoadOp -> AttachmentLoadOp -> Ordering
$cp1Ord :: Eq AttachmentLoadOp
Ord, Ptr b -> Int -> IO AttachmentLoadOp
Ptr b -> Int -> AttachmentLoadOp -> IO ()
Ptr AttachmentLoadOp -> IO AttachmentLoadOp
Ptr AttachmentLoadOp -> Int -> IO AttachmentLoadOp
Ptr AttachmentLoadOp -> Int -> AttachmentLoadOp -> IO ()
Ptr AttachmentLoadOp -> AttachmentLoadOp -> IO ()
AttachmentLoadOp -> Int
(AttachmentLoadOp -> Int)
-> (AttachmentLoadOp -> Int)
-> (Ptr AttachmentLoadOp -> Int -> IO AttachmentLoadOp)
-> (Ptr AttachmentLoadOp -> Int -> AttachmentLoadOp -> IO ())
-> (forall b. Ptr b -> Int -> IO AttachmentLoadOp)
-> (forall b. Ptr b -> Int -> AttachmentLoadOp -> IO ())
-> (Ptr AttachmentLoadOp -> IO AttachmentLoadOp)
-> (Ptr AttachmentLoadOp -> AttachmentLoadOp -> IO ())
-> Storable AttachmentLoadOp
forall b. Ptr b -> Int -> IO AttachmentLoadOp
forall b. Ptr b -> Int -> AttachmentLoadOp -> 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 AttachmentLoadOp -> AttachmentLoadOp -> IO ()
$cpoke :: Ptr AttachmentLoadOp -> AttachmentLoadOp -> IO ()
peek :: Ptr AttachmentLoadOp -> IO AttachmentLoadOp
$cpeek :: Ptr AttachmentLoadOp -> IO AttachmentLoadOp
pokeByteOff :: Ptr b -> Int -> AttachmentLoadOp -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> AttachmentLoadOp -> IO ()
peekByteOff :: Ptr b -> Int -> IO AttachmentLoadOp
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AttachmentLoadOp
pokeElemOff :: Ptr AttachmentLoadOp -> Int -> AttachmentLoadOp -> IO ()
$cpokeElemOff :: Ptr AttachmentLoadOp -> Int -> AttachmentLoadOp -> IO ()
peekElemOff :: Ptr AttachmentLoadOp -> Int -> IO AttachmentLoadOp
$cpeekElemOff :: Ptr AttachmentLoadOp -> Int -> IO AttachmentLoadOp
alignment :: AttachmentLoadOp -> Int
$calignment :: AttachmentLoadOp -> Int
sizeOf :: AttachmentLoadOp -> Int
$csizeOf :: AttachmentLoadOp -> Int
Storable, AttachmentLoadOp
AttachmentLoadOp -> Zero AttachmentLoadOp
forall a. a -> Zero a
zero :: AttachmentLoadOp
$czero :: AttachmentLoadOp
Zero)

-- | 'ATTACHMENT_LOAD_OP_LOAD' specifies that the previous contents of the
-- image within the render area will be preserved. For attachments with a
-- depth\/stencil format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT'.
-- For attachments with a color format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_COLOR_ATTACHMENT_READ_BIT'.
pattern $bATTACHMENT_LOAD_OP_LOAD :: AttachmentLoadOp
$mATTACHMENT_LOAD_OP_LOAD :: forall r. AttachmentLoadOp -> (Void# -> r) -> (Void# -> r) -> r
ATTACHMENT_LOAD_OP_LOAD = AttachmentLoadOp 0
-- | 'ATTACHMENT_LOAD_OP_CLEAR' specifies that the contents within the render
-- area will be cleared to a uniform value, which is specified when a
-- render pass instance is begun. For attachments with a depth\/stencil
-- format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT'.
-- For attachments with a color format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_COLOR_ATTACHMENT_WRITE_BIT'.
pattern $bATTACHMENT_LOAD_OP_CLEAR :: AttachmentLoadOp
$mATTACHMENT_LOAD_OP_CLEAR :: forall r. AttachmentLoadOp -> (Void# -> r) -> (Void# -> r) -> r
ATTACHMENT_LOAD_OP_CLEAR = AttachmentLoadOp 1
-- | 'ATTACHMENT_LOAD_OP_DONT_CARE' specifies that the previous contents
-- within the area need not be preserved; the contents of the attachment
-- will be undefined inside the render area. For attachments with a
-- depth\/stencil format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT'.
-- For attachments with a color format, this uses the access type
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_COLOR_ATTACHMENT_WRITE_BIT'.
pattern $bATTACHMENT_LOAD_OP_DONT_CARE :: AttachmentLoadOp
$mATTACHMENT_LOAD_OP_DONT_CARE :: forall r. AttachmentLoadOp -> (Void# -> r) -> (Void# -> r) -> r
ATTACHMENT_LOAD_OP_DONT_CARE = AttachmentLoadOp 2
{-# complete ATTACHMENT_LOAD_OP_LOAD,
             ATTACHMENT_LOAD_OP_CLEAR,
             ATTACHMENT_LOAD_OP_DONT_CARE :: AttachmentLoadOp #-}

instance Show AttachmentLoadOp where
  showsPrec :: Int -> AttachmentLoadOp -> ShowS
showsPrec p :: Int
p = \case
    ATTACHMENT_LOAD_OP_LOAD -> String -> ShowS
showString "ATTACHMENT_LOAD_OP_LOAD"
    ATTACHMENT_LOAD_OP_CLEAR -> String -> ShowS
showString "ATTACHMENT_LOAD_OP_CLEAR"
    ATTACHMENT_LOAD_OP_DONT_CARE -> String -> ShowS
showString "ATTACHMENT_LOAD_OP_DONT_CARE"
    AttachmentLoadOp x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "AttachmentLoadOp " 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 AttachmentLoadOp where
  readPrec :: ReadPrec AttachmentLoadOp
readPrec = ReadPrec AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec AttachmentLoadOp)] -> ReadPrec AttachmentLoadOp
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("ATTACHMENT_LOAD_OP_LOAD", AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure AttachmentLoadOp
ATTACHMENT_LOAD_OP_LOAD)
                            , ("ATTACHMENT_LOAD_OP_CLEAR", AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure AttachmentLoadOp
ATTACHMENT_LOAD_OP_CLEAR)
                            , ("ATTACHMENT_LOAD_OP_DONT_CARE", AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure AttachmentLoadOp
ATTACHMENT_LOAD_OP_DONT_CARE)]
                     ReadPrec AttachmentLoadOp
-> ReadPrec AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "AttachmentLoadOp")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       AttachmentLoadOp -> ReadPrec AttachmentLoadOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> AttachmentLoadOp
AttachmentLoadOp Int32
v)))