{-# language CPP #-}
-- No documentation found for Chapter "SystemAllocationScope"
module Vulkan.Core10.Enums.SystemAllocationScope  (SystemAllocationScope( SYSTEM_ALLOCATION_SCOPE_COMMAND
                                                                        , SYSTEM_ALLOCATION_SCOPE_OBJECT
                                                                        , SYSTEM_ALLOCATION_SCOPE_CACHE
                                                                        , SYSTEM_ALLOCATION_SCOPE_DEVICE
                                                                        , SYSTEM_ALLOCATION_SCOPE_INSTANCE
                                                                        , ..
                                                                        )) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showsPrec)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Vulkan.Zero (Zero)
-- | VkSystemAllocationScope - Allocation scope
--
-- = Description
--
-- -   'SYSTEM_ALLOCATION_SCOPE_COMMAND' specifies that the allocation is
--     scoped to the duration of the Vulkan command.
--
-- -   'SYSTEM_ALLOCATION_SCOPE_OBJECT' specifies that the allocation is
--     scoped to the lifetime of the Vulkan object that is being created or
--     used.
--
-- -   'SYSTEM_ALLOCATION_SCOPE_CACHE' specifies that the allocation is
--     scoped to the lifetime of a 'Vulkan.Core10.Handles.PipelineCache' or
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' object.
--
-- -   'SYSTEM_ALLOCATION_SCOPE_DEVICE' specifies that the allocation is
--     scoped to the lifetime of the Vulkan device.
--
-- -   'SYSTEM_ALLOCATION_SCOPE_INSTANCE' specifies that the allocation is
--     scoped to the lifetime of the Vulkan instance.
--
-- Most Vulkan commands operate on a single object, or there is a sole
-- object that is being created or manipulated. When an allocation uses an
-- allocation scope of 'SYSTEM_ALLOCATION_SCOPE_OBJECT' or
-- 'SYSTEM_ALLOCATION_SCOPE_CACHE', the allocation is scoped to the object
-- being created or manipulated.
--
-- When an implementation requires host memory, it will make callbacks to
-- the application using the most specific allocator and allocation scope
-- available:
--
-- -   If an allocation is scoped to the duration of a command, the
--     allocator will use the 'SYSTEM_ALLOCATION_SCOPE_COMMAND' allocation
--     scope. The most specific allocator available is used: if the object
--     being created or manipulated has an allocator, that object’s
--     allocator will be used, else if the parent
--     'Vulkan.Core10.Handles.Device' has an allocator it will be used,
--     else if the parent 'Vulkan.Core10.Handles.Instance' has an allocator
--     it will be used. Else,
--
-- -   If an allocation is associated with a
--     'Vulkan.Extensions.Handles.ValidationCacheEXT' or
--     'Vulkan.Core10.Handles.PipelineCache' object, the allocator will use
--     the 'SYSTEM_ALLOCATION_SCOPE_CACHE' allocation scope. The most
--     specific allocator available is used (cache, else device, else
--     instance). Else,
--
-- -   If an allocation is scoped to the lifetime of an object, that object
--     is being created or manipulated by the command, and that object’s
--     type is not 'Vulkan.Core10.Handles.Device' or
--     'Vulkan.Core10.Handles.Instance', the allocator will use an
--     allocation scope of 'SYSTEM_ALLOCATION_SCOPE_OBJECT'. The most
--     specific allocator available is used (object, else device, else
--     instance). Else,
--
-- -   If an allocation is scoped to the lifetime of a device, the
--     allocator will use an allocation scope of
--     'SYSTEM_ALLOCATION_SCOPE_DEVICE'. The most specific allocator
--     available is used (device, else instance). Else,
--
-- -   If the allocation is scoped to the lifetime of an instance and the
--     instance has an allocator, its allocator will be used with an
--     allocation scope of 'SYSTEM_ALLOCATION_SCOPE_INSTANCE'.
--
-- -   Otherwise an implementation will allocate memory through an
--     alternative mechanism that is unspecified.
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
newtype SystemAllocationScope = SystemAllocationScope Int32
  deriving newtype (SystemAllocationScope -> SystemAllocationScope -> Bool
(SystemAllocationScope -> SystemAllocationScope -> Bool)
-> (SystemAllocationScope -> SystemAllocationScope -> Bool)
-> Eq SystemAllocationScope
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c/= :: SystemAllocationScope -> SystemAllocationScope -> Bool
== :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c== :: SystemAllocationScope -> SystemAllocationScope -> Bool
Eq, Eq SystemAllocationScope
Eq SystemAllocationScope =>
(SystemAllocationScope -> SystemAllocationScope -> Ordering)
-> (SystemAllocationScope -> SystemAllocationScope -> Bool)
-> (SystemAllocationScope -> SystemAllocationScope -> Bool)
-> (SystemAllocationScope -> SystemAllocationScope -> Bool)
-> (SystemAllocationScope -> SystemAllocationScope -> Bool)
-> (SystemAllocationScope
    -> SystemAllocationScope -> SystemAllocationScope)
-> (SystemAllocationScope
    -> SystemAllocationScope -> SystemAllocationScope)
-> Ord SystemAllocationScope
SystemAllocationScope -> SystemAllocationScope -> Bool
SystemAllocationScope -> SystemAllocationScope -> Ordering
SystemAllocationScope
-> SystemAllocationScope -> SystemAllocationScope
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 :: SystemAllocationScope
-> SystemAllocationScope -> SystemAllocationScope
$cmin :: SystemAllocationScope
-> SystemAllocationScope -> SystemAllocationScope
max :: SystemAllocationScope
-> SystemAllocationScope -> SystemAllocationScope
$cmax :: SystemAllocationScope
-> SystemAllocationScope -> SystemAllocationScope
>= :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c>= :: SystemAllocationScope -> SystemAllocationScope -> Bool
> :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c> :: SystemAllocationScope -> SystemAllocationScope -> Bool
<= :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c<= :: SystemAllocationScope -> SystemAllocationScope -> Bool
< :: SystemAllocationScope -> SystemAllocationScope -> Bool
$c< :: SystemAllocationScope -> SystemAllocationScope -> Bool
compare :: SystemAllocationScope -> SystemAllocationScope -> Ordering
$ccompare :: SystemAllocationScope -> SystemAllocationScope -> Ordering
$cp1Ord :: Eq SystemAllocationScope
Ord, Ptr b -> Int -> IO SystemAllocationScope
Ptr b -> Int -> SystemAllocationScope -> IO ()
Ptr SystemAllocationScope -> IO SystemAllocationScope
Ptr SystemAllocationScope -> Int -> IO SystemAllocationScope
Ptr SystemAllocationScope -> Int -> SystemAllocationScope -> IO ()
Ptr SystemAllocationScope -> SystemAllocationScope -> IO ()
SystemAllocationScope -> Int
(SystemAllocationScope -> Int)
-> (SystemAllocationScope -> Int)
-> (Ptr SystemAllocationScope -> Int -> IO SystemAllocationScope)
-> (Ptr SystemAllocationScope
    -> Int -> SystemAllocationScope -> IO ())
-> (forall b. Ptr b -> Int -> IO SystemAllocationScope)
-> (forall b. Ptr b -> Int -> SystemAllocationScope -> IO ())
-> (Ptr SystemAllocationScope -> IO SystemAllocationScope)
-> (Ptr SystemAllocationScope -> SystemAllocationScope -> IO ())
-> Storable SystemAllocationScope
forall b. Ptr b -> Int -> IO SystemAllocationScope
forall b. Ptr b -> Int -> SystemAllocationScope -> 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 SystemAllocationScope -> SystemAllocationScope -> IO ()
$cpoke :: Ptr SystemAllocationScope -> SystemAllocationScope -> IO ()
peek :: Ptr SystemAllocationScope -> IO SystemAllocationScope
$cpeek :: Ptr SystemAllocationScope -> IO SystemAllocationScope
pokeByteOff :: Ptr b -> Int -> SystemAllocationScope -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> SystemAllocationScope -> IO ()
peekByteOff :: Ptr b -> Int -> IO SystemAllocationScope
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SystemAllocationScope
pokeElemOff :: Ptr SystemAllocationScope -> Int -> SystemAllocationScope -> IO ()
$cpokeElemOff :: Ptr SystemAllocationScope -> Int -> SystemAllocationScope -> IO ()
peekElemOff :: Ptr SystemAllocationScope -> Int -> IO SystemAllocationScope
$cpeekElemOff :: Ptr SystemAllocationScope -> Int -> IO SystemAllocationScope
alignment :: SystemAllocationScope -> Int
$calignment :: SystemAllocationScope -> Int
sizeOf :: SystemAllocationScope -> Int
$csizeOf :: SystemAllocationScope -> Int
Storable, SystemAllocationScope
SystemAllocationScope -> Zero SystemAllocationScope
forall a. a -> Zero a
zero :: SystemAllocationScope
$czero :: SystemAllocationScope
Zero)

