{-# language CPP #-}
module Vulkan.Core12.Promoted_From_VK_KHR_vulkan_memory_model ( PhysicalDeviceVulkanMemoryModelFeatures(..)
, StructureType(..)
) where
import Foreign.Marshal.Alloc (allocaBytes)
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.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_VULKAN_MEMORY_MODEL_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
data PhysicalDeviceVulkanMemoryModelFeatures = PhysicalDeviceVulkanMemoryModelFeatures
{
PhysicalDeviceVulkanMemoryModelFeatures -> Bool
vulkanMemoryModel :: Bool
,
PhysicalDeviceVulkanMemoryModelFeatures -> Bool
vulkanMemoryModelDeviceScope :: Bool
,
PhysicalDeviceVulkanMemoryModelFeatures -> Bool
vulkanMemoryModelAvailabilityVisibilityChains :: Bool
}
deriving (Typeable, PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> Bool
$c/= :: PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> Bool
== :: PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> Bool
$c== :: PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceVulkanMemoryModelFeatures)
#endif
deriving instance Show PhysicalDeviceVulkanMemoryModelFeatures
instance ToCStruct PhysicalDeviceVulkanMemoryModelFeatures where
withCStruct :: forall b.
PhysicalDeviceVulkanMemoryModelFeatures
-> (Ptr PhysicalDeviceVulkanMemoryModelFeatures -> IO b) -> IO b
withCStruct PhysicalDeviceVulkanMemoryModelFeatures
x Ptr PhysicalDeviceVulkanMemoryModelFeatures -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceVulkanMemoryModelFeatures
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVulkanMemoryModelFeatures
p PhysicalDeviceVulkanMemoryModelFeatures
x (Ptr PhysicalDeviceVulkanMemoryModelFeatures -> IO b
f Ptr PhysicalDeviceVulkanMemoryModelFeatures
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVulkanMemoryModelFeatures
p PhysicalDeviceVulkanMemoryModelFeatures{Bool
vulkanMemoryModelAvailabilityVisibilityChains :: Bool
vulkanMemoryModelDeviceScope :: Bool
vulkanMemoryModel :: Bool
$sel:vulkanMemoryModelAvailabilityVisibilityChains:PhysicalDeviceVulkanMemoryModelFeatures :: PhysicalDeviceVulkanMemoryModelFeatures -> Bool
$sel:vulkanMemoryModelDeviceScope:PhysicalDeviceVulkanMemoryModelFeatures :: PhysicalDeviceVulkanMemoryModelFeatures -> Bool
$sel:vulkanMemoryModel:PhysicalDeviceVulkanMemoryModelFeatures :: PhysicalDeviceVulkanMemoryModelFeatures -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
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 PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vulkanMemoryModel))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vulkanMemoryModelDeviceScope))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vulkanMemoryModelAvailabilityVisibilityChains))
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceVulkanMemoryModelFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceVulkanMemoryModelFeatures
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
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 PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceVulkanMemoryModelFeatures where
peekCStruct :: Ptr PhysicalDeviceVulkanMemoryModelFeatures
-> IO PhysicalDeviceVulkanMemoryModelFeatures
peekCStruct Ptr PhysicalDeviceVulkanMemoryModelFeatures
p = do
Bool32
vulkanMemoryModel <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
vulkanMemoryModelDeviceScope <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
vulkanMemoryModelAvailabilityVisibilityChains <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVulkanMemoryModelFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> Bool -> PhysicalDeviceVulkanMemoryModelFeatures
PhysicalDeviceVulkanMemoryModelFeatures
(Bool32 -> Bool
bool32ToBool Bool32
vulkanMemoryModel)
(Bool32 -> Bool
bool32ToBool Bool32
vulkanMemoryModelDeviceScope)
(Bool32 -> Bool
bool32ToBool Bool32
vulkanMemoryModelAvailabilityVisibilityChains)
instance Storable PhysicalDeviceVulkanMemoryModelFeatures where
sizeOf :: PhysicalDeviceVulkanMemoryModelFeatures -> Int
sizeOf ~PhysicalDeviceVulkanMemoryModelFeatures
_ = Int
32
alignment :: PhysicalDeviceVulkanMemoryModelFeatures -> Int
alignment ~PhysicalDeviceVulkanMemoryModelFeatures
_ = Int
8
peek :: Ptr PhysicalDeviceVulkanMemoryModelFeatures
-> IO PhysicalDeviceVulkanMemoryModelFeatures
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVulkanMemoryModelFeatures
-> PhysicalDeviceVulkanMemoryModelFeatures -> IO ()
poke Ptr PhysicalDeviceVulkanMemoryModelFeatures
ptr PhysicalDeviceVulkanMemoryModelFeatures
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVulkanMemoryModelFeatures
ptr PhysicalDeviceVulkanMemoryModelFeatures
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVulkanMemoryModelFeatures where
zero :: PhysicalDeviceVulkanMemoryModelFeatures
zero = Bool -> Bool -> Bool -> PhysicalDeviceVulkanMemoryModelFeatures
PhysicalDeviceVulkanMemoryModelFeatures
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero