{-# language CPP #-}
-- | = Name
--
-- VK_KHR_get_display_properties2 - instance extension
--
-- == VK_KHR_get_display_properties2
--
-- [__Name String__]
--     @VK_KHR_get_display_properties2@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     122
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
--     -   Requires @VK_KHR_display@ to be enabled
--
-- [__Contact__]
--
--     -   James Jones
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_get_display_properties2] @cubanismo%0A*Here describe the issue or question you have about the VK_KHR_get_display_properties2 extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2017-02-21
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Ian Elliott, Google
--
--     -   James Jones, NVIDIA
--
-- == Description
--
-- This extension provides new entry points to query device display
-- properties and capabilities in a way that can be easily extended by
-- other extensions, without introducing any further entry points. This
-- extension can be considered the @VK_KHR_display@ equivalent of the
-- @VK_KHR_get_physical_device_properties2@ extension.
--
-- == New Commands
--
-- -   'getDisplayModeProperties2KHR'
--
-- -   'getDisplayPlaneCapabilities2KHR'
--
-- -   'getPhysicalDeviceDisplayPlaneProperties2KHR'
--
-- -   'getPhysicalDeviceDisplayProperties2KHR'
--
-- == New Structures
--
-- -   'DisplayModeProperties2KHR'
--
-- -   'DisplayPlaneCapabilities2KHR'
--
-- -   'DisplayPlaneInfo2KHR'
--
-- -   'DisplayPlaneProperties2KHR'
--
-- -   'DisplayProperties2KHR'
--
-- == New Enum Constants
--
-- -   'KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME'
--
-- -   'KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR'
--
-- == Issues
--
-- 1) What should this extension be named?
--
-- __RESOLVED__: @VK_KHR_get_display_properties2@. Other alternatives:
--
-- -   @VK_KHR_display2@
--
-- -   One extension, combined with @VK_KHR_surface_capabilites2@.
--
-- 2) Should extensible input structs be added for these new functions:
--
-- __RESOLVED__:
--
-- -   'getPhysicalDeviceDisplayProperties2KHR': No. The only current input
--     is a 'Vulkan.Core10.Handles.PhysicalDevice'. Other inputs would not
--     make sense.
--
-- -   'getPhysicalDeviceDisplayPlaneProperties2KHR': No. The only current
--     input is a 'Vulkan.Core10.Handles.PhysicalDevice'. Other inputs
--     would not make sense.
--
-- -   'getDisplayModeProperties2KHR': No. The only current inputs are a
--     'Vulkan.Core10.Handles.PhysicalDevice' and a
--     'Vulkan.Extensions.Handles.DisplayModeKHR'. Other inputs would not
--     make sense.
--
-- 3) Should additional display query functions be extended?
--
-- __RESOLVED__:
--
-- -   'Vulkan.Extensions.VK_KHR_display.getDisplayPlaneSupportedDisplaysKHR':
--     No. Extensions should instead extend
--     'Vulkan.Extensions.VK_KHR_display.getDisplayPlaneCapabilitiesKHR'().
--
-- == Version History
--
-- -   Revision 1, 2017-02-21 (James Jones)
--
--     -   Initial draft.
--
-- == See Also
--
-- 'DisplayModeProperties2KHR', 'DisplayPlaneCapabilities2KHR',
-- 'DisplayPlaneInfo2KHR', 'DisplayPlaneProperties2KHR',
-- 'DisplayProperties2KHR', 'getDisplayModeProperties2KHR',
-- 'getDisplayPlaneCapabilities2KHR',
-- 'getPhysicalDeviceDisplayPlaneProperties2KHR',
-- 'getPhysicalDeviceDisplayProperties2KHR'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_get_display_properties2 Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_get_display_properties2  ( getPhysicalDeviceDisplayProperties2KHR
                                                         , getPhysicalDeviceDisplayPlaneProperties2KHR
                                                         , getDisplayModeProperties2KHR
                                                         , getDisplayPlaneCapabilities2KHR
                                                         , DisplayProperties2KHR(..)
                                                         , DisplayPlaneProperties2KHR(..)
                                                         , DisplayModeProperties2KHR(..)
                                                         , DisplayPlaneInfo2KHR(..)
                                                         , DisplayPlaneCapabilities2KHR(..)
                                                         , KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION
                                                         , pattern KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION
                                                         , KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME
                                                         , pattern KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME
                                                         , DisplayKHR(..)
                                                         , DisplayModeKHR(..)
                                                         , DisplayPropertiesKHR(..)
                                                         , DisplayPlanePropertiesKHR(..)
                                                         , DisplayModeParametersKHR(..)
                                                         , DisplayModePropertiesKHR(..)
                                                         , DisplayPlaneCapabilitiesKHR(..)
                                                         , DisplayPlaneAlphaFlagBitsKHR(..)
                                                         , DisplayPlaneAlphaFlagsKHR
                                                         , SurfaceTransformFlagBitsKHR(..)
                                                         , SurfaceTransformFlagsKHR
                                                         ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.NamedType ((:::))
import Vulkan.Extensions.Handles (DisplayKHR)
import Vulkan.Extensions.Handles (DisplayKHR(..))
import Vulkan.Extensions.Handles (DisplayModeKHR)
import Vulkan.Extensions.VK_KHR_display (DisplayModePropertiesKHR)
import Vulkan.Extensions.VK_KHR_display (DisplayPlaneCapabilitiesKHR)
import Vulkan.Extensions.VK_KHR_display (DisplayPlanePropertiesKHR)
import Vulkan.Extensions.VK_KHR_display (DisplayPropertiesKHR)
import Vulkan.Dynamic (InstanceCmds(pVkGetDisplayModeProperties2KHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetDisplayPlaneCapabilities2KHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceDisplayPlaneProperties2KHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceDisplayProperties2KHR))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (DisplayKHR(..))
import Vulkan.Extensions.Handles (DisplayModeKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayModeParametersKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayModePropertiesKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayPlaneAlphaFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayPlaneAlphaFlagsKHR)
import Vulkan.Extensions.VK_KHR_display (DisplayPlaneCapabilitiesKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayPlanePropertiesKHR(..))
import Vulkan.Extensions.VK_KHR_display (DisplayPropertiesKHR(..))
import Vulkan.Extensions.VK_KHR_surface (SurfaceTransformFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_surface (SurfaceTransformFlagsKHR)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDeviceDisplayProperties2KHR
  :: FunPtr (Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr DisplayProperties2KHR -> IO Result) -> Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr DisplayProperties2KHR -> IO Result

-- | vkGetPhysicalDeviceDisplayProperties2KHR - Query information about the
-- available displays
--
-- = Description
--
-- 'getPhysicalDeviceDisplayProperties2KHR' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_display.getPhysicalDeviceDisplayPropertiesKHR',
-- with the ability to return extended information via chained output
-- structures.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceDisplayProperties2KHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceDisplayProperties2KHR-pPropertyCount-parameter#
--     @pPropertyCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetPhysicalDeviceDisplayProperties2KHR-pProperties-parameter#
--     If the value referenced by @pPropertyCount@ is not @0@, and
--     @pProperties@ is not @NULL@, @pProperties@ /must/ be a valid pointer
--     to an array of @pPropertyCount@ 'DisplayProperties2KHR' structures
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'DisplayProperties2KHR', 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceDisplayProperties2KHR :: forall io
                                        . (MonadIO io)
                                       => -- | @physicalDevice@ is a physical device.
                                          PhysicalDevice
                                       -> io (Result, ("properties" ::: Vector DisplayProperties2KHR))
getPhysicalDeviceDisplayProperties2KHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> io (Result, "properties" ::: Vector DisplayProperties2KHR)
getPhysicalDeviceDisplayProperties2KHR PhysicalDevice
physicalDevice = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceDisplayProperties2KHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayProperties2KHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayProperties2KHR)
      -> IO Result)
pVkGetPhysicalDeviceDisplayProperties2KHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayProperties2KHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPhysicalDeviceDisplayProperties2KHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceDisplayProperties2KHR' :: Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayProperties2KHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO Result
mkVkGetPhysicalDeviceDisplayProperties2KHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayProperties2KHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  "pPropertyCount" ::: Ptr Word32
pPPropertyCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceDisplayProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayProperties2KHR'
                                                                             Ptr PhysicalDevice_T
physicalDevice'
                                                                             ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                             (forall a. Ptr a
nullPtr))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayProperties2KHR
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @DisplayProperties2KHR ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
* Int
64)) forall a. Ptr a -> IO ()
free
  [()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayProperties2KHR
pPProperties forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
64) :: Ptr DisplayProperties2KHR) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
- Int
1]
  Result
r' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceDisplayProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayProperties2KHR'
                                                                              Ptr PhysicalDevice_T
physicalDevice'
                                                                              ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                              (("pProperties" ::: Ptr DisplayProperties2KHR
pPProperties)))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayProperties2KHR
pProperties' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayProperties2KHR ((("pProperties" ::: Ptr DisplayProperties2KHR
pPProperties) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayProperties2KHR)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "properties" ::: Vector DisplayProperties2KHR
pProperties')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDeviceDisplayPlaneProperties2KHR
  :: FunPtr (Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr DisplayPlaneProperties2KHR -> IO Result) -> Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr DisplayPlaneProperties2KHR -> IO Result

-- | vkGetPhysicalDeviceDisplayPlaneProperties2KHR - Query information about
-- the available display planes.
--
-- = Description
--
-- 'getPhysicalDeviceDisplayPlaneProperties2KHR' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_display.getPhysicalDeviceDisplayPlanePropertiesKHR',
-- with the ability to return extended information via chained output
-- structures.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceDisplayPlaneProperties2KHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceDisplayPlaneProperties2KHR-pPropertyCount-parameter#
--     @pPropertyCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetPhysicalDeviceDisplayPlaneProperties2KHR-pProperties-parameter#
--     If the value referenced by @pPropertyCount@ is not @0@, and
--     @pProperties@ is not @NULL@, @pProperties@ /must/ be a valid pointer
--     to an array of @pPropertyCount@ 'DisplayPlaneProperties2KHR'
--     structures
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'DisplayPlaneProperties2KHR', 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceDisplayPlaneProperties2KHR :: forall io
                                             . (MonadIO io)
                                            => -- | @physicalDevice@ is a physical device.
                                               PhysicalDevice
                                            -> io (Result, ("properties" ::: Vector DisplayPlaneProperties2KHR))
getPhysicalDeviceDisplayPlaneProperties2KHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
getPhysicalDeviceDisplayPlaneProperties2KHR PhysicalDevice
physicalDevice = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceDisplayPlaneProperties2KHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayPlaneProperties2KHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
      -> IO Result)
pVkGetPhysicalDeviceDisplayPlaneProperties2KHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayPlaneProperties2KHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPhysicalDeviceDisplayPlaneProperties2KHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceDisplayPlaneProperties2KHR' :: Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayPlaneProperties2KHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO Result
mkVkGetPhysicalDeviceDisplayPlaneProperties2KHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayPlaneProperties2KHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  "pPropertyCount" ::: Ptr Word32
pPPropertyCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceDisplayPlaneProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayPlaneProperties2KHR'
                                                                                  Ptr PhysicalDevice_T
physicalDevice'
                                                                                  ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                                  (forall a. Ptr a
nullPtr))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @DisplayPlaneProperties2KHR ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
* Int
32)) forall a. Ptr a -> IO ()
free
  [()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
32) :: Ptr DisplayPlaneProperties2KHR) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
- Int
1]
  Result
r' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceDisplayPlaneProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayPlaneProperties2KHR'
                                                                                   Ptr PhysicalDevice_T
physicalDevice'
                                                                                   ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                                   (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties)))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayPlaneProperties2KHR
pProperties' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlaneProperties2KHR ((("pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayPlaneProperties2KHR)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "properties" ::: Vector DisplayPlaneProperties2KHR
pProperties')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDisplayModeProperties2KHR
  :: FunPtr (Ptr PhysicalDevice_T -> DisplayKHR -> Ptr Word32 -> Ptr DisplayModeProperties2KHR -> IO Result) -> Ptr PhysicalDevice_T -> DisplayKHR -> Ptr Word32 -> Ptr DisplayModeProperties2KHR -> IO Result

-- | vkGetDisplayModeProperties2KHR - Query information about the available
-- display modes.
--
-- = Description
--
-- 'getDisplayModeProperties2KHR' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_display.getDisplayModePropertiesKHR', with the
-- ability to return extended information via chained output structures.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDisplayModeProperties2KHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetDisplayModeProperties2KHR-display-parameter# @display@
--     /must/ be a valid 'Vulkan.Extensions.Handles.DisplayKHR' handle
--
-- -   #VUID-vkGetDisplayModeProperties2KHR-pPropertyCount-parameter#
--     @pPropertyCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetDisplayModeProperties2KHR-pProperties-parameter# If the
--     value referenced by @pPropertyCount@ is not @0@, and @pProperties@
--     is not @NULL@, @pProperties@ /must/ be a valid pointer to an array
--     of @pPropertyCount@ 'DisplayModeProperties2KHR' structures
--
-- -   #VUID-vkGetDisplayModeProperties2KHR-display-parent# @display@
--     /must/ have been created, allocated, or retrieved from
--     @physicalDevice@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.Handles.DisplayKHR', 'DisplayModeProperties2KHR',
-- 'Vulkan.Core10.Handles.PhysicalDevice'
getDisplayModeProperties2KHR :: forall io
                              . (MonadIO io)
                             => -- | @physicalDevice@ is the physical device associated with @display@.
                                PhysicalDevice
                             -> -- | @display@ is the display to query.
                                DisplayKHR
                             -> io (Result, ("properties" ::: Vector DisplayModeProperties2KHR))
