{-# 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 Vulkan 1.0
--
--     -   Requires @VK_KHR_display@
--
-- [__Contact__]
--
--     -   James Jones
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_get_display_properties2:%20&body=@cubanismo%20 >
--
-- == 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 wouldn’t
--     make sense.
--
-- -   'getPhysicalDeviceDisplayPlaneProperties2KHR': No. The only current
--     input is a 'Vulkan.Core10.Handles.PhysicalDevice'. Other inputs
--     wouldn’t make sense.
--
-- -   'getDisplayModeProperties2KHR': No. The only current inputs are a
--     'Vulkan.Core10.Handles.PhysicalDevice' and a
--     'Vulkan.Extensions.Handles.DisplayModeKHR'. Other inputs wouldn’t
--     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://www.khronos.org/registry/vulkan/specs/1.2-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 (allocaBytesAligned)
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_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
--
-- 'DisplayProperties2KHR', 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceDisplayProperties2KHR :: forall io
                                        . (MonadIO io)
                                       => -- | @physicalDevice@ is a physical device.
                                          PhysicalDevice
                                       -> io (Result, ("properties" ::: Vector DisplayProperties2KHR))
getPhysicalDeviceDisplayProperties2KHR :: PhysicalDevice
-> io (Result, "properties" ::: Vector DisplayProperties2KHR)
getPhysicalDeviceDisplayProperties2KHR physicalDevice :: PhysicalDevice
physicalDevice = IO (Result, "properties" ::: Vector DisplayProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayProperties2KHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "properties" ::: Vector DisplayProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayProperties2KHR))
-> (ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "properties" ::: Vector DisplayProperties2KHR)
  IO
  (Result, "properties" ::: Vector DisplayProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "properties" ::: Vector DisplayProperties2KHR)
   IO
   (Result, "properties" ::: Vector DisplayProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayProperties2KHR)
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 (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayProperties2KHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayProperties2KHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetPhysicalDeviceDisplayProperties2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pPropertyCount" ::: Ptr Word32)
  -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPropertyCount" ::: Ptr Word32)
   -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR)
      IO
      ("pPropertyCount" ::: Ptr Word32))
