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