{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_shader_float8 ( PhysicalDeviceShaderFloat8FeaturesEXT(..)
, EXT_SHADER_FLOAT8_SPEC_VERSION
, pattern EXT_SHADER_FLOAT8_SPEC_VERSION
, EXT_SHADER_FLOAT8_EXTENSION_NAME
, pattern EXT_SHADER_FLOAT8_EXTENSION_NAME
, ComponentTypeKHR(..)
) 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_SHADER_FLOAT8_FEATURES_EXT))
import Vulkan.Extensions.VK_NV_cooperative_vector (ComponentTypeKHR(..))
data PhysicalDeviceShaderFloat8FeaturesEXT = PhysicalDeviceShaderFloat8FeaturesEXT
{
PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
shaderFloat8 :: Bool
,
PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
shaderFloat8CooperativeMatrix :: Bool
}
deriving (Typeable, PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
(PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool)
-> (PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool)
-> Eq PhysicalDeviceShaderFloat8FeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
== :: PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
$c/= :: PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
/= :: PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShaderFloat8FeaturesEXT)
#endif
deriving instance Show PhysicalDeviceShaderFloat8FeaturesEXT
instance ToCStruct PhysicalDeviceShaderFloat8FeaturesEXT where
withCStruct :: forall b.
PhysicalDeviceShaderFloat8FeaturesEXT
-> (Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b) -> IO b
withCStruct PhysicalDeviceShaderFloat8FeaturesEXT
x Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b
f = Int -> (Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p -> Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO b -> IO b
forall b.
Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p PhysicalDeviceShaderFloat8FeaturesEXT
x (Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b
f Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p PhysicalDeviceShaderFloat8FeaturesEXT{Bool
shaderFloat8 :: PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
shaderFloat8CooperativeMatrix :: PhysicalDeviceShaderFloat8FeaturesEXT -> Bool
shaderFloat8 :: Bool
shaderFloat8CooperativeMatrix :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> 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 PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderFloat8))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderFloat8CooperativeMatrix))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> 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 PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> 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 PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> 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))
IO b
f
instance FromCStruct PhysicalDeviceShaderFloat8FeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> IO PhysicalDeviceShaderFloat8FeaturesEXT
peekCStruct Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p = do
shaderFloat8 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceShaderFloat8FeaturesEXT
p Ptr PhysicalDeviceShaderFloat8FeaturesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
shaderFloat8CooperativeMatrix <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
pure $ PhysicalDeviceShaderFloat8FeaturesEXT
(bool32ToBool shaderFloat8)
(bool32ToBool shaderFloat8CooperativeMatrix)
instance Storable PhysicalDeviceShaderFloat8FeaturesEXT where
sizeOf :: PhysicalDeviceShaderFloat8FeaturesEXT -> Int
sizeOf ~PhysicalDeviceShaderFloat8FeaturesEXT
_ = Int
24
alignment :: PhysicalDeviceShaderFloat8FeaturesEXT -> Int
alignment ~PhysicalDeviceShaderFloat8FeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> IO PhysicalDeviceShaderFloat8FeaturesEXT
peek = Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> IO PhysicalDeviceShaderFloat8FeaturesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO ()
poke Ptr PhysicalDeviceShaderFloat8FeaturesEXT
ptr PhysicalDeviceShaderFloat8FeaturesEXT
poked = Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceShaderFloat8FeaturesEXT
-> PhysicalDeviceShaderFloat8FeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderFloat8FeaturesEXT
ptr PhysicalDeviceShaderFloat8FeaturesEXT
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceShaderFloat8FeaturesEXT where
zero :: PhysicalDeviceShaderFloat8FeaturesEXT
zero = Bool -> Bool -> PhysicalDeviceShaderFloat8FeaturesEXT
PhysicalDeviceShaderFloat8FeaturesEXT
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
type EXT_SHADER_FLOAT8_SPEC_VERSION = 1
pattern EXT_SHADER_FLOAT8_SPEC_VERSION :: forall a . Integral a => a
pattern $mEXT_SHADER_FLOAT8_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_SHADER_FLOAT8_SPEC_VERSION :: forall a. Integral a => a
EXT_SHADER_FLOAT8_SPEC_VERSION = 1
type EXT_SHADER_FLOAT8_EXTENSION_NAME = "VK_EXT_shader_float8"
pattern EXT_SHADER_FLOAT8_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mEXT_SHADER_FLOAT8_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bEXT_SHADER_FLOAT8_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
EXT_SHADER_FLOAT8_EXTENSION_NAME = "VK_EXT_shader_float8"