{-# language CPP #-}
module Vulkan.Extensions.VK_AMD_memory_overallocation_behavior ( DeviceMemoryOverallocationCreateInfoAMD(..)
, MemoryOverallocationBehaviorAMD( MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD
, MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD
, MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD
, ..
)
, AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION
, pattern AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION
, AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME
, pattern AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Data.Int (Int32)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Kind (Type)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD))
data DeviceMemoryOverallocationCreateInfoAMD = DeviceMemoryOverallocationCreateInfoAMD
{
DeviceMemoryOverallocationCreateInfoAMD
-> MemoryOverallocationBehaviorAMD
overallocationBehavior :: MemoryOverallocationBehaviorAMD }
deriving (Typeable, DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> Bool
$c/= :: DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> Bool
== :: DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> Bool
$c== :: DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceMemoryOverallocationCreateInfoAMD)
#endif
deriving instance Show DeviceMemoryOverallocationCreateInfoAMD
instance ToCStruct DeviceMemoryOverallocationCreateInfoAMD where
withCStruct :: forall b.
DeviceMemoryOverallocationCreateInfoAMD
-> (Ptr DeviceMemoryOverallocationCreateInfoAMD -> IO b) -> IO b
withCStruct DeviceMemoryOverallocationCreateInfoAMD
x Ptr DeviceMemoryOverallocationCreateInfoAMD -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DeviceMemoryOverallocationCreateInfoAMD
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryOverallocationCreateInfoAMD
p DeviceMemoryOverallocationCreateInfoAMD
x (Ptr DeviceMemoryOverallocationCreateInfoAMD -> IO b
f Ptr DeviceMemoryOverallocationCreateInfoAMD
p)
pokeCStruct :: forall b.
Ptr DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryOverallocationCreateInfoAMD
p DeviceMemoryOverallocationCreateInfoAMD{MemoryOverallocationBehaviorAMD
overallocationBehavior :: MemoryOverallocationBehaviorAMD
$sel:overallocationBehavior:DeviceMemoryOverallocationCreateInfoAMD :: DeviceMemoryOverallocationCreateInfoAMD
-> MemoryOverallocationBehaviorAMD
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr MemoryOverallocationBehaviorAMD)) (MemoryOverallocationBehaviorAMD
overallocationBehavior)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr DeviceMemoryOverallocationCreateInfoAMD -> IO b -> IO b
pokeZeroCStruct Ptr DeviceMemoryOverallocationCreateInfoAMD
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr MemoryOverallocationBehaviorAMD)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DeviceMemoryOverallocationCreateInfoAMD where
peekCStruct :: Ptr DeviceMemoryOverallocationCreateInfoAMD
-> IO DeviceMemoryOverallocationCreateInfoAMD
peekCStruct Ptr DeviceMemoryOverallocationCreateInfoAMD
p = do
MemoryOverallocationBehaviorAMD
overallocationBehavior <- forall a. Storable a => Ptr a -> IO a
peek @MemoryOverallocationBehaviorAMD ((Ptr DeviceMemoryOverallocationCreateInfoAMD
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr MemoryOverallocationBehaviorAMD))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ MemoryOverallocationBehaviorAMD
-> DeviceMemoryOverallocationCreateInfoAMD
DeviceMemoryOverallocationCreateInfoAMD
MemoryOverallocationBehaviorAMD
overallocationBehavior
instance Storable DeviceMemoryOverallocationCreateInfoAMD where
sizeOf :: DeviceMemoryOverallocationCreateInfoAMD -> Int
sizeOf ~DeviceMemoryOverallocationCreateInfoAMD
_ = Int
24
alignment :: DeviceMemoryOverallocationCreateInfoAMD -> Int
alignment ~DeviceMemoryOverallocationCreateInfoAMD
_ = Int
8
peek :: Ptr DeviceMemoryOverallocationCreateInfoAMD
-> IO DeviceMemoryOverallocationCreateInfoAMD
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DeviceMemoryOverallocationCreateInfoAMD
-> DeviceMemoryOverallocationCreateInfoAMD -> IO ()
poke Ptr DeviceMemoryOverallocationCreateInfoAMD
ptr DeviceMemoryOverallocationCreateInfoAMD
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryOverallocationCreateInfoAMD
ptr DeviceMemoryOverallocationCreateInfoAMD
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DeviceMemoryOverallocationCreateInfoAMD where
zero :: DeviceMemoryOverallocationCreateInfoAMD
zero = MemoryOverallocationBehaviorAMD
-> DeviceMemoryOverallocationCreateInfoAMD
DeviceMemoryOverallocationCreateInfoAMD
forall a. Zero a => a
zero
newtype MemoryOverallocationBehaviorAMD = MemoryOverallocationBehaviorAMD Int32
deriving newtype (MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c/= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
== :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c== :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
Eq, Eq MemoryOverallocationBehaviorAMD
MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Ordering
MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
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 :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
$cmin :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
max :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
$cmax :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD
>= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c>= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
> :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c> :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
<= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c<= :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
< :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
$c< :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Bool
compare :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Ordering
$ccompare :: MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> Ordering
Ord, Ptr MemoryOverallocationBehaviorAMD
-> IO MemoryOverallocationBehaviorAMD
Ptr MemoryOverallocationBehaviorAMD
-> Int -> IO MemoryOverallocationBehaviorAMD
Ptr MemoryOverallocationBehaviorAMD
-> Int -> MemoryOverallocationBehaviorAMD -> IO ()
Ptr MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> IO ()
MemoryOverallocationBehaviorAMD -> Int
forall b. Ptr b -> Int -> IO MemoryOverallocationBehaviorAMD
forall b. Ptr b -> Int -> MemoryOverallocationBehaviorAMD -> 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 MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> IO ()
$cpoke :: Ptr MemoryOverallocationBehaviorAMD
-> MemoryOverallocationBehaviorAMD -> IO ()
peek :: Ptr MemoryOverallocationBehaviorAMD
-> IO MemoryOverallocationBehaviorAMD
$cpeek :: Ptr MemoryOverallocationBehaviorAMD
-> IO MemoryOverallocationBehaviorAMD
pokeByteOff :: forall b. Ptr b -> Int -> MemoryOverallocationBehaviorAMD -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> MemoryOverallocationBehaviorAMD -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO MemoryOverallocationBehaviorAMD
$cpeekByteOff :: forall b. Ptr b -> Int -> IO MemoryOverallocationBehaviorAMD
pokeElemOff :: Ptr MemoryOverallocationBehaviorAMD
-> Int -> MemoryOverallocationBehaviorAMD -> IO ()
$cpokeElemOff :: Ptr MemoryOverallocationBehaviorAMD
-> Int -> MemoryOverallocationBehaviorAMD -> IO ()
peekElemOff :: Ptr MemoryOverallocationBehaviorAMD
-> Int -> IO MemoryOverallocationBehaviorAMD
$cpeekElemOff :: Ptr MemoryOverallocationBehaviorAMD
-> Int -> IO MemoryOverallocationBehaviorAMD
alignment :: MemoryOverallocationBehaviorAMD -> Int
$calignment :: MemoryOverallocationBehaviorAMD -> Int
sizeOf :: MemoryOverallocationBehaviorAMD -> Int
$csizeOf :: MemoryOverallocationBehaviorAMD -> Int
Storable, MemoryOverallocationBehaviorAMD
forall a. a -> Zero a
zero :: MemoryOverallocationBehaviorAMD
$czero :: MemoryOverallocationBehaviorAMD
Zero)
pattern $bMEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD :: MemoryOverallocationBehaviorAMD
$mMEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD :: forall {r}.
MemoryOverallocationBehaviorAMD
-> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD = MemoryOverallocationBehaviorAMD 0
pattern $bMEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD :: MemoryOverallocationBehaviorAMD
$mMEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD :: forall {r}.
MemoryOverallocationBehaviorAMD
-> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD = MemoryOverallocationBehaviorAMD 1
pattern $bMEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD :: MemoryOverallocationBehaviorAMD
$mMEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD :: forall {r}.
MemoryOverallocationBehaviorAMD
-> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD = MemoryOverallocationBehaviorAMD 2
{-# COMPLETE
MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD
, MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD
, MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD ::
MemoryOverallocationBehaviorAMD
#-}
conNameMemoryOverallocationBehaviorAMD :: String
conNameMemoryOverallocationBehaviorAMD :: String
conNameMemoryOverallocationBehaviorAMD = String
"MemoryOverallocationBehaviorAMD"
enumPrefixMemoryOverallocationBehaviorAMD :: String
enumPrefixMemoryOverallocationBehaviorAMD :: String
enumPrefixMemoryOverallocationBehaviorAMD = String
"MEMORY_OVERALLOCATION_BEHAVIOR_"
showTableMemoryOverallocationBehaviorAMD :: [(MemoryOverallocationBehaviorAMD, String)]
showTableMemoryOverallocationBehaviorAMD :: [(MemoryOverallocationBehaviorAMD, String)]
showTableMemoryOverallocationBehaviorAMD =
[
( MemoryOverallocationBehaviorAMD
MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD
, String
"DEFAULT_AMD"
)
,
( MemoryOverallocationBehaviorAMD
MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD
, String
"ALLOWED_AMD"
)
,
( MemoryOverallocationBehaviorAMD
MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD
, String
"DISALLOWED_AMD"
)
]
instance Show MemoryOverallocationBehaviorAMD where
showsPrec :: Int -> MemoryOverallocationBehaviorAMD -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixMemoryOverallocationBehaviorAMD
[(MemoryOverallocationBehaviorAMD, String)]
showTableMemoryOverallocationBehaviorAMD
String
conNameMemoryOverallocationBehaviorAMD
(\(MemoryOverallocationBehaviorAMD Int32
x) -> Int32
x)
(forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)
instance Read MemoryOverallocationBehaviorAMD where
readPrec :: ReadPrec MemoryOverallocationBehaviorAMD
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixMemoryOverallocationBehaviorAMD
[(MemoryOverallocationBehaviorAMD, String)]
showTableMemoryOverallocationBehaviorAMD
String
conNameMemoryOverallocationBehaviorAMD
Int32 -> MemoryOverallocationBehaviorAMD
MemoryOverallocationBehaviorAMD
type AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION = 1
pattern AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION :: forall a . Integral a => a
pattern $bAMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION :: forall a. Integral a => a
$mAMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION = 1
type AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME = "VK_AMD_memory_overallocation_behavior"
pattern AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bAMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mAMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME = "VK_AMD_memory_overallocation_behavior"