{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_workgroup_memory_explicit_layout ( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(..)
, KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION
, pattern KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION
, KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME
, pattern KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_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_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR))
data PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR = PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
{
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
workgroupMemoryExplicitLayout :: Bool
,
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
workgroupMemoryExplicitLayoutScalarBlockLayout :: Bool
,
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
workgroupMemoryExplicitLayout8BitAccess :: Bool
,
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
workgroupMemoryExplicitLayout16BitAccess :: Bool
}
deriving (Typeable, PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
(PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool)
-> (PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool)
-> Eq PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
$c/= :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
== :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
$c== :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
instance ToCStruct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR where
withCStruct :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> (Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b)
-> IO b
withCStruct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
x Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> IO b
f = Int
-> (Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b)
-> IO b)
-> (Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p -> Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
x (Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> IO b
f Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p)
pokeCStruct :: Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR{Bool
workgroupMemoryExplicitLayout16BitAccess :: Bool
workgroupMemoryExplicitLayout8BitAccess :: Bool
workgroupMemoryExplicitLayoutScalarBlockLayout :: Bool
workgroupMemoryExplicitLayout :: Bool
$sel:workgroupMemoryExplicitLayout16BitAccess:PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
$sel:workgroupMemoryExplicitLayout8BitAccess:PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
$sel:workgroupMemoryExplicitLayoutScalarBlockLayout:PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
$sel:workgroupMemoryExplicitLayout:PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> 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 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
workgroupMemoryExplicitLayout))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
workgroupMemoryExplicitLayoutScalarBlockLayout))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
workgroupMemoryExplicitLayout8BitAccess))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
workgroupMemoryExplicitLayout16BitAccess))
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> 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 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> 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))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR where
peekCStruct :: Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
peekCStruct Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p = do
Bool32
workgroupMemoryExplicitLayout <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
workgroupMemoryExplicitLayoutScalarBlockLayout <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
workgroupMemoryExplicitLayout8BitAccess <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
Bool32
workgroupMemoryExplicitLayout16BitAccess <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
p Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32))
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR)
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
forall a b. (a -> b) -> a -> b
$ Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
(Bool32 -> Bool
bool32ToBool Bool32
workgroupMemoryExplicitLayout) (Bool32 -> Bool
bool32ToBool Bool32
workgroupMemoryExplicitLayoutScalarBlockLayout) (Bool32 -> Bool
bool32ToBool Bool32
workgroupMemoryExplicitLayout8BitAccess) (Bool32 -> Bool
bool32ToBool Bool32
workgroupMemoryExplicitLayout16BitAccess)
instance Storable PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR where
sizeOf :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Int
sizeOf ~PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
_ = Int
32
alignment :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> Int
alignment ~PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
_ = Int
8
peek :: Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
peek = Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR -> IO ()
poke Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
poked = Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
ptr PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR where
zero :: PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
zero = Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
type KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION = 1
pattern KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION :: a
$mKHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION = 1
type KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME = "VK_KHR_workgroup_memory_explicit_layout"
pattern KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME :: a
$mKHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME = "VK_KHR_workgroup_memory_explicit_layout"