getDisplayModeProperties2KHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> DisplayKHR
-> io (Result, "properties" ::: Vector DisplayModeProperties2KHR)
getDisplayModeProperties2KHR PhysicalDevice
physicalDevice DisplayKHR
display = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDisplayModeProperties2KHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
vkGetDisplayModeProperties2KHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> DisplayKHR
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
      -> IO Result)
pVkGetDisplayModeProperties2KHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
vkGetDisplayModeProperties2KHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDisplayModeProperties2KHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDisplayModeProperties2KHR' :: Ptr PhysicalDevice_T
-> DisplayKHR
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO Result
vkGetDisplayModeProperties2KHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> DisplayKHR
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO Result
mkVkGetDisplayModeProperties2KHR FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
vkGetDisplayModeProperties2KHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  "pPropertyCount" ::: Ptr Word32
pPPropertyCount <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Word32 Int
4) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDisplayModeProperties2KHR" (Ptr PhysicalDevice_T
-> DisplayKHR
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO Result
vkGetDisplayModeProperties2KHR'
                                                                   Ptr PhysicalDevice_T
physicalDevice'
                                                                   (DisplayKHR
display)
                                                                   ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                   (forall a. Ptr a
nullPtr))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @DisplayModeProperties2KHR ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
* Int
40)) forall a. Ptr a -> IO ()
free
  [()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
40) :: Ptr DisplayModeProperties2KHR) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) forall a. Num a => a -> a -> a
- Int
1]
  Result
r' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDisplayModeProperties2KHR" (Ptr PhysicalDevice_T
-> DisplayKHR
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO Result
vkGetDisplayModeProperties2KHR'
                                                                    Ptr PhysicalDevice_T
physicalDevice'
                                                                    (DisplayKHR
display)
                                                                    ("pPropertyCount" ::: Ptr Word32
pPPropertyCount)
                                                                    (("pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties)))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayModeProperties2KHR
pProperties' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayModeProperties2KHR ((("pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
40 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayModeProperties2KHR)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "properties" ::: Vector DisplayModeProperties2KHR
pProperties')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDisplayPlaneCapabilities2KHR
  :: FunPtr (Ptr PhysicalDevice_T -> Ptr DisplayPlaneInfo2KHR -> Ptr DisplayPlaneCapabilities2KHR -> IO Result) -> Ptr PhysicalDevice_T -> Ptr DisplayPlaneInfo2KHR -> Ptr DisplayPlaneCapabilities2KHR -> IO Result

-- | vkGetDisplayPlaneCapabilities2KHR - Query capabilities of a mode and
-- plane combination
--
-- = Description
--
-- 'getDisplayPlaneCapabilities2KHR' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_display.getDisplayPlaneCapabilitiesKHR', with
-- the ability to specify extended inputs via chained input structures, and
-- to return extended information via chained output structures.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'DisplayPlaneCapabilities2KHR', 'DisplayPlaneInfo2KHR',
-- 'Vulkan.Core10.Handles.PhysicalDevice'
getDisplayPlaneCapabilities2KHR :: forall io
                                 . (MonadIO io)
                                => -- | @physicalDevice@ is the physical device associated with
                                   -- @pDisplayPlaneInfo@.
                                   --
                                   -- #VUID-vkGetDisplayPlaneCapabilities2KHR-physicalDevice-parameter#
                                   -- @physicalDevice@ /must/ be a valid
                                   -- 'Vulkan.Core10.Handles.PhysicalDevice' handle
                                   PhysicalDevice
                                -> -- | @pDisplayPlaneInfo@ is a pointer to a 'DisplayPlaneInfo2KHR' structure
                                   -- describing the plane and mode.
                                   --
                                   -- #VUID-vkGetDisplayPlaneCapabilities2KHR-pDisplayPlaneInfo-parameter#
                                   -- @pDisplayPlaneInfo@ /must/ be a valid pointer to a valid
                                   -- 'DisplayPlaneInfo2KHR' structure
                                   DisplayPlaneInfo2KHR
                                -> io (DisplayPlaneCapabilities2KHR)
getDisplayPlaneCapabilities2KHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> DisplayPlaneInfo2KHR -> io DisplayPlaneCapabilities2KHR
getDisplayPlaneCapabilities2KHR PhysicalDevice
physicalDevice
                                  DisplayPlaneInfo2KHR
displayPlaneInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetDisplayPlaneCapabilities2KHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
vkGetDisplayPlaneCapabilities2KHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
      -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
      -> IO Result)
