{-# language CPP #-}
module Vulkan.Core12.Promoted_From_VK_EXT_separate_stencil_usage ( ImageStencilUsageCreateInfo(..)
, StructureType(..)
) where
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
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 Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlags)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
data ImageStencilUsageCreateInfo = ImageStencilUsageCreateInfo
{
ImageStencilUsageCreateInfo -> ImageUsageFlags
stencilUsage :: ImageUsageFlags }
deriving (Typeable, ImageStencilUsageCreateInfo -> ImageStencilUsageCreateInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageStencilUsageCreateInfo -> ImageStencilUsageCreateInfo -> Bool
$c/= :: ImageStencilUsageCreateInfo -> ImageStencilUsageCreateInfo -> Bool
== :: ImageStencilUsageCreateInfo -> ImageStencilUsageCreateInfo -> Bool
$c== :: ImageStencilUsageCreateInfo -> ImageStencilUsageCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageStencilUsageCreateInfo)
#endif
deriving instance Show ImageStencilUsageCreateInfo
instance ToCStruct ImageStencilUsageCreateInfo where
withCStruct :: forall b.
ImageStencilUsageCreateInfo
-> (Ptr ImageStencilUsageCreateInfo -> IO b) -> IO b
withCStruct ImageStencilUsageCreateInfo
x Ptr ImageStencilUsageCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr ImageStencilUsageCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageStencilUsageCreateInfo
p ImageStencilUsageCreateInfo
x (Ptr ImageStencilUsageCreateInfo -> IO b
f Ptr ImageStencilUsageCreateInfo
p)
pokeCStruct :: forall b.
Ptr ImageStencilUsageCreateInfo
-> ImageStencilUsageCreateInfo -> IO b -> IO b
pokeCStruct Ptr ImageStencilUsageCreateInfo
p ImageStencilUsageCreateInfo{ImageUsageFlags
stencilUsage :: ImageUsageFlags
$sel:stencilUsage:ImageStencilUsageCreateInfo :: ImageStencilUsageCreateInfo -> ImageUsageFlags
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageStencilUsageCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageStencilUsageCreateInfo
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 ImageStencilUsageCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageUsageFlags)) (ImageUsageFlags
stencilUsage)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImageStencilUsageCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr ImageStencilUsageCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageStencilUsageCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageStencilUsageCreateInfo
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 ImageStencilUsageCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageUsageFlags)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageStencilUsageCreateInfo where
peekCStruct :: Ptr ImageStencilUsageCreateInfo -> IO ImageStencilUsageCreateInfo
peekCStruct Ptr ImageStencilUsageCreateInfo
p = do
ImageUsageFlags
stencilUsage <- forall a. Storable a => Ptr a -> IO a
peek @ImageUsageFlags ((Ptr ImageStencilUsageCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageUsageFlags))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageUsageFlags -> ImageStencilUsageCreateInfo
ImageStencilUsageCreateInfo
ImageUsageFlags
stencilUsage
instance Storable ImageStencilUsageCreateInfo where
sizeOf :: ImageStencilUsageCreateInfo -> Int
sizeOf ~ImageStencilUsageCreateInfo
_ = Int
24
alignment :: ImageStencilUsageCreateInfo -> Int
alignment ~ImageStencilUsageCreateInfo
_ = Int
8
peek :: Ptr ImageStencilUsageCreateInfo -> IO ImageStencilUsageCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageStencilUsageCreateInfo
-> ImageStencilUsageCreateInfo -> IO ()
poke Ptr ImageStencilUsageCreateInfo
ptr ImageStencilUsageCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageStencilUsageCreateInfo
ptr ImageStencilUsageCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageStencilUsageCreateInfo where
zero :: ImageStencilUsageCreateInfo
zero = ImageUsageFlags -> ImageStencilUsageCreateInfo
ImageStencilUsageCreateInfo
forall a. Zero a => a
zero