{-# language CPP #-}
-- | = Name
--
-- VK_NV_present_barrier - device extension
--
-- == VK_NV_present_barrier
--
-- [__Name String__]
--     @VK_NV_present_barrier@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     293
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_surface_capabilities2 VK_KHR_get_surface_capabilities2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>
--
-- [__Contact__]
--
--     -   Liya Li
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NV_present_barrier] @liyli%0A*Here describe the issue or question you have about the VK_NV_present_barrier extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-05-16
--
-- [__Contributors__]
--
--     -   Liya Li, Nvidia
--
--     -   Martin Schwarzer, Nvidia
--
--     -   Andy Wolf, Nvidia
--
--     -   Ian Williams, Nvidia
--
--     -   Ben Morris, Nvidia
--
--     -   James Jones, Nvidia
--
--     -   Jeff Juliano, Nvidia
--
-- == Description
--
-- This extension adds support for synchronizing corresponding presentation
-- requests across multiple swapchains using the /present barrier/.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDevicePresentBarrierFeaturesNV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR':
--
--     -   'SurfaceCapabilitiesPresentBarrierNV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR':
--
--     -   'SwapchainPresentBarrierCreateInfoNV'
--
-- == New Enum Constants
--
-- -   'NV_PRESENT_BARRIER_EXTENSION_NAME'
--
-- -   'NV_PRESENT_BARRIER_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV'
--
-- == Issues
--
-- 1) Is there a query interface to check if a swapchain is using the
-- present barrier?
--
-- __RESOLVED__. There is no such query interface. When creating a
-- swapchain, an application can specify to use the /present barrier/, and
-- if the swapchain is created successfully, this swapchain will be using
-- the present barrier.
--
-- 2) Do we need an extra interface to set up the present barrier across
-- distributed systems?
--
-- __RESOLVED__. If the required hardware is presented in the system, and
-- all settings for the physical synchronization with other systems are set
-- up, an implementation manages the configuration automatically when
-- creating a swapchain, without any extra calls from the application.
--
-- == Version History
--
-- -   Revision 1, 2022-07-20
--
--     -   Initial version
--
-- == See Also
--
-- 'PhysicalDevicePresentBarrierFeaturesNV',
-- 'SurfaceCapabilitiesPresentBarrierNV',
-- 'SwapchainPresentBarrierCreateInfoNV'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_NV_present_barrier Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
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))
-- | VkPhysicalDevicePresentBarrierFeaturesNV - Structure indicating support
-- for VK_NV_present_barrier extension
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDevicePresentBarrierFeaturesNV' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDevicePresentBarrierFeaturesNV' /can/ also be used
-- in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_present_barrier VK_NV_present_barrier>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDevicePresentBarrierFeaturesNV = PhysicalDevicePresentBarrierFeaturesNV
  { -- | #features-presentBarrier# @presentBarrier@ indicates that the
    -- implementation supports the present barrier feature.
    PhysicalDevicePresentBarrierFeaturesNV -> Bool
presentBarrier :: Bool }
  deriving (Typeable, PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> Bool
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 = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDevicePresentBarrierFeaturesNV
p -> 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
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 PhysicalDevicePresentBarrierFeaturesNV
p 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDevicePresentBarrierFeaturesNV
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 PhysicalDevicePresentBarrierFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (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 forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDevicePresentBarrierFeaturesNV
-> PhysicalDevicePresentBarrierFeaturesNV -> IO ()
poke Ptr PhysicalDevicePresentBarrierFeaturesNV
ptr PhysicalDevicePresentBarrierFeaturesNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDevicePresentBarrierFeaturesNV
ptr PhysicalDevicePresentBarrierFeaturesNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDevicePresentBarrierFeaturesNV where
  zero :: PhysicalDevicePresentBarrierFeaturesNV
zero = Bool -> PhysicalDevicePresentBarrierFeaturesNV
PhysicalDevicePresentBarrierFeaturesNV
           forall a. Zero a => a
zero


-- | VkSurfaceCapabilitiesPresentBarrierNV - Structure describing present
-- barrier capabilities of a surface
--
-- = Description
--
-- This structure /can/ be included in the @pNext@ chain of
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR'
-- to determine support for present barrier access. If
-- @presentBarrierSupported@ is 'Vulkan.Core10.FundamentalTypes.FALSE', it
-- indicates that the present barrier feature is not obtainable for this
-- surface.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_present_barrier VK_NV_present_barrier>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SurfaceCapabilitiesPresentBarrierNV = SurfaceCapabilitiesPresentBarrierNV
  { -- | @presentBarrierSupported@ is a boolean describing whether the surface is
    -- able to make use of the present barrier feature.
    SurfaceCapabilitiesPresentBarrierNV -> Bool
presentBarrierSupported :: Bool }
  deriving (Typeable, SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> Bool
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 = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceCapabilitiesPresentBarrierNV
p -> 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
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 SurfaceCapabilitiesPresentBarrierNV
p 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesPresentBarrierNV
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 SurfaceCapabilitiesPresentBarrierNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (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 forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SurfaceCapabilitiesPresentBarrierNV
-> SurfaceCapabilitiesPresentBarrierNV -> IO ()
poke Ptr SurfaceCapabilitiesPresentBarrierNV
ptr SurfaceCapabilitiesPresentBarrierNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesPresentBarrierNV
ptr SurfaceCapabilitiesPresentBarrierNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SurfaceCapabilitiesPresentBarrierNV where
  zero :: SurfaceCapabilitiesPresentBarrierNV
zero = Bool -> SurfaceCapabilitiesPresentBarrierNV
SurfaceCapabilitiesPresentBarrierNV
           forall a. Zero a => a
zero


-- | VkSwapchainPresentBarrierCreateInfoNV - specify the present barrier
-- membership of this swapchain
--
-- = Description
--
-- If the @pNext@ chain of
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR' does not
-- include this structure, the default value for @presentBarrierEnable@ is
-- 'Vulkan.Core10.FundamentalTypes.FALSE', meaning the swapchain does not
-- request to use the present barrier. Additionally, when recreating a
-- swapchain that was using the present barrier, and the @pNext@ chain of
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR' does not
-- include this structure, it means the swapchain will stop using the
-- present barrier.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_present_barrier VK_NV_present_barrier>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SwapchainPresentBarrierCreateInfoNV = SwapchainPresentBarrierCreateInfoNV
  { -- | @presentBarrierEnable@ is a boolean value indicating a request for using
    -- the /present barrier/.
    SwapchainPresentBarrierCreateInfoNV -> Bool
presentBarrierEnable :: Bool }
  deriving (Typeable, SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> Bool
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 = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SwapchainPresentBarrierCreateInfoNV
p -> 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
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 SwapchainPresentBarrierCreateInfoNV
p 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
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainPresentBarrierCreateInfoNV
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 SwapchainPresentBarrierCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (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 forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SwapchainPresentBarrierCreateInfoNV
-> SwapchainPresentBarrierCreateInfoNV -> IO ()
poke Ptr SwapchainPresentBarrierCreateInfoNV
ptr SwapchainPresentBarrierCreateInfoNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainPresentBarrierCreateInfoNV
ptr SwapchainPresentBarrierCreateInfoNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SwapchainPresentBarrierCreateInfoNV where
  zero :: SwapchainPresentBarrierCreateInfoNV
zero = Bool -> SwapchainPresentBarrierCreateInfoNV
SwapchainPresentBarrierCreateInfoNV
           forall a. Zero a => a
zero


type NV_PRESENT_BARRIER_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_NV_PRESENT_BARRIER_SPEC_VERSION"
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 -> ((# #) -> r) -> ((# #) -> r) -> r
NV_PRESENT_BARRIER_SPEC_VERSION = 1


type NV_PRESENT_BARRIER_EXTENSION_NAME = "VK_NV_present_barrier"

-- No documentation found for TopLevel "VK_NV_PRESENT_BARRIER_EXTENSION_NAME"
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 -> ((# #) -> r) -> ((# #) -> r) -> r
NV_PRESENT_BARRIER_EXTENSION_NAME = "VK_NV_present_barrier"