{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_present_mode_fifo_latest_ready ( PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT(..)
, EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION
, pattern EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION
, EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME
, pattern EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME
, PresentModeKHR(..)
) 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_MODE_FIFO_LATEST_READY_FEATURES_EXT))
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR(..))
data PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT = PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
{
PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
presentModeFifoLatestReady :: Bool }
deriving (Typeable, PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
(PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool)
-> (PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool)
-> Eq PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
== :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
$c/= :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
/= :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT)
#endif
deriving instance Show PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
instance ToCStruct PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT where
withCStruct :: forall b.
PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> (Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b)
-> IO b
withCStruct PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
x Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> IO b
f = Int
-> (Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> IO b)
-> IO b)
-> (Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p -> Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b
-> IO b
forall b.
Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
x (Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> IO b
f Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT{Bool
$sel:presentModeFifoLatestReady:PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Bool
presentModeFifoLatestReady :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> 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 PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
presentModeFifoLatestReady))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> 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 PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> 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 PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT where
peekCStruct :: Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
peekCStruct Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p = do
Bool32
presentModeFifoLatestReady <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
p Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT)
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
presentModeFifoLatestReady)
instance Storable PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT where
sizeOf :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Int
sizeOf ~PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
_ = Int
24
alignment :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> Int
alignment ~PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
peek = Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT -> IO ()
poke Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
poked = Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO ()
-> IO ()
forall b.
Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
ptr PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT where
zero :: PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
zero = Bool -> PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
PhysicalDevicePresentModeFifoLatestReadyFeaturesEXT
Bool
forall a. Zero a => a
zero
type EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION = 1
pattern EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION :: forall a . Integral a => a
pattern $mEXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION :: forall a. Integral a => a
EXT_PRESENT_MODE_FIFO_LATEST_READY_SPEC_VERSION = 1
type EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME = "VK_EXT_present_mode_fifo_latest_ready"
pattern EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mEXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
EXT_PRESENT_MODE_FIFO_LATEST_READY_EXTENSION_NAME = "VK_EXT_present_mode_fifo_latest_ready"