{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_variable_pointers ( pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES
, PhysicalDeviceVariablePointersFeatures(..)
, PhysicalDeviceVariablePointerFeatures
, 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_VARIABLE_POINTERS_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
pattern $mSTRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSTRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES :: StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES
data PhysicalDeviceVariablePointersFeatures = PhysicalDeviceVariablePointersFeatures
{
:: Bool
,
PhysicalDeviceVariablePointersFeatures -> Bool
variablePointers :: Bool
}
deriving (Typeable, PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool
(PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool)
-> (PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool)
-> Eq PhysicalDeviceVariablePointersFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool
== :: PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool
$c/= :: PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool
/= :: PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceVariablePointersFeatures)
#endif
deriving instance Show PhysicalDeviceVariablePointersFeatures
instance ToCStruct PhysicalDeviceVariablePointersFeatures where
withCStruct :: forall b.
PhysicalDeviceVariablePointersFeatures
-> (Ptr PhysicalDeviceVariablePointersFeatures -> IO b) -> IO b
withCStruct PhysicalDeviceVariablePointersFeatures
x Ptr PhysicalDeviceVariablePointersFeatures -> IO b
f = Int -> (Ptr PhysicalDeviceVariablePointersFeatures -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceVariablePointersFeatures -> IO b) -> IO b)
-> (Ptr PhysicalDeviceVariablePointersFeatures -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceVariablePointersFeatures
p -> Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO b -> IO b
forall b.
Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVariablePointersFeatures
p PhysicalDeviceVariablePointersFeatures
x (Ptr PhysicalDeviceVariablePointersFeatures -> IO b
f Ptr PhysicalDeviceVariablePointersFeatures
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVariablePointersFeatures
p PhysicalDeviceVariablePointersFeatures{Bool
$sel:variablePointersStorageBuffer:PhysicalDeviceVariablePointersFeatures :: PhysicalDeviceVariablePointersFeatures -> Bool
$sel:variablePointers:PhysicalDeviceVariablePointersFeatures :: PhysicalDeviceVariablePointersFeatures -> Bool
variablePointersStorageBuffer :: Bool
variablePointers :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
variablePointersStorageBuffer))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
variablePointers))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceVariablePointersFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceVariablePointersFeatures
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceVariablePointersFeatures where
peekCStruct :: Ptr PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures
peekCStruct Ptr PhysicalDeviceVariablePointersFeatures
p = do
Bool32
variablePointersStorageBuffer <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
variablePointers <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceVariablePointersFeatures
p Ptr PhysicalDeviceVariablePointersFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures)
-> PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures
forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> PhysicalDeviceVariablePointersFeatures
PhysicalDeviceVariablePointersFeatures
(Bool32 -> Bool
bool32ToBool Bool32
variablePointersStorageBuffer)
(Bool32 -> Bool
bool32ToBool Bool32
variablePointers)
instance Storable PhysicalDeviceVariablePointersFeatures where
sizeOf :: PhysicalDeviceVariablePointersFeatures -> Int
sizeOf ~PhysicalDeviceVariablePointersFeatures
_ = Int
24
alignment :: PhysicalDeviceVariablePointersFeatures -> Int
alignment ~PhysicalDeviceVariablePointersFeatures
_ = Int
8
peek :: Ptr PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures
peek = Ptr PhysicalDeviceVariablePointersFeatures
-> IO PhysicalDeviceVariablePointersFeatures
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO ()
poke Ptr PhysicalDeviceVariablePointersFeatures
ptr PhysicalDeviceVariablePointersFeatures
poked = Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceVariablePointersFeatures
-> PhysicalDeviceVariablePointersFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceVariablePointersFeatures
ptr PhysicalDeviceVariablePointersFeatures
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceVariablePointersFeatures where
zero :: PhysicalDeviceVariablePointersFeatures
zero = Bool -> Bool -> PhysicalDeviceVariablePointersFeatures
PhysicalDeviceVariablePointersFeatures
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
type PhysicalDeviceVariablePointerFeatures = PhysicalDeviceVariablePointersFeatures