-> ((("pPropertyCount" ::: Ptr Word32)
     -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO ("pPropertyCount" ::: Ptr Word32)
-> (("pPropertyCount" ::: Ptr Word32) -> IO ())
-> (("pPropertyCount" ::: Ptr Word32)
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPropertyCount" ::: Ptr Word32)
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("pPropertyCount" ::: Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPhysicalDeviceDisplayProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayProperties2KHR' Ptr PhysicalDevice_T
physicalDevice' ("pPropertyCount" ::: Ptr Word32
pPPropertyCount) ("pProperties" ::: Ptr DisplayProperties2KHR
forall a. Ptr a
nullPtr))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayProperties2KHR
pPProperties <- ((("pProperties" ::: Ptr DisplayProperties2KHR)
  -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayProperties2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pProperties" ::: Ptr DisplayProperties2KHR)
   -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR)
      IO
      ("pProperties" ::: Ptr DisplayProperties2KHR))
-> ((("pProperties" ::: Ptr DisplayProperties2KHR)
     -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayProperties2KHR)
forall a b. (a -> b) -> a -> b
$ IO ("pProperties" ::: Ptr DisplayProperties2KHR)
-> (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO ())
-> (("pProperties" ::: Ptr DisplayProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pProperties" ::: Ptr DisplayProperties2KHR)
forall a. Int -> IO (Ptr a)
callocBytes @DisplayProperties2KHR ((Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 64)) ("pProperties" ::: Ptr DisplayProperties2KHR) -> IO ()
forall a. Ptr a -> IO ()
free
  [()]
_ <- (Int
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO ())
-> [Int]
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO [()]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\i :: Int
i -> ((() -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((()
   -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO ())
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayProperties2KHR
pPProperties ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* 64) :: Ptr DisplayProperties2KHR) (IO (Result, "properties" ::: Vector DisplayProperties2KHR)
 -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> (()
    -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO (Result, "properties" ::: Vector DisplayProperties2KHR))
-> () -> IO (Result, "properties" ::: Vector DisplayProperties2KHR)
forall a b. (a -> b) -> a -> b
$ ())) [0..(Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1]
  Result
r' <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "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)))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR) IO Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayProperties2KHR
pProperties' <- IO ("properties" ::: Vector DisplayProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("properties" ::: Vector DisplayProperties2KHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("properties" ::: Vector DisplayProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR)
      IO
      ("properties" ::: Vector DisplayProperties2KHR))
-> IO ("properties" ::: Vector DisplayProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     ("properties" ::: Vector DisplayProperties2KHR)
forall a b. (a -> b) -> a -> b
$ Int
-> (Int -> IO DisplayProperties2KHR)
-> IO ("properties" ::: Vector DisplayProperties2KHR)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\i :: Int
i -> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> IO DisplayProperties2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayProperties2KHR ((("pProperties" ::: Ptr DisplayProperties2KHR
pPProperties) ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayProperties2KHR)))
  (Result, "properties" ::: Vector DisplayProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayProperties2KHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "properties" ::: Vector DisplayProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayProperties2KHR))
-> (Result, "properties" ::: Vector DisplayProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayProperties2KHR)
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
--
-- 'DisplayPlaneProperties2KHR', 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceDisplayPlaneProperties2KHR :: forall io
                                             . (MonadIO io)
                                            => -- | @physicalDevice@ is a physical device.
                                               PhysicalDevice
                                            -> io (Result, ("properties" ::: Vector DisplayPlaneProperties2KHR))
getPhysicalDeviceDisplayPlaneProperties2KHR :: PhysicalDevice
-> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
getPhysicalDeviceDisplayPlaneProperties2KHR physicalDevice :: PhysicalDevice
physicalDevice = IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> (ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
  IO
  (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
   IO
   (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
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 (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
vkGetPhysicalDeviceDisplayPlaneProperties2KHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetPhysicalDeviceDisplayPlaneProperties2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pPropertyCount" ::: Ptr Word32)
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPropertyCount" ::: Ptr Word32)
   -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      ("pPropertyCount" ::: Ptr Word32))
-> ((("pPropertyCount" ::: Ptr Word32)
     -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO ("pPropertyCount" ::: Ptr Word32)
-> (("pPropertyCount" ::: Ptr Word32) -> IO ())
-> (("pPropertyCount" ::: Ptr Word32)
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPropertyCount" ::: Ptr Word32)
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("pPropertyCount" ::: Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPhysicalDeviceDisplayPlaneProperties2KHR" (Ptr PhysicalDevice_T
-> ("pPropertyCount" ::: Ptr Word32)
-> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO Result
vkGetPhysicalDeviceDisplayPlaneProperties2KHR' Ptr PhysicalDevice_T
physicalDevice' ("pPropertyCount" ::: Ptr Word32
pPPropertyCount) ("pProperties" ::: Ptr DisplayPlaneProperties2KHR
forall a. Ptr a
nullPtr))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties <- ((("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
   -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      ("pProperties" ::: Ptr DisplayPlaneProperties2KHR))
-> ((("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
     -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
forall a b. (a -> b) -> a -> b
$ IO ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO ())
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
forall a. Int -> IO (Ptr a)
callocBytes @DisplayPlaneProperties2KHR ((Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32)) ("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO ()
forall a. Ptr a -> IO ()
free
  [()]
_ <- (Int
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ())
-> [Int]
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     [()]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\i :: Int
i -> ((()
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((()
   -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ())
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayPlaneProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32) :: Ptr DisplayPlaneProperties2KHR) (IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
 -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> (()
    -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((()
 -> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> ()
-> IO (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall a b. (a -> b) -> a -> b
$ ())) [0..(Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1]
  Result
r' <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "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)))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayPlaneProperties2KHR
pProperties' <- IO ("properties" ::: Vector DisplayPlaneProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("properties" ::: Vector DisplayPlaneProperties2KHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("properties" ::: Vector DisplayPlaneProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      ("properties" ::: Vector DisplayPlaneProperties2KHR))
-> IO ("properties" ::: Vector DisplayPlaneProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     ("properties" ::: Vector DisplayPlaneProperties2KHR)
forall a b. (a -> b) -> a -> b
$ Int
-> (Int -> IO DisplayPlaneProperties2KHR)
-> IO ("properties" ::: Vector DisplayPlaneProperties2KHR)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\i :: Int
i -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> IO DisplayPlaneProperties2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlaneProperties2KHR ((("pProperties" ::: Ptr DisplayPlaneProperties2KHR
pPProperties) ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayPlaneProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayPlaneProperties2KHR)))
  (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayPlaneProperties2KHR))
-> (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayPlaneProperties2KHR)
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
--
-- '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 :: PhysicalDevice
-> DisplayKHR
-> io (Result, "properties" ::: Vector DisplayModeProperties2KHR)
getDisplayModeProperties2KHR physicalDevice :: PhysicalDevice
physicalDevice display :: DisplayKHR
display = IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> (ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, "properties" ::: Vector DisplayModeProperties2KHR)
  IO
  (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, "properties" ::: Vector DisplayModeProperties2KHR)
   IO
   (Result, "properties" ::: Vector DisplayModeProperties2KHR)
 -> io (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> io (Result, "properties" ::: Vector DisplayModeProperties2KHR)
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 (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
vkGetDisplayModeProperties2KHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> DisplayKHR
      -> ("pPropertyCount" ::: Ptr Word32)
      -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> DisplayKHR
   -> ("pPropertyCount" ::: Ptr Word32)
   -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetDisplayModeProperties2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pPropertyCount" ::: Ptr Word32)
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPropertyCount" ::: Ptr Word32)
   -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      ("pPropertyCount" ::: Ptr Word32))
-> ((("pPropertyCount" ::: Ptr Word32)
     -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("pPropertyCount" ::: Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO ("pPropertyCount" ::: Ptr Word32)
-> (("pPropertyCount" ::: Ptr Word32) -> IO ())
-> (("pPropertyCount" ::: Ptr Word32)
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPropertyCount" ::: Ptr Word32)
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("pPropertyCount" ::: Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "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
forall a. Ptr a
nullPtr))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pPropertyCount <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties <- ((("pProperties" ::: Ptr DisplayModeProperties2KHR)
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayModeProperties2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pProperties" ::: Ptr DisplayModeProperties2KHR)
   -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      ("pProperties" ::: Ptr DisplayModeProperties2KHR))
-> ((("pProperties" ::: Ptr DisplayModeProperties2KHR)
     -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("pProperties" ::: Ptr DisplayModeProperties2KHR)
forall a b. (a -> b) -> a -> b
$ IO ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO ())
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR)
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pProperties" ::: Ptr DisplayModeProperties2KHR)
forall a. Int -> IO (Ptr a)
callocBytes @DisplayModeProperties2KHR ((Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 40)) ("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO ()
forall a. Ptr a -> IO ()
free
  [()]
_ <- (Int
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ())
-> [Int]
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO [()]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\i :: Int
i -> ((()
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((()
   -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
  -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ())
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayModeProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* 40) :: Ptr DisplayModeProperties2KHR) (IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
 -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ((()
     -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> (()
    -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((()
 -> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> ()
-> IO (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall a b. (a -> b) -> a -> b
$ ())) [0..(Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1]
  Result
r' <- IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "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)))
  IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ())
-> IO ()
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pPropertyCount' <- IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pPropertyCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pPropertyCount" ::: Ptr Word32
pPPropertyCount
  "properties" ::: Vector DisplayModeProperties2KHR
pProperties' <- IO ("properties" ::: Vector DisplayModeProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("properties" ::: Vector DisplayModeProperties2KHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("properties" ::: Vector DisplayModeProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      ("properties" ::: Vector DisplayModeProperties2KHR))
-> IO ("properties" ::: Vector DisplayModeProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     ("properties" ::: Vector DisplayModeProperties2KHR)
forall a b. (a -> b) -> a -> b
$ Int
-> (Int -> IO DisplayModeProperties2KHR)
-> IO ("properties" ::: Vector DisplayModeProperties2KHR)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPropertyCount')) (\i :: Int
i -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> IO DisplayModeProperties2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayModeProperties2KHR ((("pProperties" ::: Ptr DisplayModeProperties2KHR
pPProperties) ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> "pProperties" ::: Ptr DisplayModeProperties2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DisplayModeProperties2KHR)))
  (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "properties" ::: Vector DisplayModeProperties2KHR)
 -> ContT
      (Result, "properties" ::: Vector DisplayModeProperties2KHR)
      IO
      (Result, "properties" ::: Vector DisplayModeProperties2KHR))
-> (Result, "properties" ::: Vector DisplayModeProperties2KHR)
-> ContT
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
     IO
     (Result, "properties" ::: Vector DisplayModeProperties2KHR)
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
--
-- '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 :: PhysicalDevice
-> DisplayPlaneInfo2KHR -> io DisplayPlaneCapabilities2KHR
getDisplayPlaneCapabilities2KHR physicalDevice :: PhysicalDevice
physicalDevice displayPlaneInfo :: DisplayPlaneInfo2KHR
displayPlaneInfo = IO DisplayPlaneCapabilities2KHR -> io DisplayPlaneCapabilities2KHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DisplayPlaneCapabilities2KHR
 -> io DisplayPlaneCapabilities2KHR)
-> (ContT
      DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
    -> IO DisplayPlaneCapabilities2KHR)
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
-> io DisplayPlaneCapabilities2KHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
-> IO DisplayPlaneCapabilities2KHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
 -> io DisplayPlaneCapabilities2KHR)
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
-> io DisplayPlaneCapabilities2KHR
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 (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  IO () -> ContT DisplayPlaneCapabilities2KHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT DisplayPlaneCapabilities2KHR IO ())
-> IO () -> ContT DisplayPlaneCapabilities2KHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
vkGetDisplayPlaneCapabilities2KHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
      -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetDisplayPlaneCapabilities2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
  -> IO DisplayPlaneCapabilities2KHR)
 -> IO DisplayPlaneCapabilities2KHR)
-> ContT
     DisplayPlaneCapabilities2KHR
     IO
     ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
   -> IO DisplayPlaneCapabilities2KHR)
  -> IO DisplayPlaneCapabilities2KHR)
 -> ContT
      DisplayPlaneCapabilities2KHR
      IO
      ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR))
-> ((("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
     -> IO DisplayPlaneCapabilities2KHR)
    -> IO DisplayPlaneCapabilities2KHR)
-> ContT
     DisplayPlaneCapabilities2KHR
     IO
     ("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
forall a b. (a -> b) -> a -> b
$ DisplayPlaneInfo2KHR
-> (("pDisplayPlaneInfo" ::: Ptr DisplayPlaneInfo2KHR)
    -> IO DisplayPlaneCapabilities2KHR)
-> IO DisplayPlaneCapabilities2KHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DisplayPlaneInfo2KHR
displayPlaneInfo)
  "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
pPCapabilities <- ((("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
  -> IO DisplayPlaneCapabilities2KHR)
 -> IO DisplayPlaneCapabilities2KHR)
-> ContT
     DisplayPlaneCapabilities2KHR
     IO
     ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct DisplayPlaneCapabilities2KHR =>
(("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
-> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @DisplayPlaneCapabilities2KHR)
  Result
r <- IO Result -> ContT DisplayPlaneCapabilities2KHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT DisplayPlaneCapabilities2KHR IO Result)
-> IO Result -> ContT DisplayPlaneCapabilities2KHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "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))
  IO () -> ContT DisplayPlaneCapabilities2KHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT DisplayPlaneCapabilities2KHR IO ())
-> IO () -> ContT DisplayPlaneCapabilities2KHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  DisplayPlaneCapabilities2KHR
pCapabilities <- IO DisplayPlaneCapabilities2KHR
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO DisplayPlaneCapabilities2KHR
 -> ContT
      DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR)
-> IO DisplayPlaneCapabilities2KHR
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
forall a b. (a -> b) -> a -> b
$ ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO DisplayPlaneCapabilities2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DisplayPlaneCapabilities2KHR "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
pPCapabilities
  DisplayPlaneCapabilities2KHR
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DisplayPlaneCapabilities2KHR
 -> ContT
      DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR)
-> DisplayPlaneCapabilities2KHR
-> ContT
     DisplayPlaneCapabilities2KHR IO DisplayPlaneCapabilities2KHR
forall a b. (a -> b) -> a -> b
$ (DisplayPlaneCapabilities2KHR
pCapabilities)


-- | VkDisplayProperties2KHR - Structure describing an available display
-- device
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- '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 :: DisplayProperties2KHR
-> (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b) -> IO b
withCStruct x :: DisplayProperties2KHR
x f :: ("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b
f = Int
-> Int
-> (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b) -> IO b)
-> (("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pProperties" ::: Ptr DisplayProperties2KHR
p -> ("pProperties" ::: Ptr DisplayProperties2KHR)
-> DisplayProperties2KHR -> IO b -> IO b
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 :: ("pProperties" ::: Ptr DisplayProperties2KHR)
-> DisplayProperties2KHR -> IO b -> IO b
pokeCStruct p :: "pProperties" ::: Ptr DisplayProperties2KHR
p DisplayProperties2KHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DisplayPropertiesKHR -> DisplayPropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr DisplayPropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPropertiesKHR)) (DisplayPropertiesKHR
displayProperties) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pProperties" ::: Ptr DisplayProperties2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pProperties" ::: Ptr DisplayProperties2KHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DisplayPropertiesKHR -> DisplayPropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pProperties" ::: Ptr DisplayProperties2KHR
p ("pProperties" ::: Ptr DisplayProperties2KHR)
-> Int -> Ptr DisplayPropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPropertiesKHR)) (DisplayPropertiesKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

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

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


-- | VkDisplayPlaneProperties2KHR - Structure describing an available display
-- plane
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- '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 :: DisplayPlaneProperties2KHR
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b)
-> IO b
withCStruct x :: DisplayPlaneProperties2KHR
x f :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b
f = Int
-> Int
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b)
 -> IO b)
-> (("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p -> ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> DisplayPlaneProperties2KHR -> IO b -> IO b
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 :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> DisplayPlaneProperties2KHR -> IO b -> IO b
pokeCStruct p :: "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p DisplayPlaneProperties2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayPlanePropertiesKHR -> DisplayPlanePropertiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr DisplayPlanePropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPlanePropertiesKHR)) (DisplayPlanePropertiesKHR
displayPlaneProperties)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pProperties" ::: Ptr DisplayPlaneProperties2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pProperties" ::: Ptr DisplayPlaneProperties2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayPlanePropertiesKHR -> DisplayPlanePropertiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayPlaneProperties2KHR
p ("pProperties" ::: Ptr DisplayPlaneProperties2KHR)
-> Int -> Ptr DisplayPlanePropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPlanePropertiesKHR)) (DisplayPlanePropertiesKHR
forall a. Zero a => a
zero)
    IO b
f

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

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

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


-- | VkDisplayModeProperties2KHR - Structure describing an available display
-- mode
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- '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 :: DisplayModeProperties2KHR
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b)
-> IO b
withCStruct x :: DisplayModeProperties2KHR
x f :: ("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b
f = Int
-> Int
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b)
 -> IO b)
-> (("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pProperties" ::: Ptr DisplayModeProperties2KHR
p -> ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> DisplayModeProperties2KHR -> IO b -> IO b
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 :: ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> DisplayModeProperties2KHR -> IO b -> IO b
pokeCStruct p :: "pProperties" ::: Ptr DisplayModeProperties2KHR
p DisplayModeProperties2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayModePropertiesKHR -> DisplayModePropertiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr DisplayModePropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayModePropertiesKHR)) (DisplayModePropertiesKHR
displayModeProperties)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pProperties" ::: Ptr DisplayModeProperties2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pProperties" ::: Ptr DisplayModeProperties2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayModePropertiesKHR -> DisplayModePropertiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr DisplayModeProperties2KHR
p ("pProperties" ::: Ptr DisplayModeProperties2KHR)
-> Int -> Ptr DisplayModePropertiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayModePropertiesKHR)) (DisplayModePropertiesKHR
forall a. Zero a => a
zero)
    IO b
f

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

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

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

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

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

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


-- | VkDisplayPlaneCapabilities2KHR - Structure describing the capabilities
-- of a mode and plane combination
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- '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 :: DisplayPlaneCapabilities2KHR
-> (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
-> IO b
withCStruct x :: DisplayPlaneCapabilities2KHR
x f :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b
f = Int
-> Int
-> (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 88 8 ((("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
 -> IO b)
-> (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p -> ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> DisplayPlaneCapabilities2KHR -> IO b -> IO b
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 :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> DisplayPlaneCapabilities2KHR -> IO b -> IO b
pokeCStruct p :: "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p DisplayPlaneCapabilities2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayPlaneCapabilitiesKHR
-> DisplayPlaneCapabilitiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr DisplayPlaneCapabilitiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPlaneCapabilitiesKHR)) (DisplayPlaneCapabilitiesKHR
capabilities)
    IO b
f
  cStructSize :: Int
cStructSize = 88
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DisplayPlaneCapabilitiesKHR
-> DisplayPlaneCapabilitiesKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR
p ("pCapabilities" ::: Ptr DisplayPlaneCapabilities2KHR)
-> Int -> Ptr DisplayPlaneCapabilitiesKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DisplayPlaneCapabilitiesKHR)) (DisplayPlaneCapabilitiesKHR
forall a. Zero a => a
zero)
    IO b
f

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

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

instance Zero DisplayPlaneCapabilities2KHR where
  zero :: DisplayPlaneCapabilities2KHR
zero = DisplayPlaneCapabilitiesKHR -> DisplayPlaneCapabilities2KHR
DisplayPlaneCapabilities2KHR
           DisplayPlaneCapabilitiesKHR
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 :: a
$mKHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> 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 :: a
$mKHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME = "VK_KHR_get_display_properties2"