pVkGetDisplayPlaneCapabilities2KHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
vkGetDisplayPlaneCapabilities2KHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetDisplayPlaneCapabilities2KHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDisplayPlaneCapabilities2KHR' :: Ptr PhysicalDevice_T
-> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO Result
vkGetDisplayPlaneCapabilities2KHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO Result
mkVkGetDisplayPlaneCapabilities2KHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
vkGetDisplayPlaneCapabilities2KHRPtr
  "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
pDisplayPlaneInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DisplayPlaneInfo2KHR
displayPlaneInfo)
  "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
pPCapabilities <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @DisplayPlaneCapabilities2KHR)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDisplayPlaneCapabilities2KHR" (Ptr PhysicalDevice_T
-> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO Result
vkGetDisplayPlaneCapabilities2KHR'
                                                                      (PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
                                                                      "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
pDisplayPlaneInfo
                                                                      ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
pPCapabilities))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  DisplayPlaneCapabilities2KHR
pCapabilities <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlaneCapabilities2KHR "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
pPCapabilities
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DisplayPlaneCapabilities2KHR
pCapabilities)


-- | VkDisplayProperties2KHR - Structure describing an available display
-- device
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.VK_KHR_display.DisplayPropertiesKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPhysicalDeviceDisplayProperties2KHR'
data DisplayProperties2KHR = DisplayProperties2KHR
  { -- | @displayProperties@ is a
    -- 'Vulkan.Extensions.VK_KHR_display.DisplayPropertiesKHR' structure.
    DisplayProperties2KHR -> DisplayPropertiesKHR
displayProperties :: DisplayPropertiesKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DisplayProperties2KHR)
#endif
deriving instance Show DisplayProperties2KHR

instance ToCStruct DisplayProperties2KHR where
  withCStruct :: forall b.
DisplayProperties2KHR
-> (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b) -> IO b
withCStruct DisplayProperties2KHR
x ("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \"pProperties" ::: Ptr DisplayProperties2KHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayProperties2KHR
p DisplayProperties2KHR
x (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b
f "pProperties" ::: Ptr DisplayProperties2KHR
p)
  pokeCStruct :: forall b.
("pProperties" ::: Ptr DisplayProperties2KHR)
-> DisplayProperties2KHR -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayProperties2KHR
p DisplayProperties2KHR{DisplayPropertiesKHR
displayProperties :: DisplayPropertiesKHR
$sel:displayProperties:DisplayProperties2KHR :: DisplayProperties2KHR -> DisplayPropertiesKHR
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPropertiesKHR)) (DisplayPropertiesKHR
displayProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b -> IO b
pokeZeroCStruct "pProperties" ::: Ptr DisplayProperties2KHR
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPropertiesKHR)) (forall a. Zero a => a
zero) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct DisplayProperties2KHR where
  peekCStruct :: ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO DisplayProperties2KHR
peekCStruct "pProperties" ::: Ptr DisplayProperties2KHR
p = do
    DisplayPropertiesKHR
