{-# language CPP #-}
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
getPhysicalDeviceDisplayProperties2KHR :: forall io
. (MonadIO io)
=>
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
getPhysicalDeviceDisplayPlaneProperties2KHR :: forall io
. (MonadIO io)
=>
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
getDisplayModeProperties2KHR :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
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
getDisplayPlaneCapabilities2KHR :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
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)
data DisplayProperties2KHR = DisplayProperties2KHR
{
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
data DisplayPlaneProperties2KHR = DisplayPlaneProperties2KHR
{
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
data DisplayModeProperties2KHR = DisplayModeProperties2KHR
{
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
data DisplayPlaneInfo2KHR = DisplayPlaneInfo2KHR
{
DisplayPlaneInfo2KHR -> DisplayModeKHR
mode :: DisplayModeKHR
,
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
data DisplayPlaneCapabilities2KHR = DisplayPlaneCapabilities2KHR
{
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
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"
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"