{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_ray_query ( PhysicalDeviceRayQueryFeaturesKHR(..)
, KHR_RAY_QUERY_SPEC_VERSION
, pattern KHR_RAY_QUERY_SPEC_VERSION
, KHR_RAY_QUERY_EXTENSION_NAME
, pattern KHR_RAY_QUERY_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
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.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR))
data PhysicalDeviceRayQueryFeaturesKHR = PhysicalDeviceRayQueryFeaturesKHR
{
PhysicalDeviceRayQueryFeaturesKHR -> Bool
rayQuery :: Bool }
deriving (Typeable, PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool
(PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool)
-> (PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool)
-> Eq PhysicalDeviceRayQueryFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool
$c/= :: PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool
== :: PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool
$c== :: PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceRayQueryFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceRayQueryFeaturesKHR
instance ToCStruct PhysicalDeviceRayQueryFeaturesKHR where
withCStruct :: PhysicalDeviceRayQueryFeaturesKHR
-> (Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b) -> IO b
withCStruct x :: PhysicalDeviceRayQueryFeaturesKHR
x f :: Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b
f = Int
-> Int -> (Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceRayQueryFeaturesKHR
p -> Ptr PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRayQueryFeaturesKHR
p PhysicalDeviceRayQueryFeaturesKHR
x (Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b
f Ptr PhysicalDeviceRayQueryFeaturesKHR
p)
pokeCStruct :: Ptr PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceRayQueryFeaturesKHR
p PhysicalDeviceRayQueryFeaturesKHR{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
rayQuery))
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceRayQueryFeaturesKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceRayQueryFeaturesKHR
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceRayQueryFeaturesKHR where
peekCStruct :: Ptr PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR
peekCStruct p :: Ptr PhysicalDeviceRayQueryFeaturesKHR
p = do
Bool32
rayQuery <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceRayQueryFeaturesKHR
p Ptr PhysicalDeviceRayQueryFeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR)
-> PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceRayQueryFeaturesKHR
PhysicalDeviceRayQueryFeaturesKHR
(Bool32 -> Bool
bool32ToBool Bool32
rayQuery)
instance Storable PhysicalDeviceRayQueryFeaturesKHR where
sizeOf :: PhysicalDeviceRayQueryFeaturesKHR -> Int
sizeOf ~PhysicalDeviceRayQueryFeaturesKHR
_ = 24
alignment :: PhysicalDeviceRayQueryFeaturesKHR -> Int
alignment ~PhysicalDeviceRayQueryFeaturesKHR
_ = 8
peek :: Ptr PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR
peek = Ptr PhysicalDeviceRayQueryFeaturesKHR
-> IO PhysicalDeviceRayQueryFeaturesKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> IO ()
poke ptr :: Ptr PhysicalDeviceRayQueryFeaturesKHR
ptr poked :: PhysicalDeviceRayQueryFeaturesKHR
poked = Ptr PhysicalDeviceRayQueryFeaturesKHR
-> PhysicalDeviceRayQueryFeaturesKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRayQueryFeaturesKHR
ptr PhysicalDeviceRayQueryFeaturesKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceRayQueryFeaturesKHR where
zero :: PhysicalDeviceRayQueryFeaturesKHR
zero = Bool -> PhysicalDeviceRayQueryFeaturesKHR
PhysicalDeviceRayQueryFeaturesKHR
Bool
forall a. Zero a => a
zero
type KHR_RAY_QUERY_SPEC_VERSION = 1
pattern KHR_RAY_QUERY_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_RAY_QUERY_SPEC_VERSION :: a
$mKHR_RAY_QUERY_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_RAY_QUERY_SPEC_VERSION = 1
type KHR_RAY_QUERY_EXTENSION_NAME = "VK_KHR_ray_query"
pattern KHR_RAY_QUERY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_RAY_QUERY_EXTENSION_NAME :: a
$mKHR_RAY_QUERY_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_RAY_QUERY_EXTENSION_NAME = "VK_KHR_ray_query"