displayProperties <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPropertiesKHR (("pProperties" ::: Ptr DisplayProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPropertiesKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DisplayPropertiesKHR -> DisplayProperties2KHR
DisplayProperties2KHR
             DisplayPropertiesKHR
displayProperties

instance Zero DisplayProperties2KHR where
  zero :: DisplayProperties2KHR
zero = DisplayPropertiesKHR -> DisplayProperties2KHR
DisplayProperties2KHR
           forall a. Zero a => a
zero


-- | VkDisplayPlaneProperties2KHR - Structure describing an available display
-- plane
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.VK_KHR_display.DisplayPlanePropertiesKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPhysicalDeviceDisplayPlaneProperties2KHR'
data DisplayPlaneProperties2KHR = DisplayPlaneProperties2KHR
  { -- | @displayPlaneProperties@ is a
    -- 'Vulkan.Extensions.VK_KHR_display.DisplayPlanePropertiesKHR' structure.
    DisplayPlaneProperties2KHR -> DisplayPlanePropertiesKHR
displayPlaneProperties :: DisplayPlanePropertiesKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DisplayPlaneProperties2KHR)
#endif
deriving instance Show DisplayPlaneProperties2KHR

instance ToCStruct DisplayPlaneProperties2KHR where
  withCStruct :: forall b.
DisplayPlaneProperties2KHR
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b)
-> IO b
withCStruct DisplayPlaneProperties2KHR
x ("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pProperties" ::: Ptr DisplayPlaneProperties2KHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p DisplayPlaneProperties2KHR
x (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b
f "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p)
  pokeCStruct :: forall b.
("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> DisplayPlaneProperties2KHR -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p DisplayPlaneProperties2KHR{DisplayPlanePropertiesKHR
displayPlaneProperties :: DisplayPlanePropertiesKHR
$sel:displayPlaneProperties:DisplayPlaneProperties2KHR :: DisplayPlaneProperties2KHR -> DisplayPlanePropertiesKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
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 (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlanePropertiesKHR)) (DisplayPlanePropertiesKHR
displayPlaneProperties)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b -> IO b
pokeZeroCStruct "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
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 (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlanePropertiesKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DisplayPlaneProperties2KHR where
  peekCStruct :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO DisplayPlaneProperties2KHR
peekCStruct "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p = do
    DisplayPlanePropertiesKHR
displayPlaneProperties <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlanePropertiesKHR (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlanePropertiesKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DisplayPlanePropertiesKHR -> DisplayPlaneProperties2KHR
DisplayPlaneProperties2KHR
             DisplayPlanePropertiesKHR
displayPlaneProperties

instance Storable DisplayPlaneProperties2KHR where
  sizeOf :: DisplayPlaneProperties2KHR -> Int
sizeOf ~DisplayPlaneProperties2KHR
_ = Int
32
  alignment :: DisplayPlaneProperties2KHR -> Int
alignment ~DisplayPlaneProperties2KHR
_ = Int
8
  peek :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO DisplayPlaneProperties2KHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> DisplayPlaneProperties2KHR -> IO ()
poke "pProperties" ::: Ptr DisplayPlaneProperties2KHR
ptr DisplayPlaneProperties2KHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayPlaneProperties2KHR
ptr DisplayPlaneProperties2KHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DisplayPlaneProperties2KHR where
  zero :: DisplayPlaneProperties2KHR
zero = DisplayPlanePropertiesKHR -> DisplayPlaneProperties2KHR
DisplayPlaneProperties2KHR
           forall a. Zero a => a
zero


-- | VkDisplayModeProperties2KHR - Structure describing an available display
-- mode
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.VK_KHR_display.DisplayModePropertiesKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDisplayModeProperties2KHR'
data DisplayModeProperties2KHR = DisplayModeProperties2KHR
  { -- | @displayModeProperties@ is a
    -- 'Vulkan.Extensions.VK_KHR_display.DisplayModePropertiesKHR' structure.
    DisplayModeProperties2KHR -> DisplayModePropertiesKHR
displayModeProperties :: DisplayModePropertiesKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DisplayModeProperties2KHR)
#endif
deriving instance Show DisplayModeProperties2KHR

instance ToCStruct DisplayModeProperties2KHR where
  withCStruct :: forall b.
DisplayModeProperties2KHR
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b)
-> IO b
withCStruct DisplayModeProperties2KHR
x ("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \"pProperties" ::: Ptr DisplayModeProperties2KHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayModeProperties2KHR
p DisplayModeProperties2KHR
x (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b
f "pProperties" ::: Ptr DisplayModeProperties2KHR
p)
  pokeCStruct :: forall b.
("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> DisplayModeProperties2KHR -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayModeProperties2KHR
p DisplayModeProperties2KHR{DisplayModePropertiesKHR
displayModeProperties :: DisplayModePropertiesKHR
$sel:displayModeProperties:DisplayModeProperties2KHR :: DisplayModeProperties2KHR -> DisplayModePropertiesKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
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 (("pProperties" ::: Ptr DisplayModeProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModePropertiesKHR)) (DisplayModePropertiesKHR
displayModeProperties)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b -> IO b
pokeZeroCStruct "pProperties" ::: Ptr DisplayModeProperties2KHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
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 (("pProperties" ::: Ptr DisplayModeProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModePropertiesKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DisplayModeProperties2KHR where
  peekCStruct :: ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO DisplayModeProperties2KHR
peekCStruct "pProperties" ::: Ptr DisplayModeProperties2KHR
p = do
    DisplayModePropertiesKHR
displayModeProperties <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayModePropertiesKHR (("pProperties" ::: Ptr DisplayModeProperties2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModePropertiesKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DisplayModePropertiesKHR -> DisplayModeProperties2KHR
DisplayModeProperties2KHR
             DisplayModePropertiesKHR
displayModeProperties

instance Storable DisplayModeProperties2KHR where
  sizeOf :: DisplayModeProperties2KHR -> Int
sizeOf ~DisplayModeProperties2KHR
_ = Int
40
  alignment :: DisplayModeProperties2KHR -> Int
alignment ~DisplayModeProperties2KHR
_ = Int
8
  peek :: ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO DisplayModeProperties2KHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> DisplayModeProperties2KHR -> IO ()
poke "pProperties" ::: Ptr DisplayModeProperties2KHR
ptr DisplayModeProperties2KHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr DisplayModeProperties2KHR
ptr DisplayModeProperties2KHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DisplayModeProperties2KHR where
  zero :: DisplayModeProperties2KHR
zero = DisplayModePropertiesKHR -> DisplayModeProperties2KHR
DisplayModeProperties2KHR
           forall a. Zero a => a
zero


-- | VkDisplayPlaneInfo2KHR - Structure defining the intended configuration
-- of a display plane
--
-- = Description
--
-- Note
--
-- This parameter also implicitly specifies a display.
--
-- -   @planeIndex@ is the plane which the application intends to use with
--     the display.
--
-- The members of 'DisplayPlaneInfo2KHR' correspond to the arguments to
-- 'Vulkan.Extensions.VK_KHR_display.getDisplayPlaneCapabilitiesKHR', with
-- @sType@ and @pNext@ added for extensibility.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDisplayPlaneInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR'
--
-- -   #VUID-VkDisplayPlaneInfo2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkDisplayPlaneInfo2KHR-mode-parameter# @mode@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.DisplayModeKHR' handle
--
-- == Host Synchronization
--
-- -   Host access to @mode@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.Handles.DisplayModeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDisplayPlaneCapabilities2KHR'
data DisplayPlaneInfo2KHR = DisplayPlaneInfo2KHR
  { -- | @mode@ is the display mode the application intends to program when using
    -- the specified plane.
    DisplayPlaneInfo2KHR -> DisplayModeKHR
mode :: DisplayModeKHR
  , -- No documentation found for Nested "VkDisplayPlaneInfo2KHR" "planeIndex"
    DisplayPlaneInfo2KHR -> Word32
planeIndex :: Word32
  }
  deriving (Typeable, DisplayPlaneInfo2KHR -> DisplayPlaneInfo2KHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisplayPlaneInfo2KHR -> DisplayPlaneInfo2KHR -> Bool
$c/= :: DisplayPlaneInfo2KHR -> DisplayPlaneInfo2KHR -> Bool
== :: DisplayPlaneInfo2KHR -> DisplayPlaneInfo2KHR -> Bool
$c== :: DisplayPlaneInfo2KHR -> DisplayPlaneInfo2KHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DisplayPlaneInfo2KHR)
#endif
deriving instance Show DisplayPlaneInfo2KHR

instance ToCStruct DisplayPlaneInfo2KHR where
  withCStruct :: forall b.
DisplayPlaneInfo2KHR
-> (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR) -> IO b)
-> IO b
withCStruct DisplayPlaneInfo2KHR
x ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p DisplayPlaneInfo2KHR
x (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR) -> IO b
f "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p)
  pokeCStruct :: forall b.
("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> DisplayPlaneInfo2KHR -> IO b -> IO b
pokeCStruct "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p DisplayPlaneInfo2KHR{Word32
DisplayModeKHR
planeIndex :: Word32
mode :: DisplayModeKHR
$sel:planeIndex:DisplayPlaneInfo2KHR :: DisplayPlaneInfo2KHR -> Word32
$sel:mode:DisplayPlaneInfo2KHR :: DisplayPlaneInfo2KHR -> DisplayModeKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
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 (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModeKHR)) (DisplayModeKHR
mode)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
planeIndex)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR) -> IO b -> IO b
pokeZeroCStruct "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
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 (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModeKHR)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DisplayPlaneInfo2KHR where
  peekCStruct :: ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> IO DisplayPlaneInfo2KHR
peekCStruct "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p = do
    DisplayModeKHR
mode <- forall a. Storable a => Ptr a -> IO a
peek @DisplayModeKHR (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayModeKHR))
    Word32
planeIndex <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DisplayModeKHR -> Word32 -> DisplayPlaneInfo2KHR
DisplayPlaneInfo2KHR
             DisplayModeKHR
mode Word32
planeIndex

instance Storable DisplayPlaneInfo2KHR where
  sizeOf :: DisplayPlaneInfo2KHR -> Int
sizeOf ~DisplayPlaneInfo2KHR
_ = Int
32
  alignment :: DisplayPlaneInfo2KHR -> Int
alignment ~DisplayPlaneInfo2KHR
_ = Int
8
  peek :: ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> IO DisplayPlaneInfo2KHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
-> DisplayPlaneInfo2KHR -> IO ()
poke "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
ptr DisplayPlaneInfo2KHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR
ptr DisplayPlaneInfo2KHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DisplayPlaneInfo2KHR where
  zero :: DisplayPlaneInfo2KHR
zero = DisplayModeKHR -> Word32 -> DisplayPlaneInfo2KHR
DisplayPlaneInfo2KHR
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkDisplayPlaneCapabilities2KHR - Structure describing the capabilities
-- of a mode and plane combination
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_display_properties2 VK_KHR_get_display_properties2>,
-- 'Vulkan.Extensions.VK_KHR_display.DisplayPlaneCapabilitiesKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDisplayPlaneCapabilities2KHR'
data DisplayPlaneCapabilities2KHR = DisplayPlaneCapabilities2KHR
  { -- | @capabilities@ is a
    -- 'Vulkan.Extensions.VK_KHR_display.DisplayPlaneCapabilitiesKHR'
    -- structure.
    DisplayPlaneCapabilities2KHR -> DisplayPlaneCapabilitiesKHR
capabilities :: DisplayPlaneCapabilitiesKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DisplayPlaneCapabilities2KHR)
#endif
deriving instance Show DisplayPlaneCapabilities2KHR

instance ToCStruct DisplayPlaneCapabilities2KHR where
  withCStruct :: forall b.
DisplayPlaneCapabilities2KHR
-> (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
-> IO b
withCStruct DisplayPlaneCapabilities2KHR
x ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \"pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p DisplayPlaneCapabilities2KHR
x (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b
f "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p)
  pokeCStruct :: forall b.
("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> DisplayPlaneCapabilities2KHR -> IO b -> IO b
pokeCStruct "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p DisplayPlaneCapabilities2KHR{DisplayPlaneCapabilitiesKHR
capabilities :: DisplayPlaneCapabilitiesKHR
$sel:capabilities:DisplayPlaneCapabilities2KHR :: DisplayPlaneCapabilities2KHR -> DisplayPlaneCapabilitiesKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
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 (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlaneCapabilitiesKHR)) (DisplayPlaneCapabilitiesKHR
capabilities)
    IO b
f
  cStructSize :: Int
cStructSize = Int
88
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO b -> IO b
pokeZeroCStruct "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
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 (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlaneCapabilitiesKHR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct DisplayPlaneCapabilities2KHR where
  peekCStruct :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO DisplayPlaneCapabilities2KHR
peekCStruct "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p = do
    DisplayPlaneCapabilitiesKHR
capabilities <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlaneCapabilitiesKHR (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DisplayPlaneCapabilitiesKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DisplayPlaneCapabilitiesKHR -> DisplayPlaneCapabilities2KHR
DisplayPlaneCapabilities2KHR
             DisplayPlaneCapabilitiesKHR
capabilities

instance Storable DisplayPlaneCapabilities2KHR where
  sizeOf :: DisplayPlaneCapabilities2KHR -> Int
sizeOf ~DisplayPlaneCapabilities2KHR
_ = Int
88
  alignment :: DisplayPlaneCapabilities2KHR -> Int
alignment ~DisplayPlaneCapabilities2KHR
_ = Int
8
  peek :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO DisplayPlaneCapabilities2KHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> DisplayPlaneCapabilities2KHR -> IO ()
poke "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
ptr DisplayPlaneCapabilities2KHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
ptr DisplayPlaneCapabilities2KHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero DisplayPlaneCapabilities2KHR where
  zero :: DisplayPlaneCapabilities2KHR
zero = DisplayPlaneCapabilitiesKHR -> DisplayPlaneCapabilities2KHR
DisplayPlaneCapabilities2KHR
           forall a. Zero a => a
zero


type KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION"
pattern KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION :: forall a. Integral a => a
$mKHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION = 1


type KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME = "VK_KHR_get_display_properties2"

-- No documentation found for TopLevel "VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME"
pattern KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME = "VK_KHR_get_display_properties2"