-- No documentation found for Nested "VkSystemAllocationScope" "VK_SYSTEM_ALLOCATION_SCOPE_COMMAND"
pattern $bSYSTEM_ALLOCATION_SCOPE_COMMAND :: SystemAllocationScope
$mSYSTEM_ALLOCATION_SCOPE_COMMAND :: forall r.
SystemAllocationScope -> (Void# -> r) -> (Void# -> r) -> r
SYSTEM_ALLOCATION_SCOPE_COMMAND  = SystemAllocationScope 0
-- No documentation found for Nested "VkSystemAllocationScope" "VK_SYSTEM_ALLOCATION_SCOPE_OBJECT"
pattern $bSYSTEM_ALLOCATION_SCOPE_OBJECT :: SystemAllocationScope
$mSYSTEM_ALLOCATION_SCOPE_OBJECT :: forall r.
SystemAllocationScope -> (Void# -> r) -> (Void# -> r) -> r
SYSTEM_ALLOCATION_SCOPE_OBJECT   = SystemAllocationScope 1
-- No documentation found for Nested "VkSystemAllocationScope" "VK_SYSTEM_ALLOCATION_SCOPE_CACHE"
pattern $bSYSTEM_ALLOCATION_SCOPE_CACHE :: SystemAllocationScope
$mSYSTEM_ALLOCATION_SCOPE_CACHE :: forall r.
SystemAllocationScope -> (Void# -> r) -> (Void# -> r) -> r
SYSTEM_ALLOCATION_SCOPE_CACHE    = SystemAllocationScope 2
-- No documentation found for Nested "VkSystemAllocationScope" "VK_SYSTEM_ALLOCATION_SCOPE_DEVICE"
pattern $bSYSTEM_ALLOCATION_SCOPE_DEVICE :: SystemAllocationScope
$mSYSTEM_ALLOCATION_SCOPE_DEVICE :: forall r.
SystemAllocationScope -> (Void# -> r) -> (Void# -> r) -> r
SYSTEM_ALLOCATION_SCOPE_DEVICE   = SystemAllocationScope 3
-- No documentation found for Nested "VkSystemAllocationScope" "VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE"
pattern $bSYSTEM_ALLOCATION_SCOPE_INSTANCE :: SystemAllocationScope
$mSYSTEM_ALLOCATION_SCOPE_INSTANCE :: forall r.
SystemAllocationScope -> (Void# -> r) -> (Void# -> r) -> r
SYSTEM_ALLOCATION_SCOPE_INSTANCE = SystemAllocationScope 4
{-# complete SYSTEM_ALLOCATION_SCOPE_COMMAND,
             SYSTEM_ALLOCATION_SCOPE_OBJECT,
             SYSTEM_ALLOCATION_SCOPE_CACHE,
             SYSTEM_ALLOCATION_SCOPE_DEVICE,
             SYSTEM_ALLOCATION_SCOPE_INSTANCE :: SystemAllocationScope #-}

conNameSystemAllocationScope :: String
conNameSystemAllocationScope :: String
conNameSystemAllocationScope = "SystemAllocationScope"

enumPrefixSystemAllocationScope :: String
enumPrefixSystemAllocationScope :: String
enumPrefixSystemAllocationScope = "SYSTEM_ALLOCATION_SCOPE_"

showTableSystemAllocationScope :: [(SystemAllocationScope, String)]
showTableSystemAllocationScope :: [(SystemAllocationScope, String)]
showTableSystemAllocationScope =
  [ (SystemAllocationScope
SYSTEM_ALLOCATION_SCOPE_COMMAND , "COMMAND")
  , (SystemAllocationScope
SYSTEM_ALLOCATION_SCOPE_OBJECT  , "OBJECT")
  , (SystemAllocationScope
SYSTEM_ALLOCATION_SCOPE_CACHE   , "CACHE")
  , (SystemAllocationScope
SYSTEM_ALLOCATION_SCOPE_DEVICE  , "DEVICE")
  , (SystemAllocationScope
SYSTEM_ALLOCATION_SCOPE_INSTANCE, "INSTANCE")
  ]

instance Show SystemAllocationScope where
  showsPrec :: Int -> SystemAllocationScope -> ShowS
showsPrec = String
-> [(SystemAllocationScope, String)]
-> String
-> (SystemAllocationScope -> Int32)
-> (Int32 -> ShowS)
-> Int
-> SystemAllocationScope
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixSystemAllocationScope
                            [(SystemAllocationScope, String)]
showTableSystemAllocationScope
                            String
conNameSystemAllocationScope
                            (\(SystemAllocationScope x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read SystemAllocationScope where
  readPrec :: ReadPrec SystemAllocationScope
readPrec = String
-> [(SystemAllocationScope, String)]
-> String
-> (Int32 -> SystemAllocationScope)
-> ReadPrec SystemAllocationScope
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixSystemAllocationScope
                          [(SystemAllocationScope, String)]
showTableSystemAllocationScope
                          String
conNameSystemAllocationScope
                          Int32 -> SystemAllocationScope
SystemAllocationScope