{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_format_feature_flags2 ( FormatProperties3KHR(..)
, KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION
, pattern KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION
, KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME
, pattern KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME
, FormatFeatureFlagBits2KHR(..)
, FormatFeatureFlags2KHR
, Flags64
) 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.Extensions.VK_KHR_acceleration_structure (FormatFeatureFlags2KHR)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR))
import Vulkan.Core10.FundamentalTypes (Flags64)
import Vulkan.Extensions.VK_KHR_acceleration_structure (FormatFeatureFlagBits2KHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (FormatFeatureFlags2KHR)
data FormatProperties3KHR = FormatProperties3KHR
{
FormatProperties3KHR -> FormatFeatureFlags2KHR
linearTilingFeatures :: FormatFeatureFlags2KHR
,
FormatProperties3KHR -> FormatFeatureFlags2KHR
optimalTilingFeatures :: FormatFeatureFlags2KHR
,
FormatProperties3KHR -> FormatFeatureFlags2KHR
bufferFeatures :: FormatFeatureFlags2KHR
}
deriving (Typeable, FormatProperties3KHR -> FormatProperties3KHR -> Bool
(FormatProperties3KHR -> FormatProperties3KHR -> Bool)
-> (FormatProperties3KHR -> FormatProperties3KHR -> Bool)
-> Eq FormatProperties3KHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FormatProperties3KHR -> FormatProperties3KHR -> Bool
$c/= :: FormatProperties3KHR -> FormatProperties3KHR -> Bool
== :: FormatProperties3KHR -> FormatProperties3KHR -> Bool
$c== :: FormatProperties3KHR -> FormatProperties3KHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (FormatProperties3KHR)
#endif
deriving instance Show FormatProperties3KHR
instance ToCStruct FormatProperties3KHR where
withCStruct :: FormatProperties3KHR -> (Ptr FormatProperties3KHR -> IO b) -> IO b
withCStruct FormatProperties3KHR
x Ptr FormatProperties3KHR -> IO b
f = Int -> (Ptr FormatProperties3KHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr FormatProperties3KHR -> IO b) -> IO b)
-> (Ptr FormatProperties3KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr FormatProperties3KHR
p -> Ptr FormatProperties3KHR -> FormatProperties3KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr FormatProperties3KHR
p FormatProperties3KHR
x (Ptr FormatProperties3KHR -> IO b
f Ptr FormatProperties3KHR
p)
pokeCStruct :: Ptr FormatProperties3KHR -> FormatProperties3KHR -> IO b -> IO b
pokeCStruct Ptr FormatProperties3KHR
p FormatProperties3KHR{FormatFeatureFlags2KHR
bufferFeatures :: FormatFeatureFlags2KHR
optimalTilingFeatures :: FormatFeatureFlags2KHR
linearTilingFeatures :: FormatFeatureFlags2KHR
$sel:bufferFeatures:FormatProperties3KHR :: FormatProperties3KHR -> FormatFeatureFlags2KHR
$sel:optimalTilingFeatures:FormatProperties3KHR :: FormatProperties3KHR -> FormatFeatureFlags2KHR
$sel:linearTilingFeatures:FormatProperties3KHR :: FormatProperties3KHR -> FormatFeatureFlags2KHR
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr FormatFeatureFlags2KHR -> FormatFeatureFlags2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FormatFeatureFlags2KHR)) (FormatFeatureFlags2KHR
linearTilingFeatures)
Ptr FormatFeatureFlags2KHR -> FormatFeatureFlags2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr FormatFeatureFlags2KHR)) (FormatFeatureFlags2KHR
optimalTilingFeatures)
Ptr FormatFeatureFlags2KHR -> FormatFeatureFlags2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr FormatFeatureFlags2KHR)) (FormatFeatureFlags2KHR
bufferFeatures)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr FormatProperties3KHR -> IO b -> IO b
pokeZeroCStruct Ptr FormatProperties3KHR
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct FormatProperties3KHR where
peekCStruct :: Ptr FormatProperties3KHR -> IO FormatProperties3KHR
peekCStruct Ptr FormatProperties3KHR
p = do
FormatFeatureFlags2KHR
linearTilingFeatures <- Ptr FormatFeatureFlags2KHR -> IO FormatFeatureFlags2KHR
forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags2KHR ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FormatFeatureFlags2KHR))
FormatFeatureFlags2KHR
optimalTilingFeatures <- Ptr FormatFeatureFlags2KHR -> IO FormatFeatureFlags2KHR
forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags2KHR ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr FormatFeatureFlags2KHR))
FormatFeatureFlags2KHR
bufferFeatures <- Ptr FormatFeatureFlags2KHR -> IO FormatFeatureFlags2KHR
forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags2KHR ((Ptr FormatProperties3KHR
p Ptr FormatProperties3KHR -> Int -> Ptr FormatFeatureFlags2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr FormatFeatureFlags2KHR))
FormatProperties3KHR -> IO FormatProperties3KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (FormatProperties3KHR -> IO FormatProperties3KHR)
-> FormatProperties3KHR -> IO FormatProperties3KHR
forall a b. (a -> b) -> a -> b
$ FormatFeatureFlags2KHR
-> FormatFeatureFlags2KHR
-> FormatFeatureFlags2KHR
-> FormatProperties3KHR
FormatProperties3KHR
FormatFeatureFlags2KHR
linearTilingFeatures FormatFeatureFlags2KHR
optimalTilingFeatures FormatFeatureFlags2KHR
bufferFeatures
instance Storable FormatProperties3KHR where
sizeOf :: FormatProperties3KHR -> Int
sizeOf ~FormatProperties3KHR
_ = Int
40
alignment :: FormatProperties3KHR -> Int
alignment ~FormatProperties3KHR
_ = Int
8
peek :: Ptr FormatProperties3KHR -> IO FormatProperties3KHR
peek = Ptr FormatProperties3KHR -> IO FormatProperties3KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr FormatProperties3KHR -> FormatProperties3KHR -> IO ()
poke Ptr FormatProperties3KHR
ptr FormatProperties3KHR
poked = Ptr FormatProperties3KHR -> FormatProperties3KHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr FormatProperties3KHR
ptr FormatProperties3KHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero FormatProperties3KHR where
zero :: FormatProperties3KHR
zero = FormatFeatureFlags2KHR
-> FormatFeatureFlags2KHR
-> FormatFeatureFlags2KHR
-> FormatProperties3KHR
FormatProperties3KHR
FormatFeatureFlags2KHR
forall a. Zero a => a
zero
FormatFeatureFlags2KHR
forall a. Zero a => a
zero
FormatFeatureFlags2KHR
forall a. Zero a => a
zero
type KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION = 1
pattern KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION :: a
$mKHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION = 1
type KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME = "VK_KHR_format_feature_flags2"
pattern KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME :: a
$mKHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME = "VK_KHR_format_feature_flags2"