{-# language CPP #-}
module Vulkan.Extensions.VK_ARM_shader_core_builtins ( PhysicalDeviceShaderCoreBuiltinsPropertiesARM(..)
, PhysicalDeviceShaderCoreBuiltinsFeaturesARM(..)
, ARM_SHADER_CORE_BUILTINS_SPEC_VERSION
, pattern ARM_SHADER_CORE_BUILTINS_SPEC_VERSION
, ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME
, pattern ARM_SHADER_CORE_BUILTINS_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.Word (Word32)
import Data.Word (Word64)
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_SHADER_CORE_BUILTINS_FEATURES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM))
data PhysicalDeviceShaderCoreBuiltinsPropertiesARM = PhysicalDeviceShaderCoreBuiltinsPropertiesARM
{
PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word64
shaderCoreMask :: Word64
,
PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word32
shaderCoreCount :: Word32
,
PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word32
shaderWarpsPerCore :: Word32
}
deriving (Typeable, PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Bool
$c/= :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Bool
== :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Bool
$c== :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShaderCoreBuiltinsPropertiesARM)
#endif
deriving instance Show PhysicalDeviceShaderCoreBuiltinsPropertiesARM
instance ToCStruct PhysicalDeviceShaderCoreBuiltinsPropertiesARM where
withCStruct :: forall b.
PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> (Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO b)
-> IO b
withCStruct PhysicalDeviceShaderCoreBuiltinsPropertiesARM
x Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p PhysicalDeviceShaderCoreBuiltinsPropertiesARM
x (Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO b
f Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p PhysicalDeviceShaderCoreBuiltinsPropertiesARM{Word32
Word64
shaderWarpsPerCore :: Word32
shaderCoreCount :: Word32
shaderCoreMask :: Word64
$sel:shaderWarpsPerCore:PhysicalDeviceShaderCoreBuiltinsPropertiesARM :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word32
$sel:shaderCoreCount:PhysicalDeviceShaderCoreBuiltinsPropertiesARM :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word32
$sel:shaderCoreMask:PhysicalDeviceShaderCoreBuiltinsPropertiesARM :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Word64
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
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 PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (Word64
shaderCoreMask)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
shaderCoreCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
shaderWarpsPerCore)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
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 PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceShaderCoreBuiltinsPropertiesARM where
peekCStruct :: Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> IO PhysicalDeviceShaderCoreBuiltinsPropertiesARM
peekCStruct Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p = do
Word64
shaderCoreMask <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word64))
Word32
shaderCoreCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Word32
shaderWarpsPerCore <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word64
-> Word32
-> Word32
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM
PhysicalDeviceShaderCoreBuiltinsPropertiesARM
Word64
shaderCoreMask Word32
shaderCoreCount Word32
shaderWarpsPerCore
instance Storable PhysicalDeviceShaderCoreBuiltinsPropertiesARM where
sizeOf :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Int
sizeOf ~PhysicalDeviceShaderCoreBuiltinsPropertiesARM
_ = Int
32
alignment :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> Int
alignment ~PhysicalDeviceShaderCoreBuiltinsPropertiesARM
_ = Int
8
peek :: Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> IO PhysicalDeviceShaderCoreBuiltinsPropertiesARM
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM -> IO ()
poke Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
ptr PhysicalDeviceShaderCoreBuiltinsPropertiesARM
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceShaderCoreBuiltinsPropertiesARM where
zero :: PhysicalDeviceShaderCoreBuiltinsPropertiesARM
zero = Word64
-> Word32
-> Word32
-> PhysicalDeviceShaderCoreBuiltinsPropertiesARM
PhysicalDeviceShaderCoreBuiltinsPropertiesARM
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PhysicalDeviceShaderCoreBuiltinsFeaturesARM = PhysicalDeviceShaderCoreBuiltinsFeaturesARM
{
PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
shaderCoreBuiltins :: Bool }
deriving (Typeable, PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
$c/= :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
== :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
$c== :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShaderCoreBuiltinsFeaturesARM)
#endif
deriving instance Show PhysicalDeviceShaderCoreBuiltinsFeaturesARM
instance ToCStruct PhysicalDeviceShaderCoreBuiltinsFeaturesARM where
withCStruct :: forall b.
PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> (Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO b)
-> IO b
withCStruct PhysicalDeviceShaderCoreBuiltinsFeaturesARM
x Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p PhysicalDeviceShaderCoreBuiltinsFeaturesARM
x (Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO b
f Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p PhysicalDeviceShaderCoreBuiltinsFeaturesARM{Bool
shaderCoreBuiltins :: Bool
$sel:shaderCoreBuiltins:PhysicalDeviceShaderCoreBuiltinsFeaturesARM :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
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 PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderCoreBuiltins))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
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 PhysicalDeviceShaderCoreBuiltinsFeaturesARM
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 PhysicalDeviceShaderCoreBuiltinsFeaturesARM where
peekCStruct :: Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> IO PhysicalDeviceShaderCoreBuiltinsFeaturesARM
peekCStruct Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
p = do
Bool32
shaderCoreBuiltins <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
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 -> PhysicalDeviceShaderCoreBuiltinsFeaturesARM
PhysicalDeviceShaderCoreBuiltinsFeaturesARM
(Bool32 -> Bool
bool32ToBool Bool32
shaderCoreBuiltins)
instance Storable PhysicalDeviceShaderCoreBuiltinsFeaturesARM where
sizeOf :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Int
sizeOf ~PhysicalDeviceShaderCoreBuiltinsFeaturesARM
_ = Int
24
alignment :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> Int
alignment ~PhysicalDeviceShaderCoreBuiltinsFeaturesARM
_ = Int
8
peek :: Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> IO PhysicalDeviceShaderCoreBuiltinsFeaturesARM
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
-> PhysicalDeviceShaderCoreBuiltinsFeaturesARM -> IO ()
poke Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
ptr PhysicalDeviceShaderCoreBuiltinsFeaturesARM
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceShaderCoreBuiltinsFeaturesARM where
zero :: PhysicalDeviceShaderCoreBuiltinsFeaturesARM
zero = Bool -> PhysicalDeviceShaderCoreBuiltinsFeaturesARM
PhysicalDeviceShaderCoreBuiltinsFeaturesARM
forall a. Zero a => a
zero
type ARM_SHADER_CORE_BUILTINS_SPEC_VERSION = 2
pattern ARM_SHADER_CORE_BUILTINS_SPEC_VERSION :: forall a . Integral a => a
pattern $bARM_SHADER_CORE_BUILTINS_SPEC_VERSION :: forall a. Integral a => a
$mARM_SHADER_CORE_BUILTINS_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
ARM_SHADER_CORE_BUILTINS_SPEC_VERSION = 2
type ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME = "VK_ARM_shader_core_builtins"
pattern ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bARM_SHADER_CORE_BUILTINS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mARM_SHADER_CORE_BUILTINS_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME = "VK_ARM_shader_core_builtins"