{-# language CPP #-}
module Vulkan.Extensions.VK_ARM_format_pack ( PhysicalDeviceFormatPackFeaturesARM(..)
, ARM_FORMAT_PACK_SPEC_VERSION
, pattern ARM_FORMAT_PACK_SPEC_VERSION
, ARM_FORMAT_PACK_EXTENSION_NAME
, pattern ARM_FORMAT_PACK_EXTENSION_NAME
) 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.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FORMAT_PACK_FEATURES_ARM))
data PhysicalDeviceFormatPackFeaturesARM = PhysicalDeviceFormatPackFeaturesARM
{
PhysicalDeviceFormatPackFeaturesARM -> Bool
formatPack :: Bool }
deriving (Typeable, PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool
(PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool)
-> (PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool)
-> Eq PhysicalDeviceFormatPackFeaturesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool
== :: PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool
$c/= :: PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool
/= :: PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFormatPackFeaturesARM)
#endif
deriving instance Show PhysicalDeviceFormatPackFeaturesARM
instance ToCStruct PhysicalDeviceFormatPackFeaturesARM where
withCStruct :: forall b.
PhysicalDeviceFormatPackFeaturesARM
-> (Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b) -> IO b
withCStruct PhysicalDeviceFormatPackFeaturesARM
x Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b
f = Int -> (Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b) -> IO b)
-> (Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceFormatPackFeaturesARM
p -> Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO b -> IO b
forall b.
Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFormatPackFeaturesARM
p PhysicalDeviceFormatPackFeaturesARM
x (Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b
f Ptr PhysicalDeviceFormatPackFeaturesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFormatPackFeaturesARM
p PhysicalDeviceFormatPackFeaturesARM{Bool
formatPack :: PhysicalDeviceFormatPackFeaturesARM -> Bool
formatPack :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FORMAT_PACK_FEATURES_ARM)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
formatPack))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceFormatPackFeaturesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceFormatPackFeaturesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FORMAT_PACK_FEATURES_ARM)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceFormatPackFeaturesARM where
peekCStruct :: Ptr PhysicalDeviceFormatPackFeaturesARM
-> IO PhysicalDeviceFormatPackFeaturesARM
peekCStruct Ptr PhysicalDeviceFormatPackFeaturesARM
p = do
formatPack <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFormatPackFeaturesARM
p Ptr PhysicalDeviceFormatPackFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
pure $ PhysicalDeviceFormatPackFeaturesARM
(bool32ToBool formatPack)
instance Storable PhysicalDeviceFormatPackFeaturesARM where
sizeOf :: PhysicalDeviceFormatPackFeaturesARM -> Int
sizeOf ~PhysicalDeviceFormatPackFeaturesARM
_ = Int
24
alignment :: PhysicalDeviceFormatPackFeaturesARM -> Int
alignment ~PhysicalDeviceFormatPackFeaturesARM
_ = Int
8
peek :: Ptr PhysicalDeviceFormatPackFeaturesARM
-> IO PhysicalDeviceFormatPackFeaturesARM
peek = Ptr PhysicalDeviceFormatPackFeaturesARM
-> IO PhysicalDeviceFormatPackFeaturesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO ()
poke Ptr PhysicalDeviceFormatPackFeaturesARM
ptr PhysicalDeviceFormatPackFeaturesARM
poked = Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceFormatPackFeaturesARM
-> PhysicalDeviceFormatPackFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFormatPackFeaturesARM
ptr PhysicalDeviceFormatPackFeaturesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceFormatPackFeaturesARM where
zero :: PhysicalDeviceFormatPackFeaturesARM
zero = Bool -> PhysicalDeviceFormatPackFeaturesARM
PhysicalDeviceFormatPackFeaturesARM
Bool
forall a. Zero a => a
zero
type ARM_FORMAT_PACK_SPEC_VERSION = 1
pattern ARM_FORMAT_PACK_SPEC_VERSION :: forall a . Integral a => a
pattern $mARM_FORMAT_PACK_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bARM_FORMAT_PACK_SPEC_VERSION :: forall a. Integral a => a
ARM_FORMAT_PACK_SPEC_VERSION = 1
type ARM_FORMAT_PACK_EXTENSION_NAME = "VK_ARM_format_pack"
pattern ARM_FORMAT_PACK_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mARM_FORMAT_PACK_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bARM_FORMAT_PACK_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
ARM_FORMAT_PACK_EXTENSION_NAME = "VK_ARM_format_pack"