{-# language CPP #-}
module Vulkan.Core10.ImageView ( createImageView
, withImageView
, destroyImageView
, ComponentMapping(..)
, ImageSubresourceRange(..)
, ImageViewCreateInfo(..)
, ImageView(..)
, ImageViewType(..)
, ComponentSwizzle(..)
, ImageViewCreateFlagBits(..)
, ImageViewCreateFlags
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (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.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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Enums.ComponentSwizzle (ComponentSwizzle)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCreateImageView))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyImageView))
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.Handles (Image)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Handles (ImageView)
import Vulkan.Core10.Handles (ImageView(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_astc_decode_mode (ImageViewASTCDecodeModeEXT)
import Vulkan.Core10.Enums.ImageViewCreateFlagBits (ImageViewCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_image_view_min_lod (ImageViewMinLodCreateInfoEXT)
import Vulkan.Core10.Enums.ImageViewType (ImageViewType)
import {-# SOURCE #-} Vulkan.Core11.Promoted_From_VK_KHR_maintenance2 (ImageViewUsageCreateInfo)
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 {-# SOURCE #-} Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion (SamplerYcbcrConversionInfo)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.Enums.ComponentSwizzle (ComponentSwizzle(..))
import Vulkan.Core10.Handles (ImageView(..))
import Vulkan.Core10.Enums.ImageViewCreateFlagBits (ImageViewCreateFlagBits(..))
import Vulkan.Core10.Enums.ImageViewCreateFlagBits (ImageViewCreateFlags)
import Vulkan.Core10.Enums.ImageViewType (ImageViewType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateImageView
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct ImageViewCreateInfo) -> Ptr AllocationCallbacks -> Ptr ImageView -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct ImageViewCreateInfo) -> Ptr AllocationCallbacks -> Ptr ImageView -> IO Result
createImageView :: forall a io
. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io)
=>
Device
->
(ImageViewCreateInfo a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (ImageView)
createImageView :: Device
-> ImageViewCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ImageView
createImageView Device
device ImageViewCreateInfo a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO ImageView -> io ImageView
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ImageView -> io ImageView)
-> (ContT ImageView IO ImageView -> IO ImageView)
-> ContT ImageView IO ImageView
-> io ImageView
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ImageView IO ImageView -> IO ImageView
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ImageView IO ImageView -> io ImageView)
-> ContT ImageView IO ImageView -> io ImageView
forall a b. (a -> b) -> a -> b
$ do
let vkCreateImageViewPtr :: FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
vkCreateImageViewPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
pVkCreateImageView (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT ImageView IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ImageView IO ()) -> IO () -> ContT ImageView IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
vkCreateImageViewPtr FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> 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 String
"" String
"The function pointer for vkCreateImageView is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateImageView' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result
vkCreateImageView' = FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result
mkVkCreateImageView FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result)
vkCreateImageViewPtr
Ptr (ImageViewCreateInfo a)
pCreateInfo <- ((Ptr (ImageViewCreateInfo a) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO (Ptr (ImageViewCreateInfo a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (ImageViewCreateInfo a) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO (Ptr (ImageViewCreateInfo a)))
-> ((Ptr (ImageViewCreateInfo a) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO (Ptr (ImageViewCreateInfo a))
forall a b. (a -> b) -> a -> b
$ ImageViewCreateInfo a
-> (Ptr (ImageViewCreateInfo a) -> IO ImageView) -> IO ImageView
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageViewCreateInfo a
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT ImageView IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ImageView)
-> IO ImageView)
-> ContT ImageView IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ImageView)
-> IO ImageView)
-> ContT ImageView IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ImageView)
-> IO ImageView)
-> ContT ImageView IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ImageView)
-> IO ImageView
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pView" ::: Ptr ImageView
pPView <- ((("pView" ::: Ptr ImageView) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO ("pView" ::: Ptr ImageView)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pView" ::: Ptr ImageView) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO ("pView" ::: Ptr ImageView))
-> ((("pView" ::: Ptr ImageView) -> IO ImageView) -> IO ImageView)
-> ContT ImageView IO ("pView" ::: Ptr ImageView)
forall a b. (a -> b) -> a -> b
$ IO ("pView" ::: Ptr ImageView)
-> (("pView" ::: Ptr ImageView) -> IO ())
-> (("pView" ::: Ptr ImageView) -> IO ImageView)
-> IO ImageView
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pView" ::: Ptr ImageView)
forall a. Int -> IO (Ptr a)
callocBytes @ImageView Int
8) ("pView" ::: Ptr ImageView) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT ImageView IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ImageView IO Result)
-> IO Result -> ContT ImageView IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateImageView" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pView" ::: Ptr ImageView)
-> IO Result
vkCreateImageView' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Ptr (ImageViewCreateInfo a)
-> "pCreateInfo" ::: Ptr (SomeStruct ImageViewCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (ImageViewCreateInfo a)
pCreateInfo) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pView" ::: Ptr ImageView
pPView))
IO () -> ContT ImageView IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ImageView IO ()) -> IO () -> ContT ImageView 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))
ImageView
pView <- IO ImageView -> ContT ImageView IO ImageView
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ImageView -> ContT ImageView IO ImageView)
-> IO ImageView -> ContT ImageView IO ImageView
forall a b. (a -> b) -> a -> b
$ ("pView" ::: Ptr ImageView) -> IO ImageView
forall a. Storable a => Ptr a -> IO a
peek @ImageView "pView" ::: Ptr ImageView
pPView
ImageView -> ContT ImageView IO ImageView
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageView -> ContT ImageView IO ImageView)
-> ImageView -> ContT ImageView IO ImageView
forall a b. (a -> b) -> a -> b
$ (ImageView
pView)
withImageView :: forall a io r . (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageViewCreateInfo a -> Maybe AllocationCallbacks -> (io ImageView -> (ImageView -> io ()) -> r) -> r
withImageView :: Device
-> ImageViewCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io ImageView -> (ImageView -> io ()) -> r)
-> r
withImageView Device
device ImageViewCreateInfo a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io ImageView -> (ImageView -> io ()) -> r
b =
io ImageView -> (ImageView -> io ()) -> r
b (Device
-> ImageViewCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ImageView
forall (a :: [*]) (io :: * -> *).
(Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) =>
Device
-> ImageViewCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ImageView
createImageView Device
device ImageViewCreateInfo a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(ImageView
o0) -> Device
-> ImageView
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> ImageView
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyImageView Device
device ImageView
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyImageView
:: FunPtr (Ptr Device_T -> ImageView -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> ImageView -> Ptr AllocationCallbacks -> IO ()
destroyImageView :: forall io
. (MonadIO io)
=>
Device
->
ImageView
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyImageView :: Device
-> ImageView
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyImageView Device
device ImageView
imageView "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
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 vkDestroyImageViewPtr :: FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyImageViewPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
pVkDestroyImageView (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
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 Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyImageViewPtr FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
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 String
"" String
"The function pointer for vkDestroyImageView is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyImageView' :: Ptr Device_T
-> ImageView -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
vkDestroyImageView' = FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyImageView FunPtr
(Ptr Device_T
-> ImageView
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyImageViewPtr
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
IO () -> ContT () IO ()
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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroyImageView" (Ptr Device_T
-> ImageView -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
vkDestroyImageView' (Device -> Ptr Device_T
deviceHandle (Device
device)) (ImageView
imageView) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
data ComponentMapping = ComponentMapping
{
ComponentMapping -> ComponentSwizzle
r :: ComponentSwizzle
,
ComponentMapping -> ComponentSwizzle
g :: ComponentSwizzle
,
ComponentMapping -> ComponentSwizzle
b :: ComponentSwizzle
,
ComponentMapping -> ComponentSwizzle
a :: ComponentSwizzle
}
deriving (Typeable, ComponentMapping -> ComponentMapping -> Bool
(ComponentMapping -> ComponentMapping -> Bool)
-> (ComponentMapping -> ComponentMapping -> Bool)
-> Eq ComponentMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentMapping -> ComponentMapping -> Bool
$c/= :: ComponentMapping -> ComponentMapping -> Bool
== :: ComponentMapping -> ComponentMapping -> Bool
$c== :: ComponentMapping -> ComponentMapping -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ComponentMapping)
#endif
deriving instance Show ComponentMapping
instance ToCStruct ComponentMapping where
withCStruct :: ComponentMapping -> (Ptr ComponentMapping -> IO b) -> IO b
withCStruct ComponentMapping
x Ptr ComponentMapping -> IO b
f = Int -> (Ptr ComponentMapping -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr ComponentMapping -> IO b) -> IO b)
-> (Ptr ComponentMapping -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ComponentMapping
p -> Ptr ComponentMapping -> ComponentMapping -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ComponentMapping
p ComponentMapping
x (Ptr ComponentMapping -> IO b
f Ptr ComponentMapping
p)
pokeCStruct :: Ptr ComponentMapping -> ComponentMapping -> IO b -> IO b
pokeCStruct Ptr ComponentMapping
p ComponentMapping{ComponentSwizzle
a :: ComponentSwizzle
b :: ComponentSwizzle
g :: ComponentSwizzle
r :: ComponentSwizzle
$sel:a:ComponentMapping :: ComponentMapping -> ComponentSwizzle
$sel:b:ComponentMapping :: ComponentMapping -> ComponentSwizzle
$sel:g:ComponentMapping :: ComponentMapping -> ComponentSwizzle
$sel:r:ComponentMapping :: ComponentMapping -> ComponentSwizzle
..} IO b
f = do
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ComponentSwizzle)) (ComponentSwizzle
r)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr ComponentSwizzle)) (ComponentSwizzle
g)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr ComponentSwizzle)) (ComponentSwizzle
b)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr ComponentSwizzle)) (ComponentSwizzle
a)
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr ComponentMapping -> IO b -> IO b
pokeZeroCStruct Ptr ComponentMapping
p IO b
f = do
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ComponentSwizzle)) (ComponentSwizzle
forall a. Zero a => a
zero)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr ComponentSwizzle)) (ComponentSwizzle
forall a. Zero a => a
zero)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr ComponentSwizzle)) (ComponentSwizzle
forall a. Zero a => a
zero)
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr ComponentSwizzle)) (ComponentSwizzle
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ComponentMapping where
peekCStruct :: Ptr ComponentMapping -> IO ComponentMapping
peekCStruct Ptr ComponentMapping
p = do
ComponentSwizzle
r <- Ptr ComponentSwizzle -> IO ComponentSwizzle
forall a. Storable a => Ptr a -> IO a
peek @ComponentSwizzle ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ComponentSwizzle))
ComponentSwizzle
g <- Ptr ComponentSwizzle -> IO ComponentSwizzle
forall a. Storable a => Ptr a -> IO a
peek @ComponentSwizzle ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr ComponentSwizzle))
ComponentSwizzle
b <- Ptr ComponentSwizzle -> IO ComponentSwizzle
forall a. Storable a => Ptr a -> IO a
peek @ComponentSwizzle ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr ComponentSwizzle))
ComponentSwizzle
a <- Ptr ComponentSwizzle -> IO ComponentSwizzle
forall a. Storable a => Ptr a -> IO a
peek @ComponentSwizzle ((Ptr ComponentMapping
p Ptr ComponentMapping -> Int -> Ptr ComponentSwizzle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr ComponentSwizzle))
ComponentMapping -> IO ComponentMapping
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ComponentMapping -> IO ComponentMapping)
-> ComponentMapping -> IO ComponentMapping
forall a b. (a -> b) -> a -> b
$ ComponentSwizzle
-> ComponentSwizzle
-> ComponentSwizzle
-> ComponentSwizzle
-> ComponentMapping
ComponentMapping
ComponentSwizzle
r ComponentSwizzle
g ComponentSwizzle
b ComponentSwizzle
a
instance Storable ComponentMapping where
sizeOf :: ComponentMapping -> Int
sizeOf ~ComponentMapping
_ = Int
16
alignment :: ComponentMapping -> Int
alignment ~ComponentMapping
_ = Int
4
peek :: Ptr ComponentMapping -> IO ComponentMapping
peek = Ptr ComponentMapping -> IO ComponentMapping
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ComponentMapping -> ComponentMapping -> IO ()
poke Ptr ComponentMapping
ptr ComponentMapping
poked = Ptr ComponentMapping -> ComponentMapping -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ComponentMapping
ptr ComponentMapping
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ComponentMapping where
zero :: ComponentMapping
zero = ComponentSwizzle
-> ComponentSwizzle
-> ComponentSwizzle
-> ComponentSwizzle
-> ComponentMapping
ComponentMapping
ComponentSwizzle
forall a. Zero a => a
zero
ComponentSwizzle
forall a. Zero a => a
zero
ComponentSwizzle
forall a. Zero a => a
zero
ComponentSwizzle
forall a. Zero a => a
zero
data ImageSubresourceRange = ImageSubresourceRange
{
ImageSubresourceRange -> ImageAspectFlags
aspectMask :: ImageAspectFlags
,
ImageSubresourceRange -> Word32
baseMipLevel :: Word32
,
ImageSubresourceRange -> Word32
levelCount :: Word32
,
ImageSubresourceRange -> Word32
baseArrayLayer :: Word32
,
ImageSubresourceRange -> Word32
layerCount :: Word32
}
deriving (Typeable, ImageSubresourceRange -> ImageSubresourceRange -> Bool
(ImageSubresourceRange -> ImageSubresourceRange -> Bool)
-> (ImageSubresourceRange -> ImageSubresourceRange -> Bool)
-> Eq ImageSubresourceRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageSubresourceRange -> ImageSubresourceRange -> Bool
$c/= :: ImageSubresourceRange -> ImageSubresourceRange -> Bool
== :: ImageSubresourceRange -> ImageSubresourceRange -> Bool
$c== :: ImageSubresourceRange -> ImageSubresourceRange -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageSubresourceRange)
#endif
deriving instance Show ImageSubresourceRange
instance ToCStruct ImageSubresourceRange where
withCStruct :: ImageSubresourceRange
-> (Ptr ImageSubresourceRange -> IO b) -> IO b
withCStruct ImageSubresourceRange
x Ptr ImageSubresourceRange -> IO b
f = Int -> (Ptr ImageSubresourceRange -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
20 ((Ptr ImageSubresourceRange -> IO b) -> IO b)
-> (Ptr ImageSubresourceRange -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ImageSubresourceRange
p -> Ptr ImageSubresourceRange -> ImageSubresourceRange -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageSubresourceRange
p ImageSubresourceRange
x (Ptr ImageSubresourceRange -> IO b
f Ptr ImageSubresourceRange
p)
pokeCStruct :: Ptr ImageSubresourceRange -> ImageSubresourceRange -> IO b -> IO b
pokeCStruct Ptr ImageSubresourceRange
p ImageSubresourceRange{Word32
ImageAspectFlags
layerCount :: Word32
baseArrayLayer :: Word32
levelCount :: Word32
baseMipLevel :: Word32
aspectMask :: ImageAspectFlags
$sel:layerCount:ImageSubresourceRange :: ImageSubresourceRange -> Word32
$sel:baseArrayLayer:ImageSubresourceRange :: ImageSubresourceRange -> Word32
$sel:levelCount:ImageSubresourceRange :: ImageSubresourceRange -> Word32
$sel:baseMipLevel:ImageSubresourceRange :: ImageSubresourceRange -> Word32
$sel:aspectMask:ImageSubresourceRange :: ImageSubresourceRange -> ImageAspectFlags
..} IO b
f = do
Ptr ImageAspectFlags -> ImageAspectFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr ImageAspectFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ImageAspectFlags)) (ImageAspectFlags
aspectMask)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Word32
baseMipLevel)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32)) (Word32
levelCount)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
baseArrayLayer)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
layerCount)
IO b
f
cStructSize :: Int
cStructSize = Int
20
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr ImageSubresourceRange -> IO b -> IO b
pokeZeroCStruct Ptr ImageSubresourceRange
p IO b
f = do
Ptr ImageAspectFlags -> ImageAspectFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr ImageAspectFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ImageAspectFlags)) (ImageAspectFlags
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageSubresourceRange where
peekCStruct :: Ptr ImageSubresourceRange -> IO ImageSubresourceRange
peekCStruct Ptr ImageSubresourceRange
p = do
ImageAspectFlags
aspectMask <- Ptr ImageAspectFlags -> IO ImageAspectFlags
forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlags ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr ImageAspectFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr ImageAspectFlags))
Word32
baseMipLevel <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
Word32
levelCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32))
Word32
baseArrayLayer <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32))
Word32
layerCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImageSubresourceRange
p Ptr ImageSubresourceRange -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
ImageSubresourceRange -> IO ImageSubresourceRange
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageSubresourceRange -> IO ImageSubresourceRange)
-> ImageSubresourceRange -> IO ImageSubresourceRange
forall a b. (a -> b) -> a -> b
$ ImageAspectFlags
-> Word32 -> Word32 -> Word32 -> Word32 -> ImageSubresourceRange
ImageSubresourceRange
ImageAspectFlags
aspectMask Word32
baseMipLevel Word32
levelCount Word32
baseArrayLayer Word32
layerCount
instance Storable ImageSubresourceRange where
sizeOf :: ImageSubresourceRange -> Int
sizeOf ~ImageSubresourceRange
_ = Int
20
alignment :: ImageSubresourceRange -> Int
alignment ~ImageSubresourceRange
_ = Int
4
peek :: Ptr ImageSubresourceRange -> IO ImageSubresourceRange
peek = Ptr ImageSubresourceRange -> IO ImageSubresourceRange
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageSubresourceRange -> ImageSubresourceRange -> IO ()
poke Ptr ImageSubresourceRange
ptr ImageSubresourceRange
poked = Ptr ImageSubresourceRange
-> ImageSubresourceRange -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageSubresourceRange
ptr ImageSubresourceRange
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageSubresourceRange where
zero :: ImageSubresourceRange
zero = ImageAspectFlags
-> Word32 -> Word32 -> Word32 -> Word32 -> ImageSubresourceRange
ImageSubresourceRange
ImageAspectFlags
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
data ImageViewCreateInfo (es :: [Type]) = ImageViewCreateInfo
{
ImageViewCreateInfo es -> Chain es
next :: Chain es
,
ImageViewCreateInfo es -> ImageViewCreateFlags
flags :: ImageViewCreateFlags
,
ImageViewCreateInfo es -> Image
image :: Image
,
ImageViewCreateInfo es -> ImageViewType
viewType :: ImageViewType
,
ImageViewCreateInfo es -> Format
format :: Format
,
ImageViewCreateInfo es -> ComponentMapping
components :: ComponentMapping
,
ImageViewCreateInfo es -> ImageSubresourceRange
subresourceRange :: ImageSubresourceRange
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageViewCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ImageViewCreateInfo es)
instance Extensible ImageViewCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"ImageViewCreateInfo"
setNext :: ImageViewCreateInfo ds -> Chain es -> ImageViewCreateInfo es
setNext ImageViewCreateInfo{Chain ds
Format
Image
ImageSubresourceRange
ComponentMapping
ImageViewType
ImageViewCreateFlags
subresourceRange :: ImageSubresourceRange
components :: ComponentMapping
format :: Format
viewType :: ImageViewType
image :: Image
flags :: ImageViewCreateFlags
next :: Chain ds
$sel:subresourceRange:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageSubresourceRange
$sel:components:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ComponentMapping
$sel:format:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Format
$sel:viewType:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewType
$sel:image:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Image
$sel:flags:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewCreateFlags
$sel:next:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Chain es
..} Chain es
next' = ImageViewCreateInfo :: forall (es :: [*]).
Chain es
-> ImageViewCreateFlags
-> Image
-> ImageViewType
-> Format
-> ComponentMapping
-> ImageSubresourceRange
-> ImageViewCreateInfo es
ImageViewCreateInfo{$sel:next:ImageViewCreateInfo :: Chain es
next = Chain es
next', Format
Image
ImageSubresourceRange
ComponentMapping
ImageViewType
ImageViewCreateFlags
subresourceRange :: ImageSubresourceRange
components :: ComponentMapping
format :: Format
viewType :: ImageViewType
image :: Image
flags :: ImageViewCreateFlags
$sel:subresourceRange:ImageViewCreateInfo :: ImageSubresourceRange
$sel:components:ImageViewCreateInfo :: ComponentMapping
$sel:format:ImageViewCreateInfo :: Format
$sel:viewType:ImageViewCreateInfo :: ImageViewType
$sel:image:ImageViewCreateInfo :: Image
$sel:flags:ImageViewCreateInfo :: ImageViewCreateFlags
..}
getNext :: ImageViewCreateInfo es -> Chain es
getNext ImageViewCreateInfo{Chain es
Format
Image
ImageSubresourceRange
ComponentMapping
ImageViewType
ImageViewCreateFlags
subresourceRange :: ImageSubresourceRange
components :: ComponentMapping
format :: Format
viewType :: ImageViewType
image :: Image
flags :: ImageViewCreateFlags
next :: Chain es
$sel:subresourceRange:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageSubresourceRange
$sel:components:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ComponentMapping
$sel:format:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Format
$sel:viewType:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewType
$sel:image:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Image
$sel:flags:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewCreateFlags
$sel:next:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends ImageViewCreateInfo e => b) -> Maybe b
extends :: proxy e -> (Extends ImageViewCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends ImageViewCreateInfo e => b
f
| Just e :~: ImageViewMinLodCreateInfoEXT
Refl <- (Typeable e, Typeable ImageViewMinLodCreateInfoEXT) =>
Maybe (e :~: ImageViewMinLodCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ImageViewMinLodCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ImageViewCreateInfo e => b
f
| Just e :~: ImageViewASTCDecodeModeEXT
Refl <- (Typeable e, Typeable ImageViewASTCDecodeModeEXT) =>
Maybe (e :~: ImageViewASTCDecodeModeEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ImageViewASTCDecodeModeEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ImageViewCreateInfo e => b
f
| Just e :~: SamplerYcbcrConversionInfo
Refl <- (Typeable e, Typeable SamplerYcbcrConversionInfo) =>
Maybe (e :~: SamplerYcbcrConversionInfo)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SamplerYcbcrConversionInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ImageViewCreateInfo e => b
f
| Just e :~: ImageViewUsageCreateInfo
Refl <- (Typeable e, Typeable ImageViewUsageCreateInfo) =>
Maybe (e :~: ImageViewUsageCreateInfo)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ImageViewUsageCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ImageViewCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss ImageViewCreateInfo es, PokeChain es) => ToCStruct (ImageViewCreateInfo es) where
withCStruct :: ImageViewCreateInfo es
-> (Ptr (ImageViewCreateInfo es) -> IO b) -> IO b
withCStruct ImageViewCreateInfo es
x Ptr (ImageViewCreateInfo es) -> IO b
f = Int -> (Ptr (ImageViewCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 ((Ptr (ImageViewCreateInfo es) -> IO b) -> IO b)
-> (Ptr (ImageViewCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (ImageViewCreateInfo es)
p -> Ptr (ImageViewCreateInfo es)
-> ImageViewCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ImageViewCreateInfo es)
p ImageViewCreateInfo es
x (Ptr (ImageViewCreateInfo es) -> IO b
f Ptr (ImageViewCreateInfo es)
p)
pokeCStruct :: Ptr (ImageViewCreateInfo es)
-> ImageViewCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (ImageViewCreateInfo es)
p ImageViewCreateInfo{Chain es
Format
Image
ImageSubresourceRange
ComponentMapping
ImageViewType
ImageViewCreateFlags
subresourceRange :: ImageSubresourceRange
components :: ComponentMapping
format :: Format
viewType :: ImageViewType
image :: Image
flags :: ImageViewCreateFlags
next :: Chain es
$sel:subresourceRange:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageSubresourceRange
$sel:components:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ComponentMapping
$sel:format:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Format
$sel:viewType:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewType
$sel:image:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Image
$sel:flags:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> ImageViewCreateFlags
$sel:next:ImageViewCreateInfo :: forall (es :: [*]). ImageViewCreateInfo es -> Chain es
..} 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 ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
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 ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
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 ImageViewCreateFlags -> ImageViewCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageViewCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageViewCreateFlags)) (ImageViewCreateFlags
flags)
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image)) (Image
image)
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 ImageViewType -> ImageViewType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageViewType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageViewType)) (ImageViewType
viewType)
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 Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
format)
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 ComponentMapping -> ComponentMapping -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ComponentMapping)) (ComponentMapping
components)
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 ImageSubresourceRange -> ImageSubresourceRange -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageSubresourceRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceRange)) (ImageSubresourceRange
subresourceRange)
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 = Int
80
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (ImageViewCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (ImageViewCreateInfo es)
p 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 ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
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 ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
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 ImageViewType -> ImageViewType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageViewType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageViewType)) (ImageViewType
forall a. Zero a => a
zero)
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 Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
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 ComponentMapping -> ComponentMapping -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ComponentMapping)) (ComponentMapping
forall a. Zero a => a
zero)
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 ImageSubresourceRange -> ImageSubresourceRange -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageSubresourceRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceRange)) (ImageSubresourceRange
forall a. Zero a => a
zero)
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 (Extendss ImageViewCreateInfo es, PeekChain es) => FromCStruct (ImageViewCreateInfo es) where
peekCStruct :: Ptr (ImageViewCreateInfo es) -> IO (ImageViewCreateInfo es)
peekCStruct Ptr (ImageViewCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
ImageViewCreateFlags
flags <- Ptr ImageViewCreateFlags -> IO ImageViewCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @ImageViewCreateFlags ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageViewCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageViewCreateFlags))
Image
image <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image))
ImageViewType
viewType <- Ptr ImageViewType -> IO ImageViewType
forall a. Storable a => Ptr a -> IO a
peek @ImageViewType ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageViewType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageViewType))
Format
format <- Ptr Format -> IO Format
forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format))
ComponentMapping
components <- Ptr ComponentMapping -> IO ComponentMapping
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ComponentMapping))
ImageSubresourceRange
subresourceRange <- Ptr ImageSubresourceRange -> IO ImageSubresourceRange
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceRange ((Ptr (ImageViewCreateInfo es)
p Ptr (ImageViewCreateInfo es) -> Int -> Ptr ImageSubresourceRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceRange))
ImageViewCreateInfo es -> IO (ImageViewCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageViewCreateInfo es -> IO (ImageViewCreateInfo es))
-> ImageViewCreateInfo es -> IO (ImageViewCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ImageViewCreateFlags
-> Image
-> ImageViewType
-> Format
-> ComponentMapping
-> ImageSubresourceRange
-> ImageViewCreateInfo es
forall (es :: [*]).
Chain es
-> ImageViewCreateFlags
-> Image
-> ImageViewType
-> Format
-> ComponentMapping
-> ImageSubresourceRange
-> ImageViewCreateInfo es
ImageViewCreateInfo
Chain es
next ImageViewCreateFlags
flags Image
image ImageViewType
viewType Format
format ComponentMapping
components ImageSubresourceRange
subresourceRange
instance es ~ '[] => Zero (ImageViewCreateInfo es) where
zero :: ImageViewCreateInfo es
zero = Chain es
-> ImageViewCreateFlags
-> Image
-> ImageViewType
-> Format
-> ComponentMapping
-> ImageSubresourceRange
-> ImageViewCreateInfo es
forall (es :: [*]).
Chain es
-> ImageViewCreateFlags
-> Image
-> ImageViewType
-> Format
-> ComponentMapping
-> ImageSubresourceRange
-> ImageViewCreateInfo es
ImageViewCreateInfo
()
ImageViewCreateFlags
forall a. Zero a => a
zero
Image
forall a. Zero a => a
zero
ImageViewType
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
ComponentMapping
forall a. Zero a => a
zero
ImageSubresourceRange
forall a. Zero a => a
zero