{-# language CPP #-}
module Vulkan.Extensions.VK_NV_dedicated_allocation_image_aliasing ( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(..)
, NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION
, pattern NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION
, NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME
, pattern NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
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 Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV))
data PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV = PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
{
PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
dedicatedAllocationImageAliasing :: Bool }
deriving (Typeable, PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
(PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Bool)
-> (PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Bool)
-> Eq PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
$c/= :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
== :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
$c== :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV)
#endif
deriving instance Show PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
instance ToCStruct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV where
withCStruct :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> (Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b)
-> IO b
withCStruct x :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
x f :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b)
-> IO b)
-> (Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p -> Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
x (Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b
f Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p)
pokeCStruct :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b
-> IO b
pokeCStruct p :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
dedicatedAllocationImageAliasing))
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV where
peekCStruct :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
peekCStruct p :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p = do
Bool32
dedicatedAllocationImageAliasing <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
p Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV)
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
(Bool32 -> Bool
bool32ToBool Bool32
dedicatedAllocationImageAliasing)
instance Storable PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV where
sizeOf :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Int
sizeOf ~PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
_ = 24
alignment :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV -> Int
alignment ~PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
_ = 8
peek :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
peek = Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO ()
poke ptr :: Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
ptr poked :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
poked = Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
ptr PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV where
zero :: PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
zero = Bool -> PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
Bool
forall a. Zero a => a
zero
type NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION = 1
pattern NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION :: a
$mNV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION = 1
type NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME = "VK_NV_dedicated_allocation_image_aliasing"
pattern NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME :: a
$mNV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME = "VK_NV_dedicated_allocation_image_aliasing"