{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion ( createSamplerYcbcrConversion
, withSamplerYcbcrConversion
, destroySamplerYcbcrConversion
, SamplerYcbcrConversionInfo(..)
, SamplerYcbcrConversionCreateInfo(..)
, BindImagePlaneMemoryInfo(..)
, ImagePlaneMemoryRequirementsInfo(..)
, PhysicalDeviceSamplerYcbcrConversionFeatures(..)
, SamplerYcbcrConversionImageFormatProperties(..)
, SamplerYcbcrConversion(..)
, Format(..)
, StructureType(..)
, ObjectType(..)
, ImageCreateFlagBits(..)
, ImageCreateFlags
, FormatFeatureFlagBits(..)
, FormatFeatureFlags
, ImageAspectFlagBits(..)
, ImageAspectFlags
, SamplerYcbcrModelConversion(..)
, SamplerYcbcrRange(..)
, ChromaLocation(..)
) 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 (allocaBytesAligned)
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.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
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.Dynamic (DeviceCmds(pVkCreateSamplerYcbcrConversion))
import Vulkan.Dynamic (DeviceCmds(pVkDestroySamplerYcbcrConversion))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer (ExternalFormatANDROID)
import Vulkan.Core10.Enums.Filter (Filter)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits)
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.Handles (SamplerYcbcrConversion)
import Vulkan.Core11.Handles (SamplerYcbcrConversion(..))
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_BIND_IMAGE_PLANE_MEMORY_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core11.Enums.ChromaLocation (ChromaLocation(..))
import Vulkan.Core10.Enums.Format (Format(..))
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlagBits(..))
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlags)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits(..))
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Enums.ImageCreateFlagBits (ImageCreateFlagBits(..))
import Vulkan.Core10.Enums.ImageCreateFlagBits (ImageCreateFlags)
import Vulkan.Core10.Enums.ObjectType (ObjectType(..))
import Vulkan.Core11.Handles (SamplerYcbcrConversion(..))
import Vulkan.Core11.Enums.SamplerYcbcrModelConversion (SamplerYcbcrModelConversion(..))
import Vulkan.Core11.Enums.SamplerYcbcrRange (SamplerYcbcrRange(..))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateSamplerYcbcrConversion
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct SamplerYcbcrConversionCreateInfo) -> Ptr AllocationCallbacks -> Ptr SamplerYcbcrConversion -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct SamplerYcbcrConversionCreateInfo) -> Ptr AllocationCallbacks -> Ptr SamplerYcbcrConversion -> IO Result
createSamplerYcbcrConversion :: forall a io
. (Extendss SamplerYcbcrConversionCreateInfo a, PokeChain a, MonadIO io)
=>
Device
->
(SamplerYcbcrConversionCreateInfo a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (SamplerYcbcrConversion)
createSamplerYcbcrConversion :: Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SamplerYcbcrConversion
createSamplerYcbcrConversion device :: Device
device createInfo :: SamplerYcbcrConversionCreateInfo a
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO SamplerYcbcrConversion -> io SamplerYcbcrConversion
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SamplerYcbcrConversion -> io SamplerYcbcrConversion)
-> (ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
-> IO SamplerYcbcrConversion)
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
-> io SamplerYcbcrConversion
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
-> IO SamplerYcbcrConversion
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
-> io SamplerYcbcrConversion)
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
-> io SamplerYcbcrConversion
forall a b. (a -> b) -> a -> b
$ do
let vkCreateSamplerYcbcrConversionPtr :: FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
vkCreateSamplerYcbcrConversionPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
pVkCreateSamplerYcbcrConversion (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT SamplerYcbcrConversion IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SamplerYcbcrConversion IO ())
-> IO () -> ContT SamplerYcbcrConversion 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 SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
vkCreateSamplerYcbcrConversionPtr FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateSamplerYcbcrConversion is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateSamplerYcbcrConversion' :: Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result
vkCreateSamplerYcbcrConversion' = FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
-> Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result
mkVkCreateSamplerYcbcrConversion FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
vkCreateSamplerYcbcrConversionPtr
Ptr (SamplerYcbcrConversionCreateInfo a)
pCreateInfo <- ((Ptr (SamplerYcbcrConversionCreateInfo a)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
(Ptr (SamplerYcbcrConversionCreateInfo a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (SamplerYcbcrConversionCreateInfo a)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
(Ptr (SamplerYcbcrConversionCreateInfo a)))
-> ((Ptr (SamplerYcbcrConversionCreateInfo a)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
(Ptr (SamplerYcbcrConversionCreateInfo a))
forall a b. (a -> b) -> a -> b
$ SamplerYcbcrConversionCreateInfo a
-> (Ptr (SamplerYcbcrConversionCreateInfo a)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SamplerYcbcrConversionCreateInfo a
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
SamplerYcbcrConversion
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
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 SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion <- ((("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion))
-> ((("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> ContT
SamplerYcbcrConversion
IO
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
forall a b. (a -> b) -> a -> b
$ IO ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> (("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion) -> IO ())
-> (("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
forall a. Int -> IO (Ptr a)
callocBytes @SamplerYcbcrConversion 8) ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT SamplerYcbcrConversion IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT SamplerYcbcrConversion IO Result)
-> IO Result -> ContT SamplerYcbcrConversion IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateSamplerYcbcrConversion" (Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result
vkCreateSamplerYcbcrConversion' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Ptr (SamplerYcbcrConversionCreateInfo a)
-> "pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SamplerYcbcrConversionCreateInfo a)
pCreateInfo) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion))
IO () -> ContT SamplerYcbcrConversion IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SamplerYcbcrConversion IO ())
-> IO () -> ContT SamplerYcbcrConversion 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))
SamplerYcbcrConversion
pYcbcrConversion <- IO SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
forall a b. (a -> b) -> a -> b
$ ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrConversion "pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion
SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion)
-> SamplerYcbcrConversion
-> ContT SamplerYcbcrConversion IO SamplerYcbcrConversion
forall a b. (a -> b) -> a -> b
$ (SamplerYcbcrConversion
pYcbcrConversion)
withSamplerYcbcrConversion :: forall a io r . (Extendss SamplerYcbcrConversionCreateInfo a, PokeChain a, MonadIO io) => Device -> SamplerYcbcrConversionCreateInfo a -> Maybe AllocationCallbacks -> (io SamplerYcbcrConversion -> (SamplerYcbcrConversion -> io ()) -> r) -> r
withSamplerYcbcrConversion :: Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io SamplerYcbcrConversion
-> (SamplerYcbcrConversion -> io ()) -> r)
-> r
withSamplerYcbcrConversion device :: Device
device pCreateInfo :: SamplerYcbcrConversionCreateInfo a
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io SamplerYcbcrConversion -> (SamplerYcbcrConversion -> io ()) -> r
b =
io SamplerYcbcrConversion -> (SamplerYcbcrConversion -> io ()) -> r
b (Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SamplerYcbcrConversion
forall (a :: [*]) (io :: * -> *).
(Extendss SamplerYcbcrConversionCreateInfo a, PokeChain a,
MonadIO io) =>
Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SamplerYcbcrConversion
createSamplerYcbcrConversion Device
device SamplerYcbcrConversionCreateInfo a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(SamplerYcbcrConversion
o0) -> Device
-> SamplerYcbcrConversion
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> SamplerYcbcrConversion
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySamplerYcbcrConversion Device
device SamplerYcbcrConversion
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroySamplerYcbcrConversion
:: FunPtr (Ptr Device_T -> SamplerYcbcrConversion -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> SamplerYcbcrConversion -> Ptr AllocationCallbacks -> IO ()
destroySamplerYcbcrConversion :: forall io
. (MonadIO io)
=>
Device
->
SamplerYcbcrConversion
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySamplerYcbcrConversion :: Device
-> SamplerYcbcrConversion
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySamplerYcbcrConversion device :: Device
device ycbcrConversion :: SamplerYcbcrConversion
ycbcrConversion allocator :: "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 vkDestroySamplerYcbcrConversionPtr :: FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroySamplerYcbcrConversionPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
pVkDestroySamplerYcbcrConversion (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
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
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroySamplerYcbcrConversionPtr FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("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 "" "The function pointer for vkDestroySamplerYcbcrConversion is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroySamplerYcbcrConversion' :: Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroySamplerYcbcrConversion' = FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroySamplerYcbcrConversion FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroySamplerYcbcrConversionPtr
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
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 j :: 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 "vkDestroySamplerYcbcrConversion" (Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroySamplerYcbcrConversion' (Device -> Ptr Device_T
deviceHandle (Device
device)) (SamplerYcbcrConversion
ycbcrConversion) "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 SamplerYcbcrConversionInfo = SamplerYcbcrConversionInfo
{
SamplerYcbcrConversionInfo -> SamplerYcbcrConversion
conversion :: SamplerYcbcrConversion }
deriving (Typeable, SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
(SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool)
-> (SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> Bool)
-> Eq SamplerYcbcrConversionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
$c/= :: SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
== :: SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
$c== :: SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerYcbcrConversionInfo)
#endif
deriving instance Show SamplerYcbcrConversionInfo
instance ToCStruct SamplerYcbcrConversionInfo where
withCStruct :: SamplerYcbcrConversionInfo
-> (Ptr SamplerYcbcrConversionInfo -> IO b) -> IO b
withCStruct x :: SamplerYcbcrConversionInfo
x f :: Ptr SamplerYcbcrConversionInfo -> IO b
f = Int -> Int -> (Ptr SamplerYcbcrConversionInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr SamplerYcbcrConversionInfo -> IO b) -> IO b)
-> (Ptr SamplerYcbcrConversionInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SamplerYcbcrConversionInfo
p -> Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionInfo
p SamplerYcbcrConversionInfo
x (Ptr SamplerYcbcrConversionInfo -> IO b
f Ptr SamplerYcbcrConversionInfo
p)
pokeCStruct :: Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO b -> IO b
pokeCStruct p :: Ptr SamplerYcbcrConversionInfo
p SamplerYcbcrConversionInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> SamplerYcbcrConversion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo
-> Int -> "pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SamplerYcbcrConversion)) (SamplerYcbcrConversion
conversion)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr SamplerYcbcrConversionInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr SamplerYcbcrConversionInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> SamplerYcbcrConversion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo
-> Int -> "pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SamplerYcbcrConversion)) (SamplerYcbcrConversion
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SamplerYcbcrConversionInfo where
peekCStruct :: Ptr SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
peekCStruct p :: Ptr SamplerYcbcrConversionInfo
p = do
SamplerYcbcrConversion
conversion <- ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO SamplerYcbcrConversion
forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrConversion ((Ptr SamplerYcbcrConversionInfo
p Ptr SamplerYcbcrConversionInfo
-> Int -> "pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SamplerYcbcrConversion))
SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo)
-> SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
forall a b. (a -> b) -> a -> b
$ SamplerYcbcrConversion -> SamplerYcbcrConversionInfo
SamplerYcbcrConversionInfo
SamplerYcbcrConversion
conversion
instance Storable SamplerYcbcrConversionInfo where
sizeOf :: SamplerYcbcrConversionInfo -> Int
sizeOf ~SamplerYcbcrConversionInfo
_ = 24
alignment :: SamplerYcbcrConversionInfo -> Int
alignment ~SamplerYcbcrConversionInfo
_ = 8
peek :: Ptr SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
peek = Ptr SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO ()
poke ptr :: Ptr SamplerYcbcrConversionInfo
ptr poked :: SamplerYcbcrConversionInfo
poked = Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionInfo
ptr SamplerYcbcrConversionInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerYcbcrConversionInfo where
zero :: SamplerYcbcrConversionInfo
zero = SamplerYcbcrConversion -> SamplerYcbcrConversionInfo
SamplerYcbcrConversionInfo
SamplerYcbcrConversion
forall a. Zero a => a
zero
data SamplerYcbcrConversionCreateInfo (es :: [Type]) = SamplerYcbcrConversionCreateInfo
{
SamplerYcbcrConversionCreateInfo es -> Chain es
next :: Chain es
,
SamplerYcbcrConversionCreateInfo es -> Format
format :: Format
,
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrModelConversion
ycbcrModel :: SamplerYcbcrModelConversion
,
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrRange
ycbcrRange :: SamplerYcbcrRange
,
SamplerYcbcrConversionCreateInfo es -> ComponentMapping
components :: ComponentMapping
,
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
xChromaOffset :: ChromaLocation
,
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
yChromaOffset :: ChromaLocation
,
SamplerYcbcrConversionCreateInfo es -> Filter
chromaFilter :: Filter
,
SamplerYcbcrConversionCreateInfo es -> Bool
forceExplicitReconstruction :: Bool
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerYcbcrConversionCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SamplerYcbcrConversionCreateInfo es)
instance Extensible SamplerYcbcrConversionCreateInfo where
extensibleTypeName :: String
extensibleTypeName = "SamplerYcbcrConversionCreateInfo"
setNext :: SamplerYcbcrConversionCreateInfo ds
-> Chain es -> SamplerYcbcrConversionCreateInfo es
setNext x :: SamplerYcbcrConversionCreateInfo ds
x next :: Chain es
next = SamplerYcbcrConversionCreateInfo ds
x{$sel:next:SamplerYcbcrConversionCreateInfo :: Chain es
next = Chain es
next}
getNext :: SamplerYcbcrConversionCreateInfo es -> Chain es
getNext SamplerYcbcrConversionCreateInfo{..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends SamplerYcbcrConversionCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends SamplerYcbcrConversionCreateInfo e => b) -> Maybe b
extends _ f :: Extends SamplerYcbcrConversionCreateInfo e => b
f
| Just Refl <- (Typeable e, Typeable ExternalFormatANDROID) =>
Maybe (e :~: ExternalFormatANDROID)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExternalFormatANDROID = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SamplerYcbcrConversionCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss SamplerYcbcrConversionCreateInfo es, PokeChain es) => ToCStruct (SamplerYcbcrConversionCreateInfo es) where
withCStruct :: SamplerYcbcrConversionCreateInfo es
-> (Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b) -> IO b
withCStruct x :: SamplerYcbcrConversionCreateInfo es
x f :: Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b
f = Int
-> Int
-> (Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b) -> IO b)
-> (Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr (SamplerYcbcrConversionCreateInfo es)
p -> Ptr (SamplerYcbcrConversionCreateInfo es)
-> SamplerYcbcrConversionCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SamplerYcbcrConversionCreateInfo es)
p SamplerYcbcrConversionCreateInfo es
x (Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b
f Ptr (SamplerYcbcrConversionCreateInfo es)
p)
pokeCStruct :: Ptr (SamplerYcbcrConversionCreateInfo es)
-> SamplerYcbcrConversionCreateInfo es -> IO b -> IO b
pokeCStruct p :: Ptr (SamplerYcbcrConversionCreateInfo es)
p SamplerYcbcrConversionCreateInfo{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_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 (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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 Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: 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 SamplerYcbcrModelConversion
-> SamplerYcbcrModelConversion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrModelConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
ycbcrModel)
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 SamplerYcbcrRange -> SamplerYcbcrRange -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
ycbcrRange)
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 (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: 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 ChromaLocation -> ChromaLocation -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ChromaLocation)) (ChromaLocation
xChromaOffset)
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 ChromaLocation -> ChromaLocation -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr ChromaLocation)) (ChromaLocation
yChromaOffset)
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 Filter -> Filter -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Filter)) (Filter
chromaFilter)
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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forceExplicitReconstruction))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = 64
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b -> IO b
pokeZeroCStruct p :: Ptr (SamplerYcbcrConversionCreateInfo es)
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_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 (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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 Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: 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 SamplerYcbcrModelConversion
-> SamplerYcbcrModelConversion -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrModelConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
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 SamplerYcbcrRange -> SamplerYcbcrRange -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
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 (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: 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 ChromaLocation -> ChromaLocation -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ChromaLocation)) (ChromaLocation
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 ChromaLocation -> ChromaLocation -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr ChromaLocation)) (ChromaLocation
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 Filter -> Filter -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Filter)) (Filter
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 Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
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 SamplerYcbcrConversionCreateInfo es, PeekChain es) => FromCStruct (SamplerYcbcrConversionCreateInfo es) where
peekCStruct :: Ptr (SamplerYcbcrConversionCreateInfo es)
-> IO (SamplerYcbcrConversionCreateInfo es)
peekCStruct p :: Ptr (SamplerYcbcrConversionCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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)
Format
format <- Ptr Format -> IO Format
forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Format))
SamplerYcbcrModelConversion
ycbcrModel <- Ptr SamplerYcbcrModelConversion -> IO SamplerYcbcrModelConversion
forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrModelConversion ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrModelConversion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr SamplerYcbcrModelConversion))
SamplerYcbcrRange
ycbcrRange <- Ptr SamplerYcbcrRange -> IO SamplerYcbcrRange
forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrRange ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr SamplerYcbcrRange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr SamplerYcbcrRange))
ComponentMapping
components <- Ptr ComponentMapping -> IO ComponentMapping
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ComponentMapping
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr ComponentMapping))
ChromaLocation
xChromaOffset <- Ptr ChromaLocation -> IO ChromaLocation
forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ChromaLocation))
ChromaLocation
yChromaOffset <- Ptr ChromaLocation -> IO ChromaLocation
forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es)
-> Int -> Ptr ChromaLocation
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr ChromaLocation))
Filter
chromaFilter <- Ptr Filter -> IO Filter
forall a. Storable a => Ptr a -> IO a
peek @Filter ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Filter))
Bool32
forceExplicitReconstruction <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (SamplerYcbcrConversionCreateInfo es)
p Ptr (SamplerYcbcrConversionCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Bool32))
SamplerYcbcrConversionCreateInfo es
-> IO (SamplerYcbcrConversionCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SamplerYcbcrConversionCreateInfo es
-> IO (SamplerYcbcrConversionCreateInfo es))
-> SamplerYcbcrConversionCreateInfo es
-> IO (SamplerYcbcrConversionCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> Format
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ComponentMapping
-> ChromaLocation
-> ChromaLocation
-> Filter
-> Bool
-> SamplerYcbcrConversionCreateInfo es
forall (es :: [*]).
Chain es
-> Format
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ComponentMapping
-> ChromaLocation
-> ChromaLocation
-> Filter
-> Bool
-> SamplerYcbcrConversionCreateInfo es
SamplerYcbcrConversionCreateInfo
Chain es
next Format
format SamplerYcbcrModelConversion
ycbcrModel SamplerYcbcrRange
ycbcrRange ComponentMapping
components ChromaLocation
xChromaOffset ChromaLocation
yChromaOffset Filter
chromaFilter (Bool32 -> Bool
bool32ToBool Bool32
forceExplicitReconstruction)
instance es ~ '[] => Zero (SamplerYcbcrConversionCreateInfo es) where
zero :: SamplerYcbcrConversionCreateInfo es
zero = Chain es
-> Format
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ComponentMapping
-> ChromaLocation
-> ChromaLocation
-> Filter
-> Bool
-> SamplerYcbcrConversionCreateInfo es
forall (es :: [*]).
Chain es
-> Format
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ComponentMapping
-> ChromaLocation
-> ChromaLocation
-> Filter
-> Bool
-> SamplerYcbcrConversionCreateInfo es
SamplerYcbcrConversionCreateInfo
()
Format
forall a. Zero a => a
zero
SamplerYcbcrModelConversion
forall a. Zero a => a
zero
SamplerYcbcrRange
forall a. Zero a => a
zero
ComponentMapping
forall a. Zero a => a
zero
ChromaLocation
forall a. Zero a => a
zero
ChromaLocation
forall a. Zero a => a
zero
Filter
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data BindImagePlaneMemoryInfo = BindImagePlaneMemoryInfo
{
BindImagePlaneMemoryInfo -> ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits }
deriving (Typeable, BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
(BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool)
-> (BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool)
-> Eq BindImagePlaneMemoryInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
$c/= :: BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
== :: BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
$c== :: BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindImagePlaneMemoryInfo)
#endif
deriving instance Show BindImagePlaneMemoryInfo
instance ToCStruct BindImagePlaneMemoryInfo where
withCStruct :: BindImagePlaneMemoryInfo
-> (Ptr BindImagePlaneMemoryInfo -> IO b) -> IO b
withCStruct x :: BindImagePlaneMemoryInfo
x f :: Ptr BindImagePlaneMemoryInfo -> IO b
f = Int -> Int -> (Ptr BindImagePlaneMemoryInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr BindImagePlaneMemoryInfo -> IO b) -> IO b)
-> (Ptr BindImagePlaneMemoryInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BindImagePlaneMemoryInfo
p -> Ptr BindImagePlaneMemoryInfo
-> BindImagePlaneMemoryInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindImagePlaneMemoryInfo
p BindImagePlaneMemoryInfo
x (Ptr BindImagePlaneMemoryInfo -> IO b
f Ptr BindImagePlaneMemoryInfo
p)
pokeCStruct :: Ptr BindImagePlaneMemoryInfo
-> BindImagePlaneMemoryInfo -> IO b -> IO b
pokeCStruct p :: Ptr BindImagePlaneMemoryInfo
p BindImagePlaneMemoryInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageAspectFlagBits -> ImageAspectFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
planeAspect)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr BindImagePlaneMemoryInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr BindImagePlaneMemoryInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageAspectFlagBits -> ImageAspectFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct BindImagePlaneMemoryInfo where
peekCStruct :: Ptr BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
peekCStruct p :: Ptr BindImagePlaneMemoryInfo
p = do
ImageAspectFlagBits
planeAspect <- Ptr ImageAspectFlagBits -> IO ImageAspectFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr BindImagePlaneMemoryInfo
p Ptr BindImagePlaneMemoryInfo -> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits))
BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo)
-> BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
forall a b. (a -> b) -> a -> b
$ ImageAspectFlagBits -> BindImagePlaneMemoryInfo
BindImagePlaneMemoryInfo
ImageAspectFlagBits
planeAspect
instance Storable BindImagePlaneMemoryInfo where
sizeOf :: BindImagePlaneMemoryInfo -> Int
sizeOf ~BindImagePlaneMemoryInfo
_ = 24
alignment :: BindImagePlaneMemoryInfo -> Int
alignment ~BindImagePlaneMemoryInfo
_ = 8
peek :: Ptr BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
peek = Ptr BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> IO ()
poke ptr :: Ptr BindImagePlaneMemoryInfo
ptr poked :: BindImagePlaneMemoryInfo
poked = Ptr BindImagePlaneMemoryInfo
-> BindImagePlaneMemoryInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindImagePlaneMemoryInfo
ptr BindImagePlaneMemoryInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BindImagePlaneMemoryInfo where
zero :: BindImagePlaneMemoryInfo
zero = ImageAspectFlagBits -> BindImagePlaneMemoryInfo
BindImagePlaneMemoryInfo
ImageAspectFlagBits
forall a. Zero a => a
zero
data ImagePlaneMemoryRequirementsInfo = ImagePlaneMemoryRequirementsInfo
{
ImagePlaneMemoryRequirementsInfo -> ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits }
deriving (Typeable, ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
(ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool)
-> (ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool)
-> Eq ImagePlaneMemoryRequirementsInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
$c/= :: ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
== :: ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
$c== :: ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImagePlaneMemoryRequirementsInfo)
#endif
deriving instance Show ImagePlaneMemoryRequirementsInfo
instance ToCStruct ImagePlaneMemoryRequirementsInfo where
withCStruct :: ImagePlaneMemoryRequirementsInfo
-> (Ptr ImagePlaneMemoryRequirementsInfo -> IO b) -> IO b
withCStruct x :: ImagePlaneMemoryRequirementsInfo
x f :: Ptr ImagePlaneMemoryRequirementsInfo -> IO b
f = Int
-> Int -> (Ptr ImagePlaneMemoryRequirementsInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr ImagePlaneMemoryRequirementsInfo -> IO b) -> IO b)
-> (Ptr ImagePlaneMemoryRequirementsInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ImagePlaneMemoryRequirementsInfo
p -> Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImagePlaneMemoryRequirementsInfo
p ImagePlaneMemoryRequirementsInfo
x (Ptr ImagePlaneMemoryRequirementsInfo -> IO b
f Ptr ImagePlaneMemoryRequirementsInfo
p)
pokeCStruct :: Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO b -> IO b
pokeCStruct p :: Ptr ImagePlaneMemoryRequirementsInfo
p ImagePlaneMemoryRequirementsInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageAspectFlagBits -> ImageAspectFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo
-> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
planeAspect)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ImagePlaneMemoryRequirementsInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImagePlaneMemoryRequirementsInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageAspectFlagBits -> ImageAspectFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo
-> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImagePlaneMemoryRequirementsInfo where
peekCStruct :: Ptr ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
peekCStruct p :: Ptr ImagePlaneMemoryRequirementsInfo
p = do
ImageAspectFlagBits
planeAspect <- Ptr ImageAspectFlagBits -> IO ImageAspectFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr ImagePlaneMemoryRequirementsInfo
p Ptr ImagePlaneMemoryRequirementsInfo
-> Int -> Ptr ImageAspectFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageAspectFlagBits))
ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo)
-> ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
forall a b. (a -> b) -> a -> b
$ ImageAspectFlagBits -> ImagePlaneMemoryRequirementsInfo
ImagePlaneMemoryRequirementsInfo
ImageAspectFlagBits
planeAspect
instance Storable ImagePlaneMemoryRequirementsInfo where
sizeOf :: ImagePlaneMemoryRequirementsInfo -> Int
sizeOf ~ImagePlaneMemoryRequirementsInfo
_ = 24
alignment :: ImagePlaneMemoryRequirementsInfo -> Int
alignment ~ImagePlaneMemoryRequirementsInfo
_ = 8
peek :: Ptr ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
peek = Ptr ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO ()
poke ptr :: Ptr ImagePlaneMemoryRequirementsInfo
ptr poked :: ImagePlaneMemoryRequirementsInfo
poked = Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImagePlaneMemoryRequirementsInfo
ptr ImagePlaneMemoryRequirementsInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImagePlaneMemoryRequirementsInfo where
zero :: ImagePlaneMemoryRequirementsInfo
zero = ImageAspectFlagBits -> ImagePlaneMemoryRequirementsInfo
ImagePlaneMemoryRequirementsInfo
ImageAspectFlagBits
forall a. Zero a => a
zero
data PhysicalDeviceSamplerYcbcrConversionFeatures = PhysicalDeviceSamplerYcbcrConversionFeatures
{
PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
samplerYcbcrConversion :: Bool }
deriving (Typeable, PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
(PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool)
-> (PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool)
-> Eq PhysicalDeviceSamplerYcbcrConversionFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
$c/= :: PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
== :: PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
$c== :: PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceSamplerYcbcrConversionFeatures)
#endif
deriving instance Show PhysicalDeviceSamplerYcbcrConversionFeatures
instance ToCStruct PhysicalDeviceSamplerYcbcrConversionFeatures where
withCStruct :: PhysicalDeviceSamplerYcbcrConversionFeatures
-> (Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceSamplerYcbcrConversionFeatures
x f :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p -> Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p PhysicalDeviceSamplerYcbcrConversionFeatures
x (Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b
f Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p)
pokeCStruct :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p PhysicalDeviceSamplerYcbcrConversionFeatures{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
samplerYcbcrConversion))
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceSamplerYcbcrConversionFeatures where
peekCStruct :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
peekCStruct p :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p = do
Bool32
samplerYcbcrConversion <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures)
-> PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceSamplerYcbcrConversionFeatures
PhysicalDeviceSamplerYcbcrConversionFeatures
(Bool32 -> Bool
bool32ToBool Bool32
samplerYcbcrConversion)
instance Storable PhysicalDeviceSamplerYcbcrConversionFeatures where
sizeOf :: PhysicalDeviceSamplerYcbcrConversionFeatures -> Int
sizeOf ~PhysicalDeviceSamplerYcbcrConversionFeatures
_ = 24
alignment :: PhysicalDeviceSamplerYcbcrConversionFeatures -> Int
alignment ~PhysicalDeviceSamplerYcbcrConversionFeatures
_ = 8
peek :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
peek = Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO ()
poke ptr :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
ptr poked :: PhysicalDeviceSamplerYcbcrConversionFeatures
poked = Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
ptr PhysicalDeviceSamplerYcbcrConversionFeatures
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceSamplerYcbcrConversionFeatures where
zero :: PhysicalDeviceSamplerYcbcrConversionFeatures
zero = Bool -> PhysicalDeviceSamplerYcbcrConversionFeatures
PhysicalDeviceSamplerYcbcrConversionFeatures
Bool
forall a. Zero a => a
zero
data SamplerYcbcrConversionImageFormatProperties = SamplerYcbcrConversionImageFormatProperties
{
SamplerYcbcrConversionImageFormatProperties -> Word32
combinedImageSamplerDescriptorCount :: Word32 }
deriving (Typeable, SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
(SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool)
-> (SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool)
-> Eq SamplerYcbcrConversionImageFormatProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
$c/= :: SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
== :: SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
$c== :: SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerYcbcrConversionImageFormatProperties)
#endif
deriving instance Show SamplerYcbcrConversionImageFormatProperties
instance ToCStruct SamplerYcbcrConversionImageFormatProperties where
withCStruct :: SamplerYcbcrConversionImageFormatProperties
-> (Ptr SamplerYcbcrConversionImageFormatProperties -> IO b)
-> IO b
withCStruct x :: SamplerYcbcrConversionImageFormatProperties
x f :: Ptr SamplerYcbcrConversionImageFormatProperties -> IO b
f = Int
-> Int
-> (Ptr SamplerYcbcrConversionImageFormatProperties -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr SamplerYcbcrConversionImageFormatProperties -> IO b) -> IO b)
-> (Ptr SamplerYcbcrConversionImageFormatProperties -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SamplerYcbcrConversionImageFormatProperties
p -> Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionImageFormatProperties
p SamplerYcbcrConversionImageFormatProperties
x (Ptr SamplerYcbcrConversionImageFormatProperties -> IO b
f Ptr SamplerYcbcrConversionImageFormatProperties
p)
pokeCStruct :: Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO b -> IO b
pokeCStruct p :: Ptr SamplerYcbcrConversionImageFormatProperties
p SamplerYcbcrConversionImageFormatProperties{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
combinedImageSamplerDescriptorCount)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr SamplerYcbcrConversionImageFormatProperties -> IO b -> IO b
pokeZeroCStruct p :: Ptr SamplerYcbcrConversionImageFormatProperties
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SamplerYcbcrConversionImageFormatProperties where
peekCStruct :: Ptr SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
peekCStruct p :: Ptr SamplerYcbcrConversionImageFormatProperties
p = do
Word32
combinedImageSamplerDescriptorCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SamplerYcbcrConversionImageFormatProperties
p Ptr SamplerYcbcrConversionImageFormatProperties
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties)
-> SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
forall a b. (a -> b) -> a -> b
$ Word32 -> SamplerYcbcrConversionImageFormatProperties
SamplerYcbcrConversionImageFormatProperties
Word32
combinedImageSamplerDescriptorCount
instance Storable SamplerYcbcrConversionImageFormatProperties where
sizeOf :: SamplerYcbcrConversionImageFormatProperties -> Int
sizeOf ~SamplerYcbcrConversionImageFormatProperties
_ = 24
alignment :: SamplerYcbcrConversionImageFormatProperties -> Int
alignment ~SamplerYcbcrConversionImageFormatProperties
_ = 8
peek :: Ptr SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
peek = Ptr SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO ()
poke ptr :: Ptr SamplerYcbcrConversionImageFormatProperties
ptr poked :: SamplerYcbcrConversionImageFormatProperties
poked = Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionImageFormatProperties
ptr SamplerYcbcrConversionImageFormatProperties
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerYcbcrConversionImageFormatProperties where
zero :: SamplerYcbcrConversionImageFormatProperties
zero = Word32 -> SamplerYcbcrConversionImageFormatProperties
SamplerYcbcrConversionImageFormatProperties
Word32
forall a. Zero a => a
zero