{-# language CPP #-}
module Vulkan.Extensions.VK_NV_present_barrier ( PhysicalDevicePresentBarrierFeaturesNV(..)
, SurfaceCapabilitiesPresentBarrierNV(..)
, SwapchainPresentBarrierCreateInfoNV(..)
, NV_PRESENT_BARRIER_SPEC_VERSION
, pattern NV_PRESENT_BARRIER_SPEC_VERSION
, NV_PRESENT_BARRIER_EXTENSION_NAME
, pattern NV_PRESENT_BARRIER_EXTENSION_NAME
) 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.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_PRESENT_BARRIER_FEATURES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV))
data PhysicalDevicePresentBarrierFeaturesNV = PhysicalDevicePresentBarrierFeaturesNV
{
PhysicalDevicePresentBarrierFeaturesNV -> Bool
presentBarrier :: Bool }
deriving (Typeable, PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
(PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool)
-> (PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool)
-> Eq PhysicalDevicePresentBarrierFeaturesNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
$c/= :: PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
== :: PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
$c== :: PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePresentBarrierFeaturesNV)
#endif
deriving instance Show PhysicalDevicePresentBarrierFeaturesNV
instance ToCStruct PhysicalDevicePresentBarrierFeaturesNV where
withCStruct :: forall b.
PhysicalDevicePresentBarrierFeaturesNV
-> (Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b) -> IO b
withCStruct PhysicalDevicePresentBarrierFeaturesNV
x Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b
f = Int -> (Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b) -> IO b)
-> (Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePresentBarrierFeaturesNV
p -> Ptr PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
p PhysicalDevicePresentBarrierFeaturesNV
x (Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b
f Ptr PhysicalDevicePresentBarrierFeaturesNV
p)
pokeCStruct :: forall b.
Ptr PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
p PhysicalDevicePresentBarrierFeaturesNV{Bool
presentBarrier :: Bool
$sel:presentBarrier:PhysicalDevicePresentBarrierFeaturesNV :: PhysicalDevicePresentBarrierFeaturesNV -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV -> 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 PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentBarrier))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePresentBarrierFeaturesNV -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV -> 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 PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV -> 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))
IO b
f
instance FromCStruct PhysicalDevicePresentBarrierFeaturesNV where
peekCStruct :: Ptr PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV
peekCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
p = do
Bool32
presentBarrier <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p Ptr PhysicalDevicePresentBarrierFeaturesNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV)
-> PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDevicePresentBarrierFeaturesNV
PhysicalDevicePresentBarrierFeaturesNV
(Bool32 -> Bool
bool32ToBool Bool32
presentBarrier)
instance Storable PhysicalDevicePresentBarrierFeaturesNV where
sizeOf :: PhysicalDevicePresentBarrierFeaturesNV -> Int
sizeOf ~PhysicalDevicePresentBarrierFeaturesNV
_ = Int
24
alignment :: PhysicalDevicePresentBarrierFeaturesNV -> Int
alignment ~PhysicalDevicePresentBarrierFeaturesNV
_ = Int
8
peek :: Ptr PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV
peek = Ptr PhysicalDevicePresentBarrierFeaturesNV
-> IO PhysicalDevicePresentBarrierFeaturesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> IO ()
poke Ptr PhysicalDevicePresentBarrierFeaturesNV
ptr PhysicalDevicePresentBarrierFeaturesNV
poked = Ptr PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
ptr PhysicalDevicePresentBarrierFeaturesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDevicePresentBarrierFeaturesNV where
zero :: PhysicalDevicePresentBarrierFeaturesNV
zero = Bool -> PhysicalDevicePresentBarrierFeaturesNV
PhysicalDevicePresentBarrierFeaturesNV
Bool
forall a. Zero a => a
zero
data SurfaceCapabilitiesPresentBarrierNV = SurfaceCapabilitiesPresentBarrierNV
{
SurfaceCapabilitiesPresentBarrierNV -> Bool
presentBarrierSupported :: Bool }
deriving (Typeable, SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
(SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool)
-> (SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool)
-> Eq SurfaceCapabilitiesPresentBarrierNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
$c/= :: SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
== :: SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
$c== :: SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceCapabilitiesPresentBarrierNV)
#endif
deriving instance Show SurfaceCapabilitiesPresentBarrierNV
instance ToCStruct SurfaceCapabilitiesPresentBarrierNV where
withCStruct :: forall b.
SurfaceCapabilitiesPresentBarrierNV
-> (Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b) -> IO b
withCStruct SurfaceCapabilitiesPresentBarrierNV
x Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b
f = Int -> (Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b) -> IO b)
-> (Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceCapabilitiesPresentBarrierNV
p -> Ptr SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
p SurfaceCapabilitiesPresentBarrierNV
x (Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b
f Ptr SurfaceCapabilitiesPresentBarrierNV
p)
pokeCStruct :: forall b.
Ptr SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
p SurfaceCapabilitiesPresentBarrierNV{Bool
presentBarrierSupported :: Bool
$sel:presentBarrierSupported:SurfaceCapabilitiesPresentBarrierNV :: SurfaceCapabilitiesPresentBarrierNV -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> 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 SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentBarrierSupported))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr SurfaceCapabilitiesPresentBarrierNV -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> 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 SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> 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))
IO b
f
instance FromCStruct SurfaceCapabilitiesPresentBarrierNV where
peekCStruct :: Ptr SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV
peekCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
p = do
Bool32
presentBarrierSupported <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SurfaceCapabilitiesPresentBarrierNV
p Ptr SurfaceCapabilitiesPresentBarrierNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV)
-> SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV
forall a b. (a -> b) -> a -> b
$ Bool -> SurfaceCapabilitiesPresentBarrierNV
SurfaceCapabilitiesPresentBarrierNV
(Bool32 -> Bool
bool32ToBool Bool32
presentBarrierSupported)
instance Storable SurfaceCapabilitiesPresentBarrierNV where
sizeOf :: SurfaceCapabilitiesPresentBarrierNV -> Int
sizeOf ~SurfaceCapabilitiesPresentBarrierNV
_ = Int
24
alignment :: SurfaceCapabilitiesPresentBarrierNV -> Int
alignment ~SurfaceCapabilitiesPresentBarrierNV
_ = Int
8
peek :: Ptr SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV
peek = Ptr SurfaceCapabilitiesPresentBarrierNV
-> IO SurfaceCapabilitiesPresentBarrierNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> IO ()
poke Ptr SurfaceCapabilitiesPresentBarrierNV
ptr SurfaceCapabilitiesPresentBarrierNV
poked = Ptr SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
ptr SurfaceCapabilitiesPresentBarrierNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SurfaceCapabilitiesPresentBarrierNV where
zero :: SurfaceCapabilitiesPresentBarrierNV
zero = Bool -> SurfaceCapabilitiesPresentBarrierNV
SurfaceCapabilitiesPresentBarrierNV
Bool
forall a. Zero a => a
zero
data SwapchainPresentBarrierCreateInfoNV = SwapchainPresentBarrierCreateInfoNV
{
SwapchainPresentBarrierCreateInfoNV -> Bool
presentBarrierEnable :: Bool }
deriving (Typeable, SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
(SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool)
-> (SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool)
-> Eq SwapchainPresentBarrierCreateInfoNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
$c/= :: SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
== :: SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
$c== :: SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainPresentBarrierCreateInfoNV)
#endif
deriving instance Show SwapchainPresentBarrierCreateInfoNV
instance ToCStruct SwapchainPresentBarrierCreateInfoNV where
withCStruct :: forall b.
SwapchainPresentBarrierCreateInfoNV
-> (Ptr SwapchainPresentBarrierCreateInfoNV -> IO b) -> IO b
withCStruct SwapchainPresentBarrierCreateInfoNV
x Ptr SwapchainPresentBarrierCreateInfoNV -> IO b
f = Int -> (Ptr SwapchainPresentBarrierCreateInfoNV -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr SwapchainPresentBarrierCreateInfoNV -> IO b) -> IO b)
-> (Ptr SwapchainPresentBarrierCreateInfoNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SwapchainPresentBarrierCreateInfoNV
p -> Ptr SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainPresentBarrierCreateInfoNV
p SwapchainPresentBarrierCreateInfoNV
x (Ptr SwapchainPresentBarrierCreateInfoNV -> IO b
f Ptr SwapchainPresentBarrierCreateInfoNV
p)
pokeCStruct :: forall b.
Ptr SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> IO b -> IO b
pokeCStruct Ptr SwapchainPresentBarrierCreateInfoNV
p SwapchainPresentBarrierCreateInfoNV{Bool
presentBarrierEnable :: Bool
$sel:presentBarrierEnable:SwapchainPresentBarrierCreateInfoNV :: SwapchainPresentBarrierCreateInfoNV -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> 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 SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentBarrierEnable))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr SwapchainPresentBarrierCreateInfoNV -> IO b -> IO b
pokeZeroCStruct Ptr SwapchainPresentBarrierCreateInfoNV
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> 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 SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> 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))
IO b
f
instance FromCStruct SwapchainPresentBarrierCreateInfoNV where
peekCStruct :: Ptr SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV
peekCStruct Ptr SwapchainPresentBarrierCreateInfoNV
p = do
Bool32
presentBarrierEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SwapchainPresentBarrierCreateInfoNV
p Ptr SwapchainPresentBarrierCreateInfoNV -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV)
-> SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV
forall a b. (a -> b) -> a -> b
$ Bool -> SwapchainPresentBarrierCreateInfoNV
SwapchainPresentBarrierCreateInfoNV
(Bool32 -> Bool
bool32ToBool Bool32
presentBarrierEnable)
instance Storable SwapchainPresentBarrierCreateInfoNV where
sizeOf :: SwapchainPresentBarrierCreateInfoNV -> Int
sizeOf ~SwapchainPresentBarrierCreateInfoNV
_ = Int
24
alignment :: SwapchainPresentBarrierCreateInfoNV -> Int
alignment ~SwapchainPresentBarrierCreateInfoNV
_ = Int
8
peek :: Ptr SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV
peek = Ptr SwapchainPresentBarrierCreateInfoNV
-> IO SwapchainPresentBarrierCreateInfoNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> IO ()
poke Ptr SwapchainPresentBarrierCreateInfoNV
ptr SwapchainPresentBarrierCreateInfoNV
poked = Ptr SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainPresentBarrierCreateInfoNV
ptr SwapchainPresentBarrierCreateInfoNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SwapchainPresentBarrierCreateInfoNV where
zero :: SwapchainPresentBarrierCreateInfoNV
zero = Bool -> SwapchainPresentBarrierCreateInfoNV
SwapchainPresentBarrierCreateInfoNV
Bool
forall a. Zero a => a
zero
type NV_PRESENT_BARRIER_SPEC_VERSION = 1
pattern NV_PRESENT_BARRIER_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_PRESENT_BARRIER_SPEC_VERSION :: forall a. Integral a => a
$mNV_PRESENT_BARRIER_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_PRESENT_BARRIER_SPEC_VERSION = 1
type NV_PRESENT_BARRIER_EXTENSION_NAME = "VK_NV_present_barrier"
pattern NV_PRESENT_BARRIER_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_PRESENT_BARRIER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNV_PRESENT_BARRIER_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_PRESENT_BARRIER_EXTENSION_NAME = "VK_NV_present_barrier"