{-# 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 (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.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.Core10.Handles (Device(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 {-# SOURCE #-} Vulkan.Extensions.VK_QNX_external_memory_screen_buffer (ExternalFormatQNX)
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 {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_ycbcr_degamma (SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM)
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 :: forall (a :: [*]) (io :: * -> *).
(Extendss SamplerYcbcrConversionCreateInfo a, PokeChain a,
MonadIO io) =>
Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SamplerYcbcrConversion
createSamplerYcbcrConversion Device
device
SamplerYcbcrConversionCreateInfo a
createInfo
"allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let 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 (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result)
vkCreateSamplerYcbcrConversionPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateSamplerYcbcrConversion is null" forall a. Maybe a
Nothing 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 <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall 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
"allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @SamplerYcbcrConversion Int
8) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateSamplerYcbcrConversion" (Ptr Device_T
-> ("pCreateInfo"
::: Ptr (SomeStruct SamplerYcbcrConversionCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion)
-> IO Result
vkCreateSamplerYcbcrConversion'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SamplerYcbcrConversionCreateInfo a)
pCreateInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator
("pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
SamplerYcbcrConversion
pYcbcrConversion <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrConversion "pYcbcrConversion" ::: Ptr SamplerYcbcrConversion
pPYcbcrConversion
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 :: forall (a :: [*]) (io :: * -> *) r.
(Extendss SamplerYcbcrConversionCreateInfo a, PokeChain a,
MonadIO io) =>
Device
-> SamplerYcbcrConversionCreateInfo a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io SamplerYcbcrConversion
-> (SamplerYcbcrConversion -> io ()) -> r)
-> r
withSamplerYcbcrConversion Device
device SamplerYcbcrConversionCreateInfo a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io SamplerYcbcrConversion -> (SamplerYcbcrConversion -> io ()) -> r
b =
io SamplerYcbcrConversion -> (SamplerYcbcrConversion -> io ()) -> r
b (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) -> 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 :: forall (io :: * -> *).
MonadIO io =>
Device
-> SamplerYcbcrConversion
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroySamplerYcbcrConversion Device
device
SamplerYcbcrConversion
ycbcrConversion
"allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkDestroySamplerYcbcrConversionPtr :: FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroySamplerYcbcrConversionPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
pVkDestroySamplerYcbcrConversion (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroySamplerYcbcrConversionPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroySamplerYcbcrConversion is null" forall a. Maybe a
Nothing 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
"allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroySamplerYcbcrConversion" (Ptr Device_T
-> SamplerYcbcrConversion
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroySamplerYcbcrConversion'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(SamplerYcbcrConversion
ycbcrConversion)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data SamplerYcbcrConversionInfo = SamplerYcbcrConversionInfo
{
SamplerYcbcrConversionInfo -> SamplerYcbcrConversion
conversion :: SamplerYcbcrConversion }
deriving (Typeable, SamplerYcbcrConversionInfo -> SamplerYcbcrConversionInfo -> Bool
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 :: forall b.
SamplerYcbcrConversionInfo
-> (Ptr SamplerYcbcrConversionInfo -> IO b) -> IO b
withCStruct SamplerYcbcrConversionInfo
x Ptr SamplerYcbcrConversionInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SamplerYcbcrConversionInfo
p -> 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 :: forall b.
Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionInfo
p SamplerYcbcrConversionInfo{SamplerYcbcrConversion
conversion :: SamplerYcbcrConversion
$sel:conversion:SamplerYcbcrConversionInfo :: SamplerYcbcrConversionInfo -> SamplerYcbcrConversion
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerYcbcrConversion)) (SamplerYcbcrConversion
conversion)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr SamplerYcbcrConversionInfo -> IO b -> IO b
pokeZeroCStruct Ptr SamplerYcbcrConversionInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerYcbcrConversion)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SamplerYcbcrConversionInfo where
peekCStruct :: Ptr SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
peekCStruct Ptr SamplerYcbcrConversionInfo
p = do
SamplerYcbcrConversion
conversion <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrConversion ((Ptr SamplerYcbcrConversionInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerYcbcrConversion))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SamplerYcbcrConversion -> SamplerYcbcrConversionInfo
SamplerYcbcrConversionInfo
SamplerYcbcrConversion
conversion
instance Storable SamplerYcbcrConversionInfo where
sizeOf :: SamplerYcbcrConversionInfo -> Int
sizeOf ~SamplerYcbcrConversionInfo
_ = Int
24
alignment :: SamplerYcbcrConversionInfo -> Int
alignment ~SamplerYcbcrConversionInfo
_ = Int
8
peek :: Ptr SamplerYcbcrConversionInfo -> IO SamplerYcbcrConversionInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerYcbcrConversionInfo
-> SamplerYcbcrConversionInfo -> IO ()
poke Ptr SamplerYcbcrConversionInfo
ptr SamplerYcbcrConversionInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionInfo
ptr SamplerYcbcrConversionInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerYcbcrConversionInfo where
zero :: SamplerYcbcrConversionInfo
zero = SamplerYcbcrConversion -> SamplerYcbcrConversionInfo
SamplerYcbcrConversionInfo
forall a. Zero a => a
zero
data SamplerYcbcrConversionCreateInfo (es :: [Type]) = SamplerYcbcrConversionCreateInfo
{
forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Format
format :: Format
,
forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrModelConversion
ycbcrModel :: SamplerYcbcrModelConversion
,
forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrRange
ycbcrRange :: SamplerYcbcrRange
,
forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ComponentMapping
components :: ComponentMapping
,
forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
xChromaOffset :: ChromaLocation
,
forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
yChromaOffset :: ChromaLocation
,
forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Filter
chromaFilter :: Filter
,
forall (es :: [*]). 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 = String
"SamplerYcbcrConversionCreateInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
SamplerYcbcrConversionCreateInfo ds
-> Chain es -> SamplerYcbcrConversionCreateInfo es
setNext SamplerYcbcrConversionCreateInfo{Bool
Chain ds
Filter
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
forceExplicitReconstruction :: Bool
chromaFilter :: Filter
yChromaOffset :: ChromaLocation
xChromaOffset :: ChromaLocation
components :: ComponentMapping
ycbcrRange :: SamplerYcbcrRange
ycbcrModel :: SamplerYcbcrModelConversion
format :: Format
next :: Chain ds
$sel:forceExplicitReconstruction:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Bool
$sel:chromaFilter:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Filter
$sel:yChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:xChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:components:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ComponentMapping
$sel:ycbcrRange:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrRange
$sel:ycbcrModel:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrModelConversion
$sel:format:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Format
$sel:next:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Chain es
..} Chain es
next' = SamplerYcbcrConversionCreateInfo{$sel:next:SamplerYcbcrConversionCreateInfo :: Chain es
next = Chain es
next', Bool
Filter
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
forceExplicitReconstruction :: Bool
chromaFilter :: Filter
yChromaOffset :: ChromaLocation
xChromaOffset :: ChromaLocation
components :: ComponentMapping
ycbcrRange :: SamplerYcbcrRange
ycbcrModel :: SamplerYcbcrModelConversion
format :: Format
$sel:forceExplicitReconstruction:SamplerYcbcrConversionCreateInfo :: Bool
$sel:chromaFilter:SamplerYcbcrConversionCreateInfo :: Filter
$sel:yChromaOffset:SamplerYcbcrConversionCreateInfo :: ChromaLocation
$sel:xChromaOffset:SamplerYcbcrConversionCreateInfo :: ChromaLocation
$sel:components:SamplerYcbcrConversionCreateInfo :: ComponentMapping
$sel:ycbcrRange:SamplerYcbcrConversionCreateInfo :: SamplerYcbcrRange
$sel:ycbcrModel:SamplerYcbcrConversionCreateInfo :: SamplerYcbcrModelConversion
$sel:format:SamplerYcbcrConversionCreateInfo :: Format
..}
getNext :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Chain es
getNext SamplerYcbcrConversionCreateInfo{Bool
Chain es
Filter
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
forceExplicitReconstruction :: Bool
chromaFilter :: Filter
yChromaOffset :: ChromaLocation
xChromaOffset :: ChromaLocation
components :: ComponentMapping
ycbcrRange :: SamplerYcbcrRange
ycbcrModel :: SamplerYcbcrModelConversion
format :: Format
next :: Chain es
$sel:forceExplicitReconstruction:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Bool
$sel:chromaFilter:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Filter
$sel:yChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:xChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:components:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ComponentMapping
$sel:ycbcrRange:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrRange
$sel:ycbcrModel:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrModelConversion
$sel:format:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Format
$sel:next:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends SamplerYcbcrConversionCreateInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends SamplerYcbcrConversionCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends SamplerYcbcrConversionCreateInfo e => b
f
| Just e :~: SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM = forall a. a -> Maybe a
Just Extends SamplerYcbcrConversionCreateInfo e => b
f
| Just e :~: ExternalFormatQNX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExternalFormatQNX = forall a. a -> Maybe a
Just Extends SamplerYcbcrConversionCreateInfo e => b
f
| Just e :~: ExternalFormatANDROID
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExternalFormatANDROID = forall a. a -> Maybe a
Just Extends SamplerYcbcrConversionCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss SamplerYcbcrConversionCreateInfo es
, PokeChain es ) => ToCStruct (SamplerYcbcrConversionCreateInfo es) where
withCStruct :: forall b.
SamplerYcbcrConversionCreateInfo es
-> (Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b) -> IO b
withCStruct SamplerYcbcrConversionCreateInfo es
x Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr (SamplerYcbcrConversionCreateInfo es)
p -> 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 :: forall b.
Ptr (SamplerYcbcrConversionCreateInfo es)
-> SamplerYcbcrConversionCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (SamplerYcbcrConversionCreateInfo es)
p SamplerYcbcrConversionCreateInfo{Bool
Chain es
Filter
Format
ComponentMapping
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
forceExplicitReconstruction :: Bool
chromaFilter :: Filter
yChromaOffset :: ChromaLocation
xChromaOffset :: ChromaLocation
components :: ComponentMapping
ycbcrRange :: SamplerYcbcrRange
ycbcrModel :: SamplerYcbcrModelConversion
format :: Format
next :: Chain es
$sel:forceExplicitReconstruction:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Bool
$sel:chromaFilter:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Filter
$sel:yChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:xChromaOffset:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ChromaLocation
$sel:components:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> ComponentMapping
$sel:ycbcrRange:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrRange
$sel:ycbcrModel:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]).
SamplerYcbcrConversionCreateInfo es -> SamplerYcbcrModelConversion
$sel:format:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Format
$sel:next:SamplerYcbcrConversionCreateInfo :: forall (es :: [*]). SamplerYcbcrConversionCreateInfo es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (Format
format)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
ycbcrModel)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
ycbcrRange)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ComponentMapping)) (ComponentMapping
components)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ChromaLocation)) (ChromaLocation
xChromaOffset)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ChromaLocation)) (ChromaLocation
yChromaOffset)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Filter)) (Filter
chromaFilter)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forceExplicitReconstruction))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (SamplerYcbcrConversionCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (SamplerYcbcrConversionCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SamplerYcbcrModelConversion)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SamplerYcbcrRange)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ComponentMapping)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Filter)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss SamplerYcbcrConversionCreateInfo es
, PeekChain es ) => FromCStruct (SamplerYcbcrConversionCreateInfo es) where
peekCStruct :: Ptr (SamplerYcbcrConversionCreateInfo es)
-> IO (SamplerYcbcrConversionCreateInfo es)
peekCStruct Ptr (SamplerYcbcrConversionCreateInfo es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Format))
SamplerYcbcrModelConversion
ycbcrModel <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrModelConversion ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SamplerYcbcrModelConversion))
SamplerYcbcrRange
ycbcrRange <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrRange ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SamplerYcbcrRange))
ComponentMapping
components <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ComponentMapping))
ChromaLocation
xChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ChromaLocation))
ChromaLocation
yChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ChromaLocation))
Filter
chromaFilter <- forall a. Storable a => Ptr a -> IO a
peek @Filter ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Filter))
Bool32
forceExplicitReconstruction <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (SamplerYcbcrConversionCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> Format
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ComponentMapping
-> ChromaLocation
-> ChromaLocation
-> Filter
-> Bool
-> SamplerYcbcrConversionCreateInfo es
SamplerYcbcrConversionCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data BindImagePlaneMemoryInfo = BindImagePlaneMemoryInfo
{
BindImagePlaneMemoryInfo -> ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits }
deriving (Typeable, BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> Bool
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 :: forall b.
BindImagePlaneMemoryInfo
-> (Ptr BindImagePlaneMemoryInfo -> IO b) -> IO b
withCStruct BindImagePlaneMemoryInfo
x Ptr BindImagePlaneMemoryInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr BindImagePlaneMemoryInfo
p -> 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 :: forall b.
Ptr BindImagePlaneMemoryInfo
-> BindImagePlaneMemoryInfo -> IO b -> IO b
pokeCStruct Ptr BindImagePlaneMemoryInfo
p BindImagePlaneMemoryInfo{ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits
$sel:planeAspect:BindImagePlaneMemoryInfo :: BindImagePlaneMemoryInfo -> ImageAspectFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
planeAspect)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr BindImagePlaneMemoryInfo -> IO b -> IO b
pokeZeroCStruct Ptr BindImagePlaneMemoryInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct BindImagePlaneMemoryInfo where
peekCStruct :: Ptr BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
peekCStruct Ptr BindImagePlaneMemoryInfo
p = do
ImageAspectFlagBits
planeAspect <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr BindImagePlaneMemoryInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageAspectFlagBits -> BindImagePlaneMemoryInfo
BindImagePlaneMemoryInfo
ImageAspectFlagBits
planeAspect
instance Storable BindImagePlaneMemoryInfo where
sizeOf :: BindImagePlaneMemoryInfo -> Int
sizeOf ~BindImagePlaneMemoryInfo
_ = Int
24
alignment :: BindImagePlaneMemoryInfo -> Int
alignment ~BindImagePlaneMemoryInfo
_ = Int
8
peek :: Ptr BindImagePlaneMemoryInfo -> IO BindImagePlaneMemoryInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BindImagePlaneMemoryInfo -> BindImagePlaneMemoryInfo -> IO ()
poke Ptr BindImagePlaneMemoryInfo
ptr BindImagePlaneMemoryInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindImagePlaneMemoryInfo
ptr BindImagePlaneMemoryInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BindImagePlaneMemoryInfo where
zero :: BindImagePlaneMemoryInfo
zero = ImageAspectFlagBits -> BindImagePlaneMemoryInfo
BindImagePlaneMemoryInfo
forall a. Zero a => a
zero
data ImagePlaneMemoryRequirementsInfo = ImagePlaneMemoryRequirementsInfo
{
ImagePlaneMemoryRequirementsInfo -> ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits }
deriving (Typeable, ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> Bool
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 :: forall b.
ImagePlaneMemoryRequirementsInfo
-> (Ptr ImagePlaneMemoryRequirementsInfo -> IO b) -> IO b
withCStruct ImagePlaneMemoryRequirementsInfo
x Ptr ImagePlaneMemoryRequirementsInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ImagePlaneMemoryRequirementsInfo
p -> 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 :: forall b.
Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO b -> IO b
pokeCStruct Ptr ImagePlaneMemoryRequirementsInfo
p ImagePlaneMemoryRequirementsInfo{ImageAspectFlagBits
planeAspect :: ImageAspectFlagBits
$sel:planeAspect:ImagePlaneMemoryRequirementsInfo :: ImagePlaneMemoryRequirementsInfo -> ImageAspectFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (ImageAspectFlagBits
planeAspect)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImagePlaneMemoryRequirementsInfo -> IO b -> IO b
pokeZeroCStruct Ptr ImagePlaneMemoryRequirementsInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImagePlaneMemoryRequirementsInfo where
peekCStruct :: Ptr ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
peekCStruct Ptr ImagePlaneMemoryRequirementsInfo
p = do
ImageAspectFlagBits
planeAspect <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlagBits ((Ptr ImagePlaneMemoryRequirementsInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageAspectFlagBits))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageAspectFlagBits -> ImagePlaneMemoryRequirementsInfo
ImagePlaneMemoryRequirementsInfo
ImageAspectFlagBits
planeAspect
instance Storable ImagePlaneMemoryRequirementsInfo where
sizeOf :: ImagePlaneMemoryRequirementsInfo -> Int
sizeOf ~ImagePlaneMemoryRequirementsInfo
_ = Int
24
alignment :: ImagePlaneMemoryRequirementsInfo -> Int
alignment ~ImagePlaneMemoryRequirementsInfo
_ = Int
8
peek :: Ptr ImagePlaneMemoryRequirementsInfo
-> IO ImagePlaneMemoryRequirementsInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImagePlaneMemoryRequirementsInfo
-> ImagePlaneMemoryRequirementsInfo -> IO ()
poke Ptr ImagePlaneMemoryRequirementsInfo
ptr ImagePlaneMemoryRequirementsInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImagePlaneMemoryRequirementsInfo
ptr ImagePlaneMemoryRequirementsInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImagePlaneMemoryRequirementsInfo where
zero :: ImagePlaneMemoryRequirementsInfo
zero = ImageAspectFlagBits -> ImagePlaneMemoryRequirementsInfo
ImagePlaneMemoryRequirementsInfo
forall a. Zero a => a
zero
data PhysicalDeviceSamplerYcbcrConversionFeatures = PhysicalDeviceSamplerYcbcrConversionFeatures
{
PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
samplerYcbcrConversion :: Bool }
deriving (Typeable, PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
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 :: forall b.
PhysicalDeviceSamplerYcbcrConversionFeatures
-> (Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b)
-> IO b
withCStruct PhysicalDeviceSamplerYcbcrConversionFeatures
x Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p -> 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 :: forall b.
Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p PhysicalDeviceSamplerYcbcrConversionFeatures{Bool
samplerYcbcrConversion :: Bool
$sel:samplerYcbcrConversion:PhysicalDeviceSamplerYcbcrConversionFeatures :: PhysicalDeviceSamplerYcbcrConversionFeatures -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
samplerYcbcrConversion))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceSamplerYcbcrConversionFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceSamplerYcbcrConversionFeatures where
peekCStruct :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
peekCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p = do
Bool32
samplerYcbcrConversion <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceSamplerYcbcrConversionFeatures
PhysicalDeviceSamplerYcbcrConversionFeatures
(Bool32 -> Bool
bool32ToBool Bool32
samplerYcbcrConversion)
instance Storable PhysicalDeviceSamplerYcbcrConversionFeatures where
sizeOf :: PhysicalDeviceSamplerYcbcrConversionFeatures -> Int
sizeOf ~PhysicalDeviceSamplerYcbcrConversionFeatures
_ = Int
24
alignment :: PhysicalDeviceSamplerYcbcrConversionFeatures -> Int
alignment ~PhysicalDeviceSamplerYcbcrConversionFeatures
_ = Int
8
peek :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> IO PhysicalDeviceSamplerYcbcrConversionFeatures
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
-> PhysicalDeviceSamplerYcbcrConversionFeatures -> IO ()
poke Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
ptr PhysicalDeviceSamplerYcbcrConversionFeatures
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerYcbcrConversionFeatures
ptr PhysicalDeviceSamplerYcbcrConversionFeatures
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceSamplerYcbcrConversionFeatures where
zero :: PhysicalDeviceSamplerYcbcrConversionFeatures
zero = Bool -> PhysicalDeviceSamplerYcbcrConversionFeatures
PhysicalDeviceSamplerYcbcrConversionFeatures
forall a. Zero a => a
zero
data SamplerYcbcrConversionImageFormatProperties = SamplerYcbcrConversionImageFormatProperties
{
SamplerYcbcrConversionImageFormatProperties -> Word32
combinedImageSamplerDescriptorCount :: Word32 }
deriving (Typeable, SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> Bool
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 :: forall b.
SamplerYcbcrConversionImageFormatProperties
-> (Ptr SamplerYcbcrConversionImageFormatProperties -> IO b)
-> IO b
withCStruct SamplerYcbcrConversionImageFormatProperties
x Ptr SamplerYcbcrConversionImageFormatProperties -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SamplerYcbcrConversionImageFormatProperties
p -> 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 :: forall b.
Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionImageFormatProperties
p SamplerYcbcrConversionImageFormatProperties{Word32
combinedImageSamplerDescriptorCount :: Word32
$sel:combinedImageSamplerDescriptorCount:SamplerYcbcrConversionImageFormatProperties :: SamplerYcbcrConversionImageFormatProperties -> Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
combinedImageSamplerDescriptorCount)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr SamplerYcbcrConversionImageFormatProperties -> IO b -> IO b
pokeZeroCStruct Ptr SamplerYcbcrConversionImageFormatProperties
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SamplerYcbcrConversionImageFormatProperties where
peekCStruct :: Ptr SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
peekCStruct Ptr SamplerYcbcrConversionImageFormatProperties
p = do
Word32
combinedImageSamplerDescriptorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SamplerYcbcrConversionImageFormatProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> SamplerYcbcrConversionImageFormatProperties
SamplerYcbcrConversionImageFormatProperties
Word32
combinedImageSamplerDescriptorCount
instance Storable SamplerYcbcrConversionImageFormatProperties where
sizeOf :: SamplerYcbcrConversionImageFormatProperties -> Int
sizeOf ~SamplerYcbcrConversionImageFormatProperties
_ = Int
24
alignment :: SamplerYcbcrConversionImageFormatProperties -> Int
alignment ~SamplerYcbcrConversionImageFormatProperties
_ = Int
8
peek :: Ptr SamplerYcbcrConversionImageFormatProperties
-> IO SamplerYcbcrConversionImageFormatProperties
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerYcbcrConversionImageFormatProperties
-> SamplerYcbcrConversionImageFormatProperties -> IO ()
poke Ptr SamplerYcbcrConversionImageFormatProperties
ptr SamplerYcbcrConversionImageFormatProperties
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerYcbcrConversionImageFormatProperties
ptr SamplerYcbcrConversionImageFormatProperties
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerYcbcrConversionImageFormatProperties where
zero :: SamplerYcbcrConversionImageFormatProperties
zero = Word32 -> SamplerYcbcrConversionImageFormatProperties
SamplerYcbcrConversionImageFormatProperties
forall a. Zero a => a
zero