{-# language CPP #-}
module Vulkan.Extensions.VK_QNX_external_memory_screen_buffer ( getScreenBufferPropertiesQNX
, ImportScreenBufferInfoQNX(..)
, ScreenBufferPropertiesQNX(..)
, ScreenBufferFormatPropertiesQNX(..)
, ExternalFormatQNX(..)
, PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX(..)
, QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION
, pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION
, QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME
, pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME
, Screen_buffer
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
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 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.Type.Equality ((:~:)(Refl))
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.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core11.Enums.ChromaLocation (ChromaLocation)
import Vulkan.Core10.ImageView (ComponentMapping)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetScreenBufferPropertiesQNX))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlags)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core11.Enums.SamplerYcbcrModelConversion (SamplerYcbcrModelConversion)
import Vulkan.Core11.Enums.SamplerYcbcrRange (SamplerYcbcrRange)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetScreenBufferPropertiesQNX
:: FunPtr (Ptr Device_T -> Ptr Screen_buffer -> Ptr (SomeStruct ScreenBufferPropertiesQNX) -> IO Result) -> Ptr Device_T -> Ptr Screen_buffer -> Ptr (SomeStruct ScreenBufferPropertiesQNX) -> IO Result
getScreenBufferPropertiesQNX :: forall a io
. ( Extendss ScreenBufferPropertiesQNX a
, PokeChain a
, PeekChain a
, MonadIO io )
=>
Device
->
(Ptr Screen_buffer)
-> io (ScreenBufferPropertiesQNX a)
getScreenBufferPropertiesQNX :: forall (a :: [*]) (io :: * -> *).
(Extendss ScreenBufferPropertiesQNX a, PokeChain a, PeekChain a,
MonadIO io) =>
Device -> Ptr Screen_buffer -> io (ScreenBufferPropertiesQNX a)
getScreenBufferPropertiesQNX Device
device Ptr Screen_buffer
buffer = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkGetScreenBufferPropertiesQNXPtr :: FunPtr
(Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result)
vkGetScreenBufferPropertiesQNXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result)
pVkGetScreenBufferPropertiesQNX (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result)
vkGetScreenBufferPropertiesQNXPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetScreenBufferPropertiesQNX is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetScreenBufferPropertiesQNX' :: Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
vkGetScreenBufferPropertiesQNX' = FunPtr
(Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result)
-> Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
mkVkGetScreenBufferPropertiesQNX FunPtr
(Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result)
vkGetScreenBufferPropertiesQNXPtr
Ptr (ScreenBufferPropertiesQNX a)
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(ScreenBufferPropertiesQNX _))
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetScreenBufferPropertiesQNX" (Ptr Device_T
-> Ptr Screen_buffer
-> ("pProperties" ::: Ptr (SomeStruct ScreenBufferPropertiesQNX))
-> IO Result
vkGetScreenBufferPropertiesQNX'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(Ptr Screen_buffer
buffer)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ScreenBufferPropertiesQNX a)
pPProperties)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
ScreenBufferPropertiesQNX a
pProperties <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(ScreenBufferPropertiesQNX _) Ptr (ScreenBufferPropertiesQNX a)
pPProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (ScreenBufferPropertiesQNX a
pProperties)
data ImportScreenBufferInfoQNX = ImportScreenBufferInfoQNX
{
ImportScreenBufferInfoQNX -> Ptr Screen_buffer
buffer :: Ptr Screen_buffer }
deriving (Typeable, ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
$c/= :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
== :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
$c== :: ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportScreenBufferInfoQNX)
#endif
deriving instance Show ImportScreenBufferInfoQNX
instance ToCStruct ImportScreenBufferInfoQNX where
withCStruct :: forall b.
ImportScreenBufferInfoQNX
-> (Ptr ImportScreenBufferInfoQNX -> IO b) -> IO b
withCStruct ImportScreenBufferInfoQNX
x Ptr ImportScreenBufferInfoQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ImportScreenBufferInfoQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportScreenBufferInfoQNX
p ImportScreenBufferInfoQNX
x (Ptr ImportScreenBufferInfoQNX -> IO b
f Ptr ImportScreenBufferInfoQNX
p)
pokeCStruct :: forall b.
Ptr ImportScreenBufferInfoQNX
-> ImportScreenBufferInfoQNX -> IO b -> IO b
pokeCStruct Ptr ImportScreenBufferInfoQNX
p ImportScreenBufferInfoQNX{Ptr Screen_buffer
buffer :: Ptr Screen_buffer
$sel:buffer:ImportScreenBufferInfoQNX :: ImportScreenBufferInfoQNX -> Ptr Screen_buffer
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer))) (Ptr Screen_buffer
buffer)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImportScreenBufferInfoQNX -> IO b -> IO b
pokeZeroCStruct Ptr ImportScreenBufferInfoQNX
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImportScreenBufferInfoQNX where
peekCStruct :: Ptr ImportScreenBufferInfoQNX -> IO ImportScreenBufferInfoQNX
peekCStruct Ptr ImportScreenBufferInfoQNX
p = do
Ptr Screen_buffer
buffer <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Screen_buffer) ((Ptr ImportScreenBufferInfoQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Screen_buffer)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Screen_buffer -> ImportScreenBufferInfoQNX
ImportScreenBufferInfoQNX
Ptr Screen_buffer
buffer
instance Storable ImportScreenBufferInfoQNX where
sizeOf :: ImportScreenBufferInfoQNX -> Int
sizeOf ~ImportScreenBufferInfoQNX
_ = Int
24
alignment :: ImportScreenBufferInfoQNX -> Int
alignment ~ImportScreenBufferInfoQNX
_ = Int
8
peek :: Ptr ImportScreenBufferInfoQNX -> IO ImportScreenBufferInfoQNX
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImportScreenBufferInfoQNX -> ImportScreenBufferInfoQNX -> IO ()
poke Ptr ImportScreenBufferInfoQNX
ptr ImportScreenBufferInfoQNX
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportScreenBufferInfoQNX
ptr ImportScreenBufferInfoQNX
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImportScreenBufferInfoQNX where
zero :: ImportScreenBufferInfoQNX
zero = Ptr Screen_buffer -> ImportScreenBufferInfoQNX
ImportScreenBufferInfoQNX
forall a. Zero a => a
zero
data ScreenBufferPropertiesQNX (es :: [Type]) = ScreenBufferPropertiesQNX
{
forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
next :: Chain es
,
forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
allocationSize :: DeviceSize
,
forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
memoryTypeBits :: Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ScreenBufferPropertiesQNX (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ScreenBufferPropertiesQNX es)
instance Extensible ScreenBufferPropertiesQNX where
extensibleTypeName :: String
extensibleTypeName = String
"ScreenBufferPropertiesQNX"
setNext :: forall (ds :: [*]) (es :: [*]).
ScreenBufferPropertiesQNX ds
-> Chain es -> ScreenBufferPropertiesQNX es
setNext ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain ds
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain ds
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} Chain es
next' = ScreenBufferPropertiesQNX{$sel:next:ScreenBufferPropertiesQNX :: Chain es
next = Chain es
next', Word32
DeviceSize
memoryTypeBits :: Word32
allocationSize :: DeviceSize
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: DeviceSize
..}
getNext :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
getNext ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain es
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain es
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends ScreenBufferPropertiesQNX e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends ScreenBufferPropertiesQNX e => b) -> Maybe b
extends proxy e
_ Extends ScreenBufferPropertiesQNX e => b
f
| Just e :~: ScreenBufferFormatPropertiesQNX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ScreenBufferFormatPropertiesQNX = forall a. a -> Maybe a
Just Extends ScreenBufferPropertiesQNX e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss ScreenBufferPropertiesQNX es
, PokeChain es ) => ToCStruct (ScreenBufferPropertiesQNX es) where
withCStruct :: forall b.
ScreenBufferPropertiesQNX es
-> (Ptr (ScreenBufferPropertiesQNX es) -> IO b) -> IO b
withCStruct ScreenBufferPropertiesQNX es
x Ptr (ScreenBufferPropertiesQNX es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr (ScreenBufferPropertiesQNX es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ScreenBufferPropertiesQNX es)
p ScreenBufferPropertiesQNX es
x (Ptr (ScreenBufferPropertiesQNX es) -> IO b
f Ptr (ScreenBufferPropertiesQNX es)
p)
pokeCStruct :: forall b.
Ptr (ScreenBufferPropertiesQNX es)
-> ScreenBufferPropertiesQNX es -> IO b -> IO b
pokeCStruct Ptr (ScreenBufferPropertiesQNX es)
p ScreenBufferPropertiesQNX{Word32
DeviceSize
Chain es
memoryTypeBits :: Word32
allocationSize :: DeviceSize
next :: Chain es
$sel:memoryTypeBits:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Word32
$sel:allocationSize:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> DeviceSize
$sel:next:ScreenBufferPropertiesQNX :: forall (es :: [*]). ScreenBufferPropertiesQNX es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
allocationSize)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
memoryTypeBits)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (ScreenBufferPropertiesQNX es) -> IO b -> IO b
pokeZeroCStruct Ptr (ScreenBufferPropertiesQNX es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss ScreenBufferPropertiesQNX es
, PeekChain es ) => FromCStruct (ScreenBufferPropertiesQNX es) where
peekCStruct :: Ptr (ScreenBufferPropertiesQNX es)
-> IO (ScreenBufferPropertiesQNX es)
peekCStruct Ptr (ScreenBufferPropertiesQNX es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
DeviceSize
allocationSize <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
Word32
memoryTypeBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (ScreenBufferPropertiesQNX es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es -> DeviceSize -> Word32 -> ScreenBufferPropertiesQNX es
ScreenBufferPropertiesQNX
Chain es
next DeviceSize
allocationSize Word32
memoryTypeBits
instance es ~ '[] => Zero (ScreenBufferPropertiesQNX es) where
zero :: ScreenBufferPropertiesQNX es
zero = forall (es :: [*]).
Chain es -> DeviceSize -> Word32 -> ScreenBufferPropertiesQNX es
ScreenBufferPropertiesQNX
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ScreenBufferFormatPropertiesQNX = ScreenBufferFormatPropertiesQNX
{
ScreenBufferFormatPropertiesQNX -> Format
format :: Format
,
ScreenBufferFormatPropertiesQNX -> DeviceSize
externalFormat :: Word64
,
ScreenBufferFormatPropertiesQNX -> DeviceSize
screenUsage :: Word64
,
ScreenBufferFormatPropertiesQNX -> FormatFeatureFlags
formatFeatures :: FormatFeatureFlags
,
ScreenBufferFormatPropertiesQNX -> ComponentMapping
samplerYcbcrConversionComponents :: ComponentMapping
,
ScreenBufferFormatPropertiesQNX -> SamplerYcbcrModelConversion
suggestedYcbcrModel :: SamplerYcbcrModelConversion
,
ScreenBufferFormatPropertiesQNX -> SamplerYcbcrRange
suggestedYcbcrRange :: SamplerYcbcrRange
,
ScreenBufferFormatPropertiesQNX -> ChromaLocation
suggestedXChromaOffset :: ChromaLocation
,
ScreenBufferFormatPropertiesQNX -> ChromaLocation
suggestedYChromaOffset :: ChromaLocation
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ScreenBufferFormatPropertiesQNX)
#endif
deriving instance Show ScreenBufferFormatPropertiesQNX
instance ToCStruct ScreenBufferFormatPropertiesQNX where
withCStruct :: forall b.
ScreenBufferFormatPropertiesQNX
-> (Ptr ScreenBufferFormatPropertiesQNX -> IO b) -> IO b
withCStruct ScreenBufferFormatPropertiesQNX
x Ptr ScreenBufferFormatPropertiesQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 forall a b. (a -> b) -> a -> b
$ \Ptr ScreenBufferFormatPropertiesQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ScreenBufferFormatPropertiesQNX
p ScreenBufferFormatPropertiesQNX
x (Ptr ScreenBufferFormatPropertiesQNX -> IO b
f Ptr ScreenBufferFormatPropertiesQNX
p)
pokeCStruct :: forall b.
Ptr ScreenBufferFormatPropertiesQNX
-> ScreenBufferFormatPropertiesQNX -> IO b -> IO b
pokeCStruct Ptr ScreenBufferFormatPropertiesQNX
p ScreenBufferFormatPropertiesQNX{DeviceSize
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
FormatFeatureFlags
suggestedYChromaOffset :: ChromaLocation
suggestedXChromaOffset :: ChromaLocation
suggestedYcbcrRange :: SamplerYcbcrRange
suggestedYcbcrModel :: SamplerYcbcrModelConversion
samplerYcbcrConversionComponents :: ComponentMapping
formatFeatures :: FormatFeatureFlags
screenUsage :: DeviceSize
externalFormat :: DeviceSize
format :: Format
$sel:suggestedYChromaOffset:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ChromaLocation
$sel:suggestedXChromaOffset:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ChromaLocation
$sel:suggestedYcbcrRange:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> SamplerYcbcrRange
$sel:suggestedYcbcrModel:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> SamplerYcbcrModelConversion
$sel:samplerYcbcrConversionComponents:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> ComponentMapping
$sel:formatFeatures:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> FormatFeatureFlags
$sel:screenUsage:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> DeviceSize
$sel:externalFormat:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> DeviceSize
$sel:format:ScreenBufferFormatPropertiesQNX :: ScreenBufferFormatPropertiesQNX -> Format
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (Format
format)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (DeviceSize
externalFormat)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (DeviceSize
screenUsage)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (FormatFeatureFlags
formatFeatures)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping)) (ComponentMapping
samplerYcbcrConversionComponents)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
suggestedYcbcrModel)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
suggestedYcbcrRange)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation)) (ChromaLocation
suggestedXChromaOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation)) (ChromaLocation
suggestedYChromaOffset)
IO b
f
cStructSize :: Int
cStructSize = Int
80
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ScreenBufferFormatPropertiesQNX -> IO b -> IO b
pokeZeroCStruct Ptr ScreenBufferFormatPropertiesQNX
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ScreenBufferFormatPropertiesQNX where
peekCStruct :: Ptr ScreenBufferFormatPropertiesQNX
-> IO ScreenBufferFormatPropertiesQNX
peekCStruct Ptr ScreenBufferFormatPropertiesQNX
p = do
Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format))
DeviceSize
externalFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64))
DeviceSize
screenUsage <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64))
FormatFeatureFlags
formatFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags))
ComponentMapping
samplerYcbcrConversionComponents <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ComponentMapping))
SamplerYcbcrModelConversion
suggestedYcbcrModel <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrModelConversion ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr SamplerYcbcrModelConversion))
SamplerYcbcrRange
suggestedYcbcrRange <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrRange ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr SamplerYcbcrRange))
ChromaLocation
suggestedXChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr ChromaLocation))
ChromaLocation
suggestedYChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr ScreenBufferFormatPropertiesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ChromaLocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Format
-> DeviceSize
-> DeviceSize
-> FormatFeatureFlags
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> ScreenBufferFormatPropertiesQNX
ScreenBufferFormatPropertiesQNX
Format
format
DeviceSize
externalFormat
DeviceSize
screenUsage
FormatFeatureFlags
formatFeatures
ComponentMapping
samplerYcbcrConversionComponents
SamplerYcbcrModelConversion
suggestedYcbcrModel
SamplerYcbcrRange
suggestedYcbcrRange
ChromaLocation
suggestedXChromaOffset
ChromaLocation
suggestedYChromaOffset
instance Storable ScreenBufferFormatPropertiesQNX where
sizeOf :: ScreenBufferFormatPropertiesQNX -> Int
sizeOf ~ScreenBufferFormatPropertiesQNX
_ = Int
80
alignment :: ScreenBufferFormatPropertiesQNX -> Int
alignment ~ScreenBufferFormatPropertiesQNX
_ = Int
8
peek :: Ptr ScreenBufferFormatPropertiesQNX
-> IO ScreenBufferFormatPropertiesQNX
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ScreenBufferFormatPropertiesQNX
-> ScreenBufferFormatPropertiesQNX -> IO ()
poke Ptr ScreenBufferFormatPropertiesQNX
ptr ScreenBufferFormatPropertiesQNX
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ScreenBufferFormatPropertiesQNX
ptr ScreenBufferFormatPropertiesQNX
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ScreenBufferFormatPropertiesQNX where
zero :: ScreenBufferFormatPropertiesQNX
zero = Format
-> DeviceSize
-> DeviceSize
-> FormatFeatureFlags
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> ScreenBufferFormatPropertiesQNX
ScreenBufferFormatPropertiesQNX
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ExternalFormatQNX = ExternalFormatQNX
{
ExternalFormatQNX -> DeviceSize
externalFormat :: Word64 }
deriving (Typeable, ExternalFormatQNX -> ExternalFormatQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
$c/= :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
== :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
$c== :: ExternalFormatQNX -> ExternalFormatQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalFormatQNX)
#endif
deriving instance Show ExternalFormatQNX
instance ToCStruct ExternalFormatQNX where
withCStruct :: forall b.
ExternalFormatQNX -> (Ptr ExternalFormatQNX -> IO b) -> IO b
withCStruct ExternalFormatQNX
x Ptr ExternalFormatQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ExternalFormatQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalFormatQNX
p ExternalFormatQNX
x (Ptr ExternalFormatQNX -> IO b
f Ptr ExternalFormatQNX
p)
pokeCStruct :: forall b.
Ptr ExternalFormatQNX -> ExternalFormatQNX -> IO b -> IO b
pokeCStruct Ptr ExternalFormatQNX
p ExternalFormatQNX{DeviceSize
externalFormat :: DeviceSize
$sel:externalFormat:ExternalFormatQNX :: ExternalFormatQNX -> DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (DeviceSize
externalFormat)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ExternalFormatQNX -> IO b -> IO b
pokeZeroCStruct Ptr ExternalFormatQNX
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalFormatQNX where
peekCStruct :: Ptr ExternalFormatQNX -> IO ExternalFormatQNX
peekCStruct Ptr ExternalFormatQNX
p = do
DeviceSize
externalFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ExternalFormatQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceSize -> ExternalFormatQNX
ExternalFormatQNX
DeviceSize
externalFormat
instance Storable ExternalFormatQNX where
sizeOf :: ExternalFormatQNX -> Int
sizeOf ~ExternalFormatQNX
_ = Int
24
alignment :: ExternalFormatQNX -> Int
alignment ~ExternalFormatQNX
_ = Int
8
peek :: Ptr ExternalFormatQNX -> IO ExternalFormatQNX
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExternalFormatQNX -> ExternalFormatQNX -> IO ()
poke Ptr ExternalFormatQNX
ptr ExternalFormatQNX
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalFormatQNX
ptr ExternalFormatQNX
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalFormatQNX where
zero :: ExternalFormatQNX
zero = DeviceSize -> ExternalFormatQNX
ExternalFormatQNX
forall a. Zero a => a
zero
data PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX = PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
{
PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
screenBufferImport :: Bool }
deriving (Typeable, PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
$c/= :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
== :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
$c== :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX)
#endif
deriving instance Show PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
instance ToCStruct PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX where
withCStruct :: forall b.
PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> (Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> IO b)
-> IO b
withCStruct PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
x Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
x (Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> IO b
f Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX{Bool
screenBufferImport :: Bool
$sel:screenBufferImport:PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
screenBufferImport))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX where
peekCStruct :: Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> IO PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
peekCStruct Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p = do
Bool32
screenBufferImport <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
(Bool32 -> Bool
bool32ToBool Bool32
screenBufferImport)
instance Storable PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX where
sizeOf :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Int
sizeOf ~PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
_ = Int
24
alignment :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> Int
alignment ~PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
_ = Int
8
peek :: Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> IO PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
-> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX -> IO ()
poke Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
ptr PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX where
zero :: PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
zero = Bool -> PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
PhysicalDeviceExternalMemoryScreenBufferFeaturesQNX
forall a. Zero a => a
zero
type QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION = 1
pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall a . Integral a => a
pattern $bQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall a. Integral a => a
$mQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION = 1
type QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME = "VK_QNX_external_memory_screen_buffer"
pattern QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mQNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME = "VK_QNX_external_memory_screen_buffer"
data Screen_buffer