{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_custom_resolve ( cmdBeginCustomResolveEXT
, BeginCustomResolveInfoEXT(..)
, PhysicalDeviceCustomResolveFeaturesEXT(..)
, CustomResolveCreateInfoEXT(..)
, EXT_CUSTOM_RESOLVE_SPEC_VERSION
, pattern EXT_CUSTOM_RESOLVE_SPEC_VERSION
, EXT_CUSTOM_RESOLVE_EXTENSION_NAME
, pattern EXT_CUSTOM_RESOLVE_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
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 qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
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.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBeginCustomResolveEXT))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BEGIN_CUSTOM_RESOLVE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CUSTOM_RESOLVE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_RESOLVE_FEATURES_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBeginCustomResolveEXT
:: FunPtr (Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ()) -> Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ()
cmdBeginCustomResolveEXT :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("beginCustomResolveInfo" ::: Maybe BeginCustomResolveInfoEXT)
-> io ()
cmdBeginCustomResolveEXT :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("beginCustomResolveInfo" ::: Maybe BeginCustomResolveInfoEXT)
-> io ()
cmdBeginCustomResolveEXT CommandBuffer
commandBuffer
"beginCustomResolveInfo" ::: Maybe BeginCustomResolveInfoEXT
beginCustomResolveInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdBeginCustomResolveEXTPtr :: FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
vkCmdBeginCustomResolveEXTPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
pVkCmdBeginCustomResolveEXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
vkCmdBeginCustomResolveEXTPtr FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
-> FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdBeginCustomResolveEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBeginCustomResolveEXT' :: Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ()
vkCmdBeginCustomResolveEXT' = FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
-> Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ()
mkVkCmdBeginCustomResolveEXT FunPtr
(Ptr CommandBuffer_T -> Ptr BeginCustomResolveInfoEXT -> IO ())
vkCmdBeginCustomResolveEXTPtr
pBeginCustomResolveInfo <- case ("beginCustomResolveInfo" ::: Maybe BeginCustomResolveInfoEXT
beginCustomResolveInfo) of
"beginCustomResolveInfo" ::: Maybe BeginCustomResolveInfoEXT
Nothing -> Ptr BeginCustomResolveInfoEXT
-> ContT () IO (Ptr BeginCustomResolveInfoEXT)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr BeginCustomResolveInfoEXT
forall a. Ptr a
nullPtr
Just BeginCustomResolveInfoEXT
j -> ((Ptr BeginCustomResolveInfoEXT -> IO ()) -> IO ())
-> ContT () IO (Ptr BeginCustomResolveInfoEXT)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BeginCustomResolveInfoEXT -> IO ()) -> IO ())
-> ContT () IO (Ptr BeginCustomResolveInfoEXT))
-> ((Ptr BeginCustomResolveInfoEXT -> IO ()) -> IO ())
-> ContT () IO (Ptr BeginCustomResolveInfoEXT)
forall a b. (a -> b) -> a -> b
$ BeginCustomResolveInfoEXT
-> (Ptr BeginCustomResolveInfoEXT -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
BeginCustomResolveInfoEXT
-> (Ptr BeginCustomResolveInfoEXT -> IO b) -> IO b
withCStruct (BeginCustomResolveInfoEXT
j)
lift $ traceAroundEvent "vkCmdBeginCustomResolveEXT" (vkCmdBeginCustomResolveEXT'
(commandBufferHandle (commandBuffer))
pBeginCustomResolveInfo)
pure $ ()
data BeginCustomResolveInfoEXT = BeginCustomResolveInfoEXT
{}
deriving (Typeable, BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool
(BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool)
-> (BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool)
-> Eq BeginCustomResolveInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool
== :: BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool
$c/= :: BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool
/= :: BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BeginCustomResolveInfoEXT)
#endif
deriving instance Show BeginCustomResolveInfoEXT
instance ToCStruct BeginCustomResolveInfoEXT where
withCStruct :: forall b.
BeginCustomResolveInfoEXT
-> (Ptr BeginCustomResolveInfoEXT -> IO b) -> IO b
withCStruct BeginCustomResolveInfoEXT
x Ptr BeginCustomResolveInfoEXT -> IO b
f = Int -> (Ptr BeginCustomResolveInfoEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr BeginCustomResolveInfoEXT -> IO b) -> IO b)
-> (Ptr BeginCustomResolveInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr BeginCustomResolveInfoEXT
p -> Ptr BeginCustomResolveInfoEXT
-> BeginCustomResolveInfoEXT -> IO b -> IO b
forall b.
Ptr BeginCustomResolveInfoEXT
-> BeginCustomResolveInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BeginCustomResolveInfoEXT
p BeginCustomResolveInfoEXT
x (Ptr BeginCustomResolveInfoEXT -> IO b
f Ptr BeginCustomResolveInfoEXT
p)
pokeCStruct :: forall b.
Ptr BeginCustomResolveInfoEXT
-> BeginCustomResolveInfoEXT -> IO b -> IO b
pokeCStruct Ptr BeginCustomResolveInfoEXT
p BeginCustomResolveInfoEXT
BeginCustomResolveInfoEXT IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BeginCustomResolveInfoEXT
p Ptr BeginCustomResolveInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BEGIN_CUSTOM_RESOLVE_INFO_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BeginCustomResolveInfoEXT
p Ptr BeginCustomResolveInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr BeginCustomResolveInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr BeginCustomResolveInfoEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BeginCustomResolveInfoEXT
p Ptr BeginCustomResolveInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BEGIN_CUSTOM_RESOLVE_INFO_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BeginCustomResolveInfoEXT
p Ptr BeginCustomResolveInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct BeginCustomResolveInfoEXT where
peekCStruct :: Ptr BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT
peekCStruct Ptr BeginCustomResolveInfoEXT
_ = BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT)
-> BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT
forall a b. (a -> b) -> a -> b
$ BeginCustomResolveInfoEXT
BeginCustomResolveInfoEXT
instance Storable BeginCustomResolveInfoEXT where
sizeOf :: BeginCustomResolveInfoEXT -> Int
sizeOf ~BeginCustomResolveInfoEXT
_ = Int
16
alignment :: BeginCustomResolveInfoEXT -> Int
alignment ~BeginCustomResolveInfoEXT
_ = Int
8
peek :: Ptr BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT
peek = Ptr BeginCustomResolveInfoEXT -> IO BeginCustomResolveInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BeginCustomResolveInfoEXT -> BeginCustomResolveInfoEXT -> IO ()
poke Ptr BeginCustomResolveInfoEXT
ptr BeginCustomResolveInfoEXT
poked = Ptr BeginCustomResolveInfoEXT
-> BeginCustomResolveInfoEXT -> IO () -> IO ()
forall b.
Ptr BeginCustomResolveInfoEXT
-> BeginCustomResolveInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BeginCustomResolveInfoEXT
ptr BeginCustomResolveInfoEXT
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BeginCustomResolveInfoEXT where
zero :: BeginCustomResolveInfoEXT
zero = BeginCustomResolveInfoEXT
BeginCustomResolveInfoEXT
data PhysicalDeviceCustomResolveFeaturesEXT = PhysicalDeviceCustomResolveFeaturesEXT
{
PhysicalDeviceCustomResolveFeaturesEXT -> Bool
customResolve :: Bool }
deriving (Typeable, PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool
(PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool)
-> (PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool)
-> Eq PhysicalDeviceCustomResolveFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool
== :: PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool
$c/= :: PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool
/= :: PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceCustomResolveFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceCustomResolveFeaturesEXT
instance ToCStruct PhysicalDeviceCustomResolveFeaturesEXT where
withCStruct :: forall b.
PhysicalDeviceCustomResolveFeaturesEXT
-> (Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b) -> IO b
withCStruct PhysicalDeviceCustomResolveFeaturesEXT
x Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b
f = Int -> (Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceCustomResolveFeaturesEXT
p -> Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO b -> IO b
forall b.
Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceCustomResolveFeaturesEXT
p PhysicalDeviceCustomResolveFeaturesEXT
x (Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b
f Ptr PhysicalDeviceCustomResolveFeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceCustomResolveFeaturesEXT
p PhysicalDeviceCustomResolveFeaturesEXT{Bool
customResolve :: PhysicalDeviceCustomResolveFeaturesEXT -> Bool
customResolve :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_RESOLVE_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
customResolve))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceCustomResolveFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceCustomResolveFeaturesEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_RESOLVE_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceCustomResolveFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> IO PhysicalDeviceCustomResolveFeaturesEXT
peekCStruct Ptr PhysicalDeviceCustomResolveFeaturesEXT
p = do
customResolve <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceCustomResolveFeaturesEXT
p Ptr PhysicalDeviceCustomResolveFeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
pure $ PhysicalDeviceCustomResolveFeaturesEXT
(bool32ToBool customResolve)
instance Storable PhysicalDeviceCustomResolveFeaturesEXT where
sizeOf :: PhysicalDeviceCustomResolveFeaturesEXT -> Int
sizeOf ~PhysicalDeviceCustomResolveFeaturesEXT
_ = Int
24
alignment :: PhysicalDeviceCustomResolveFeaturesEXT -> Int
alignment ~PhysicalDeviceCustomResolveFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> IO PhysicalDeviceCustomResolveFeaturesEXT
peek = Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> IO PhysicalDeviceCustomResolveFeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO ()
poke Ptr PhysicalDeviceCustomResolveFeaturesEXT
ptr PhysicalDeviceCustomResolveFeaturesEXT
poked = Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceCustomResolveFeaturesEXT
-> PhysicalDeviceCustomResolveFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceCustomResolveFeaturesEXT
ptr PhysicalDeviceCustomResolveFeaturesEXT
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceCustomResolveFeaturesEXT where
zero :: PhysicalDeviceCustomResolveFeaturesEXT
zero = Bool -> PhysicalDeviceCustomResolveFeaturesEXT
PhysicalDeviceCustomResolveFeaturesEXT
Bool
forall a. Zero a => a
zero
data CustomResolveCreateInfoEXT = CustomResolveCreateInfoEXT
{
CustomResolveCreateInfoEXT -> Bool
customResolve :: Bool
,
CustomResolveCreateInfoEXT -> Vector Format
colorAttachmentFormats :: Vector Format
,
CustomResolveCreateInfoEXT -> Format
depthAttachmentFormat :: Format
,
CustomResolveCreateInfoEXT -> Format
stencilAttachmentFormat :: Format
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CustomResolveCreateInfoEXT)
#endif
deriving instance Show CustomResolveCreateInfoEXT
instance ToCStruct CustomResolveCreateInfoEXT where
withCStruct :: forall b.
CustomResolveCreateInfoEXT
-> (Ptr CustomResolveCreateInfoEXT -> IO b) -> IO b
withCStruct CustomResolveCreateInfoEXT
x Ptr CustomResolveCreateInfoEXT -> IO b
f = Int -> (Ptr CustomResolveCreateInfoEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr CustomResolveCreateInfoEXT -> IO b) -> IO b)
-> (Ptr CustomResolveCreateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CustomResolveCreateInfoEXT
p -> Ptr CustomResolveCreateInfoEXT
-> CustomResolveCreateInfoEXT -> IO b -> IO b
forall b.
Ptr CustomResolveCreateInfoEXT
-> CustomResolveCreateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CustomResolveCreateInfoEXT
p CustomResolveCreateInfoEXT
x (Ptr CustomResolveCreateInfoEXT -> IO b
f Ptr CustomResolveCreateInfoEXT
p)
pokeCStruct :: forall b.
Ptr CustomResolveCreateInfoEXT
-> CustomResolveCreateInfoEXT -> IO b -> IO b
pokeCStruct Ptr CustomResolveCreateInfoEXT
p CustomResolveCreateInfoEXT{Bool
Vector Format
Format
customResolve :: CustomResolveCreateInfoEXT -> Bool
colorAttachmentFormats :: CustomResolveCreateInfoEXT -> Vector Format
depthAttachmentFormat :: CustomResolveCreateInfoEXT -> Format
stencilAttachmentFormat :: CustomResolveCreateInfoEXT -> Format
customResolve :: Bool
colorAttachmentFormats :: Vector Format
depthAttachmentFormat :: Format
stencilAttachmentFormat :: Format
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CUSTOM_RESOLVE_CREATE_INFO_EXT)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
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 ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
customResolve))
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format -> Int) -> Vector Format -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Format
colorAttachmentFormats)) :: Word32))
pPColorAttachmentFormats' <- ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format))
-> ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Format ((Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format
colorAttachmentFormats)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
lift $ Data.Vector.imapM_ (\Int
i Format
e -> Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Format
pPColorAttachmentFormats' Ptr Format -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format) (Format
e)) (colorAttachmentFormats)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Format))) (pPColorAttachmentFormats')
lift $ poke ((p `plusPtr` 32 :: Ptr Format)) (depthAttachmentFormat)
lift $ poke ((p `plusPtr` 36 :: Ptr Format)) (stencilAttachmentFormat)
lift $ f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CustomResolveCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr CustomResolveCreateInfoEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CUSTOM_RESOLVE_CREATE_INFO_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CustomResolveCreateInfoEXT where
peekCStruct :: Ptr CustomResolveCreateInfoEXT -> IO CustomResolveCreateInfoEXT
peekCStruct Ptr CustomResolveCreateInfoEXT
p = do
customResolve <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr CustomResolveCreateInfoEXT
p Ptr CustomResolveCreateInfoEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
colorAttachmentCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
pColorAttachmentFormats <- peek @(Ptr Format) ((p `plusPtr` 24 :: Ptr (Ptr Format)))
pColorAttachmentFormats' <- generateM (fromIntegral colorAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr Format
pColorAttachmentFormats Ptr Format -> Int -> Ptr Format
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format)))
depthAttachmentFormat <- peek @Format ((p `plusPtr` 32 :: Ptr Format))
stencilAttachmentFormat <- peek @Format ((p `plusPtr` 36 :: Ptr Format))
pure $ CustomResolveCreateInfoEXT
(bool32ToBool customResolve)
pColorAttachmentFormats'
depthAttachmentFormat
stencilAttachmentFormat
instance Zero CustomResolveCreateInfoEXT where
zero :: CustomResolveCreateInfoEXT
zero = Bool
-> Vector Format -> Format -> Format -> CustomResolveCreateInfoEXT
CustomResolveCreateInfoEXT
Bool
forall a. Zero a => a
zero
Vector Format
forall a. Monoid a => a
mempty
Format
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
type EXT_CUSTOM_RESOLVE_SPEC_VERSION = 1
pattern EXT_CUSTOM_RESOLVE_SPEC_VERSION :: forall a . Integral a => a
pattern $mEXT_CUSTOM_RESOLVE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_CUSTOM_RESOLVE_SPEC_VERSION :: forall a. Integral a => a
EXT_CUSTOM_RESOLVE_SPEC_VERSION = 1
type EXT_CUSTOM_RESOLVE_EXTENSION_NAME = "VK_EXT_custom_resolve"
pattern EXT_CUSTOM_RESOLVE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mEXT_CUSTOM_RESOLVE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_CUSTOM_RESOLVE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
EXT_CUSTOM_RESOLVE_EXTENSION_NAME = "VK_EXT_custom_resolve"