{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_ray_tracing ( destroyAccelerationStructureKHR
, getAccelerationStructureMemoryRequirementsKHR
, bindAccelerationStructureMemoryKHR
, cmdCopyAccelerationStructureKHR
, copyAccelerationStructureKHR
, cmdCopyAccelerationStructureToMemoryKHR
, copyAccelerationStructureToMemoryKHR
, cmdCopyMemoryToAccelerationStructureKHR
, copyMemoryToAccelerationStructureKHR
, cmdWriteAccelerationStructuresPropertiesKHR
, writeAccelerationStructuresPropertiesKHR
, cmdTraceRaysKHR
, getRayTracingShaderGroupHandlesKHR
, getRayTracingCaptureReplayShaderGroupHandlesKHR
, createRayTracingPipelinesKHR
, cmdTraceRaysIndirectKHR
, getDeviceAccelerationStructureCompatibilityKHR
, createAccelerationStructureKHR
, withAccelerationStructureKHR
, cmdBuildAccelerationStructureKHR
, cmdBuildAccelerationStructureIndirectKHR
, buildAccelerationStructureKHR
, getAccelerationStructureDeviceAddressKHR
, RayTracingShaderGroupCreateInfoKHR(..)
, RayTracingPipelineCreateInfoKHR(..)
, BindAccelerationStructureMemoryInfoKHR(..)
, WriteDescriptorSetAccelerationStructureKHR(..)
, AccelerationStructureMemoryRequirementsInfoKHR(..)
, PhysicalDeviceRayTracingFeaturesKHR(..)
, PhysicalDeviceRayTracingPropertiesKHR(..)
, StridedBufferRegionKHR(..)
, TraceRaysIndirectCommandKHR(..)
, AccelerationStructureGeometryTrianglesDataKHR(..)
, AccelerationStructureGeometryAabbsDataKHR(..)
, AccelerationStructureGeometryInstancesDataKHR(..)
, AccelerationStructureGeometryKHR(..)
, AccelerationStructureBuildGeometryInfoKHR(..)
, AccelerationStructureBuildOffsetInfoKHR(..)
, AccelerationStructureCreateGeometryTypeInfoKHR(..)
, AccelerationStructureCreateInfoKHR(..)
, AabbPositionsKHR(..)
, TransformMatrixKHR(..)
, AccelerationStructureInstanceKHR(..)
, AccelerationStructureDeviceAddressInfoKHR(..)
, AccelerationStructureVersionKHR(..)
, CopyAccelerationStructureInfoKHR(..)
, CopyAccelerationStructureToMemoryInfoKHR(..)
, CopyMemoryToAccelerationStructureInfoKHR(..)
, RayTracingPipelineInterfaceCreateInfoKHR(..)
, DeviceOrHostAddressKHR(..)
, DeviceOrHostAddressConstKHR(..)
, AccelerationStructureGeometryDataKHR(..)
, GeometryInstanceFlagBitsKHR( GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR
, GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR
, GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR
, GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR
, ..
)
, GeometryInstanceFlagsKHR
, GeometryFlagBitsKHR( GEOMETRY_OPAQUE_BIT_KHR
, GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR
, ..
)
, GeometryFlagsKHR
, BuildAccelerationStructureFlagBitsKHR( BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR
, BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR
, BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR
, BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR
, BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR
, ..
)
, BuildAccelerationStructureFlagsKHR
, CopyAccelerationStructureModeKHR( COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR
, COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR
, COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR
, COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR
, ..
)
, AccelerationStructureTypeKHR( ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR
, ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR
, ..
)
, GeometryTypeKHR( GEOMETRY_TYPE_TRIANGLES_KHR
, GEOMETRY_TYPE_AABBS_KHR
, GEOMETRY_TYPE_INSTANCES_KHR
, ..
)
, AccelerationStructureMemoryRequirementsTypeKHR( ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_KHR
, ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_KHR
, ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_KHR
, ..
)
, AccelerationStructureBuildTypeKHR( ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR
, ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR
, ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR
, ..
)
, RayTracingShaderGroupTypeKHR( RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR
, RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
, RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
, ..
)
, KHR_RAY_TRACING_SPEC_VERSION
, pattern KHR_RAY_TRACING_SPEC_VERSION
, KHR_RAY_TRACING_EXTENSION_NAME
, pattern KHR_RAY_TRACING_EXTENSION_NAME
, AccelerationStructureKHR(..)
, PipelineLibraryCreateInfoKHR(..)
, DebugReportObjectTypeEXT(..)
, SHADER_UNUSED_KHR
, pattern SHADER_UNUSED_KHR
) where
import Vulkan.CStruct.Utils (FixedArray)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Bits ((.&.))
import Data.Bits ((.|.))
import Data.Bits (shiftL)
import Data.Bits (shiftR)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import Foreign.Marshal.Utils (maybePeek)
import Foreign.Marshal.Utils (with)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import qualified Data.ByteString (length)
import Data.ByteString (packCStringLen)
import Data.ByteString.Unsafe (unsafeUseAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.Trans.Cont (runContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Foreign.C.Types (CSize(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(CFloat))
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(CSize))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Word (Word8)
import Text.Read.Lex (Lexeme(Ident))
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Extensions.Handles (AccelerationStructureKHR)
import Vulkan.Extensions.Handles (AccelerationStructureKHR(..))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (Buffer(..))
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_deferred_host_operations (DeferredOperationInfoKHR)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkBindAccelerationStructureMemoryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkBuildAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBuildAccelerationStructureIndirectKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBuildAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyAccelerationStructureToMemoryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyMemoryToAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdTraceRaysIndirectKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdTraceRaysKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdWriteAccelerationStructuresPropertiesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyAccelerationStructureToMemoryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyMemoryToAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCreateAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCreateRayTracingPipelinesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureDeviceAddressKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureMemoryRequirementsKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceAccelerationStructureCompatibilityKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetRayTracingCaptureReplayShaderGroupHandlesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetRayTracingShaderGroupHandlesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkWriteAccelerationStructuresPropertiesKHR))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.IndexType (IndexType)
import Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2 (MemoryRequirements2)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (Pipeline)
import Vulkan.Core10.Handles (Pipeline(..))
import Vulkan.Core10.Handles (PipelineCache)
import Vulkan.Core10.Handles (PipelineCache(..))
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_pipeline_creation_feedback (PipelineCreationFeedbackCreateInfoEXT)
import Vulkan.Core10.Handles (PipelineLayout)
import Vulkan.Extensions.VK_KHR_pipeline_library (PipelineLibraryCreateInfoKHR)
import Vulkan.Core10.Pipeline (PipelineShaderStageCreateInfo)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Handles (QueryPool)
import Vulkan.Core10.Handles (QueryPool(..))
import Vulkan.Core10.Enums.QueryType (QueryType)
import Vulkan.Core10.Enums.QueryType (QueryType(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.FundamentalTypes (Bool32(FALSE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_GEOMETRY_TYPE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.APIConstants (pattern UUID_SIZE)
import Vulkan.Extensions.Handles (AccelerationStructureKHR(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
import Vulkan.Extensions.VK_KHR_pipeline_library (PipelineLibraryCreateInfoKHR(..))
import Vulkan.Core10.APIConstants (SHADER_UNUSED_KHR)
import Vulkan.Core10.APIConstants (pattern SHADER_UNUSED_KHR)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyAccelerationStructureKHR
:: FunPtr (Ptr Device_T -> AccelerationStructureKHR -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> AccelerationStructureKHR -> Ptr AllocationCallbacks -> IO ()
destroyAccelerationStructureKHR :: forall io
. (MonadIO io)
=>
Device
->
AccelerationStructureKHR
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureKHR :: Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureKHR device :: Device
device accelerationStructure :: AccelerationStructureKHR
accelerationStructure allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkDestroyAccelerationStructureKHRPtr :: FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
pVkDestroyAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyAccelerationStructureKHRPtr FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkDestroyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyAccelerationStructureKHR' :: Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureKHR' = FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyAccelerationStructureKHR FunPtr
(Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyAccelerationStructureKHRPtr
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (AccelerationStructureKHR
accelerationStructure) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetAccelerationStructureMemoryRequirementsKHR
:: FunPtr (Ptr Device_T -> Ptr AccelerationStructureMemoryRequirementsInfoKHR -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr AccelerationStructureMemoryRequirementsInfoKHR -> Ptr (SomeStruct MemoryRequirements2) -> IO ()
getAccelerationStructureMemoryRequirementsKHR :: forall a io
. (Extendss MemoryRequirements2 a, PokeChain a, PeekChain a, MonadIO io)
=>
Device
->
AccelerationStructureMemoryRequirementsInfoKHR
-> io (MemoryRequirements2 a)
getAccelerationStructureMemoryRequirementsKHR :: Device
-> AccelerationStructureMemoryRequirementsInfoKHR
-> io (MemoryRequirements2 a)
getAccelerationStructureMemoryRequirementsKHR device :: Device
device info :: AccelerationStructureMemoryRequirementsInfoKHR
info = IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a))
-> (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ do
let vkGetAccelerationStructureMemoryRequirementsKHRPtr :: FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
vkGetAccelerationStructureMemoryRequirementsKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
pVkGetAccelerationStructureMemoryRequirementsKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT (MemoryRequirements2 a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
vkGetAccelerationStructureMemoryRequirementsKHRPtr FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
-> FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetAccelerationStructureMemoryRequirementsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetAccelerationStructureMemoryRequirementsKHR' :: Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetAccelerationStructureMemoryRequirementsKHR' = FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
mkVkGetAccelerationStructureMemoryRequirementsKHR FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ())
vkGetAccelerationStructureMemoryRequirementsKHRPtr
"pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR
pInfo <- ((("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR))
-> ((("pInfo"
::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureMemoryRequirementsInfoKHR
-> (("pInfo"
::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureMemoryRequirementsInfoKHR
info)
Ptr (MemoryRequirements2 a)
pPMemoryRequirements <- ((Ptr (MemoryRequirements2 a) -> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (Ptr (MemoryRequirements2 a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct (MemoryRequirements2 a) =>
(Ptr (MemoryRequirements2 a) -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(MemoryRequirements2 _))
IO () -> ContT (MemoryRequirements2 a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetAccelerationStructureMemoryRequirementsKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoKHR
pInfo (Ptr (MemoryRequirements2 a)
-> "pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (MemoryRequirements2 a)
pPMemoryRequirements))
MemoryRequirements2 a
pMemoryRequirements <- IO (MemoryRequirements2 a)
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO (MemoryRequirements2 a)
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ Ptr (MemoryRequirements2 a) -> IO (MemoryRequirements2 a)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(MemoryRequirements2 _) Ptr (MemoryRequirements2 a)
pPMemoryRequirements
MemoryRequirements2 a
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MemoryRequirements2 a
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a))
-> MemoryRequirements2 a
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ (MemoryRequirements2 a
pMemoryRequirements)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkBindAccelerationStructureMemoryKHR
:: FunPtr (Ptr Device_T -> Word32 -> Ptr BindAccelerationStructureMemoryInfoKHR -> IO Result) -> Ptr Device_T -> Word32 -> Ptr BindAccelerationStructureMemoryInfoKHR -> IO Result
bindAccelerationStructureMemoryKHR :: forall io
. (MonadIO io)
=>
Device
->
("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> io ()
bindAccelerationStructureMemoryKHR :: Device
-> ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> io ()
bindAccelerationStructureMemoryKHR device :: Device
device bindInfos :: "bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR
bindInfos = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkBindAccelerationStructureMemoryKHRPtr :: FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
vkBindAccelerationStructureMemoryKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
pVkBindAccelerationStructureMemoryKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
vkBindAccelerationStructureMemoryKHRPtr FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkBindAccelerationStructureMemoryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkBindAccelerationStructureMemoryKHR' :: Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result
vkBindAccelerationStructureMemoryKHR' = FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
-> Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result
mkVkBindAccelerationStructureMemoryKHR FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result)
vkBindAccelerationStructureMemoryKHRPtr
"pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR
pPBindInfos <- ((("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO ())
-> IO ())
-> ContT
()
IO
("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR))
-> ((("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @BindAccelerationStructureMemoryInfoKHR ((("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR
bindInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 56) 8
(Int -> BindAccelerationStructureMemoryInfoKHR -> ContT () IO ())
-> ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: BindAccelerationStructureMemoryInfoKHR
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> BindAccelerationStructureMemoryInfoKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR
pPBindInfos ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> Int
-> "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (56 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BindAccelerationStructureMemoryInfoKHR) (BindAccelerationStructureMemoryInfoKHR
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR
bindInfos)
Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR)
-> IO Result
vkBindAccelerationStructureMemoryKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> Int)
-> ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoKHR
bindInfos)) :: Word32)) ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoKHR
pPBindInfos)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyAccelerationStructureKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct CopyAccelerationStructureInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct CopyAccelerationStructureInfoKHR) -> IO ()
cmdCopyAccelerationStructureKHR :: forall a io
. (Extendss CopyAccelerationStructureInfoKHR a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(CopyAccelerationStructureInfoKHR a)
-> io ()
cmdCopyAccelerationStructureKHR :: CommandBuffer -> CopyAccelerationStructureInfoKHR a -> io ()
cmdCopyAccelerationStructureKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyAccelerationStructureInfoKHR a
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyAccelerationStructureKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
pVkCmdCopyAccelerationStructureKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdCopyAccelerationStructureKHR' :: Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ()
vkCmdCopyAccelerationStructureKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ()
mkVkCmdCopyAccelerationStructureKHR FunPtr
(Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureKHRPtr
Ptr (CopyAccelerationStructureInfoKHR a)
pInfo <- ((Ptr (CopyAccelerationStructureInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyAccelerationStructureInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureInfoKHR a)))
-> ((Ptr (CopyAccelerationStructureInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureInfoKHR a
-> (Ptr (CopyAccelerationStructureInfoKHR a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureInfoKHR a
info)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO ()
vkCmdCopyAccelerationStructureKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (Ptr (CopyAccelerationStructureInfoKHR a)
-> "pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyAccelerationStructureInfoKHR a)
pInfo)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCopyAccelerationStructureKHR
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct CopyAccelerationStructureInfoKHR) -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct CopyAccelerationStructureInfoKHR) -> IO Result
copyAccelerationStructureKHR :: forall a io
. (Extendss CopyAccelerationStructureInfoKHR a, PokeChain a, MonadIO io)
=>
Device
->
(CopyAccelerationStructureInfoKHR a)
-> io (Result)
copyAccelerationStructureKHR :: Device -> CopyAccelerationStructureInfoKHR a -> io Result
copyAccelerationStructureKHR device :: Device
device info :: CopyAccelerationStructureInfoKHR a
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
let vkCopyAccelerationStructureKHRPtr :: FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
vkCopyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
pVkCopyAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
vkCopyAccelerationStructureKHRPtr FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCopyAccelerationStructureKHR' :: Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result
vkCopyAccelerationStructureKHR' = FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
-> Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result
mkVkCopyAccelerationStructureKHR FunPtr
(Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result)
vkCopyAccelerationStructureKHRPtr
Ptr (CopyAccelerationStructureInfoKHR a)
pInfo <- ((Ptr (CopyAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr (CopyAccelerationStructureInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr (CopyAccelerationStructureInfoKHR a)))
-> ((Ptr (CopyAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr (CopyAccelerationStructureInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureInfoKHR a
-> (Ptr (CopyAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureInfoKHR a
info)
Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR))
-> IO Result
vkCopyAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Ptr (CopyAccelerationStructureInfoKHR a)
-> "pInfo" ::: Ptr (SomeStruct CopyAccelerationStructureInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyAccelerationStructureInfoKHR a)
pInfo)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyAccelerationStructureToMemoryKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR) -> IO ()
cmdCopyAccelerationStructureToMemoryKHR :: forall a io
. (Extendss CopyAccelerationStructureToMemoryInfoKHR a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(CopyAccelerationStructureToMemoryInfoKHR a)
-> io ()
cmdCopyAccelerationStructureToMemoryKHR :: CommandBuffer
-> CopyAccelerationStructureToMemoryInfoKHR a -> io ()
cmdCopyAccelerationStructureToMemoryKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyAccelerationStructureToMemoryInfoKHR a
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyAccelerationStructureToMemoryKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
pVkCmdCopyAccelerationStructureToMemoryKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyAccelerationStructureToMemoryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdCopyAccelerationStructureToMemoryKHR' :: Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ()
vkCmdCopyAccelerationStructureToMemoryKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ()
mkVkCmdCopyAccelerationStructureToMemoryKHR FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr
Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
pInfo <- ((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a)))
-> ((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureToMemoryInfoKHR a
-> (Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureToMemoryInfoKHR a
info)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO ()
vkCmdCopyAccelerationStructureToMemoryKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
-> "pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
pInfo)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCopyAccelerationStructureToMemoryKHR
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR) -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR) -> IO Result
copyAccelerationStructureToMemoryKHR :: forall a io
. (Extendss CopyAccelerationStructureToMemoryInfoKHR a, PokeChain a, MonadIO io)
=>
Device
->
(CopyAccelerationStructureToMemoryInfoKHR a)
-> io (Result)
copyAccelerationStructureToMemoryKHR :: Device -> CopyAccelerationStructureToMemoryInfoKHR a -> io Result
copyAccelerationStructureToMemoryKHR device :: Device
device info :: CopyAccelerationStructureToMemoryInfoKHR a
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
let vkCopyAccelerationStructureToMemoryKHRPtr :: FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
pVkCopyAccelerationStructureToMemoryKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyAccelerationStructureToMemoryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCopyAccelerationStructureToMemoryKHR' :: Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result
vkCopyAccelerationStructureToMemoryKHR' = FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
-> Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result
mkVkCopyAccelerationStructureToMemoryKHR FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr
Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
pInfo <- ((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a)))
-> ((Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyAccelerationStructureToMemoryInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureToMemoryInfoKHR a
-> (Ptr (CopyAccelerationStructureToMemoryInfoKHR a) -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureToMemoryInfoKHR a
info)
Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR))
-> IO Result
vkCopyAccelerationStructureToMemoryKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
-> "pInfo"
::: Ptr (SomeStruct CopyAccelerationStructureToMemoryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyAccelerationStructureToMemoryInfoKHR a)
pInfo)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyMemoryToAccelerationStructureKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR) -> IO ()
cmdCopyMemoryToAccelerationStructureKHR :: forall a io
. (Extendss CopyMemoryToAccelerationStructureInfoKHR a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(CopyMemoryToAccelerationStructureInfoKHR a)
-> io ()
cmdCopyMemoryToAccelerationStructureKHR :: CommandBuffer
-> CopyMemoryToAccelerationStructureInfoKHR a -> io ()
cmdCopyMemoryToAccelerationStructureKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyMemoryToAccelerationStructureInfoKHR a
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyMemoryToAccelerationStructureKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
pVkCmdCopyMemoryToAccelerationStructureKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyMemoryToAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdCopyMemoryToAccelerationStructureKHR' :: Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ()
vkCmdCopyMemoryToAccelerationStructureKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ()
mkVkCmdCopyMemoryToAccelerationStructureKHR FunPtr
(Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr
Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
pInfo <- ((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a)))
-> ((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyMemoryToAccelerationStructureInfoKHR a
-> (Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyMemoryToAccelerationStructureInfoKHR a
info)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO ()
vkCmdCopyMemoryToAccelerationStructureKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
-> "pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
pInfo)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCopyMemoryToAccelerationStructureKHR
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR) -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR) -> IO Result
copyMemoryToAccelerationStructureKHR :: forall a io
. (Extendss CopyMemoryToAccelerationStructureInfoKHR a, PokeChain a, MonadIO io)
=>
Device
->
(CopyMemoryToAccelerationStructureInfoKHR a)
-> io (Result)
copyMemoryToAccelerationStructureKHR :: Device -> CopyMemoryToAccelerationStructureInfoKHR a -> io Result
copyMemoryToAccelerationStructureKHR device :: Device
device info :: CopyMemoryToAccelerationStructureInfoKHR a
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
let vkCopyMemoryToAccelerationStructureKHRPtr :: FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
pVkCopyMemoryToAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyMemoryToAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCopyMemoryToAccelerationStructureKHR' :: Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result
vkCopyMemoryToAccelerationStructureKHR' = FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
-> Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result
mkVkCopyMemoryToAccelerationStructureKHR FunPtr
(Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr
Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
pInfo <- ((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a)))
-> ((Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (CopyMemoryToAccelerationStructureInfoKHR a))
forall a b. (a -> b) -> a -> b
$ CopyMemoryToAccelerationStructureInfoKHR a
-> (Ptr (CopyMemoryToAccelerationStructureInfoKHR a) -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyMemoryToAccelerationStructureInfoKHR a
info)
Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR))
-> IO Result
vkCopyMemoryToAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
-> "pInfo"
::: Ptr (SomeStruct CopyMemoryToAccelerationStructureInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (CopyMemoryToAccelerationStructureInfoKHR a)
pInfo)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdWriteAccelerationStructuresPropertiesKHR
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> QueryPool -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> QueryPool -> Word32 -> IO ()
cmdWriteAccelerationStructuresPropertiesKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("accelerationStructures" ::: Vector AccelerationStructureKHR)
->
QueryType
->
QueryPool
->
("firstQuery" ::: Word32)
-> io ()
cmdWriteAccelerationStructuresPropertiesKHR :: CommandBuffer
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> io ()
cmdWriteAccelerationStructuresPropertiesKHR commandBuffer :: CommandBuffer
commandBuffer accelerationStructures :: "accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures queryType :: QueryType
queryType queryPool :: QueryPool
queryPool firstQuery :: "bindInfoCount" ::: Word32
firstQuery = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdWriteAccelerationStructuresPropertiesKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
pVkCmdWriteAccelerationStructuresPropertiesKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdWriteAccelerationStructuresPropertiesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdWriteAccelerationStructuresPropertiesKHR' :: Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ()
mkVkCmdWriteAccelerationStructuresPropertiesKHR FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr
"pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int)
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) :: Word32)) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures) (QueryType
queryType) (QueryPool
queryPool) ("bindInfoCount" ::: Word32
firstQuery)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkWriteAccelerationStructuresPropertiesKHR
:: FunPtr (Ptr Device_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> CSize -> Ptr () -> CSize -> IO Result) -> Ptr Device_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> CSize -> Ptr () -> CSize -> IO Result
writeAccelerationStructuresPropertiesKHR :: forall io
. (MonadIO io)
=>
Device
->
("accelerationStructures" ::: Vector AccelerationStructureKHR)
->
QueryType
->
("dataSize" ::: Word64)
->
("data" ::: Ptr ())
->
("stride" ::: Word64)
-> io ()
writeAccelerationStructuresPropertiesKHR :: Device
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: Word64)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: Word64)
-> io ()
writeAccelerationStructuresPropertiesKHR device :: Device
device accelerationStructures :: "accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures queryType :: QueryType
queryType dataSize :: "dataSize" ::: Word64
dataSize data' :: "data" ::: Ptr ()
data' stride :: "dataSize" ::: Word64
stride = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkWriteAccelerationStructuresPropertiesKHRPtr :: FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
pVkWriteAccelerationStructuresPropertiesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkWriteAccelerationStructuresPropertiesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkWriteAccelerationStructuresPropertiesKHR' :: Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
vkWriteAccelerationStructuresPropertiesKHR' = FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
-> Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
mkVkWriteAccelerationStructuresPropertiesKHR FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr
"pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ())
-> ContT
() IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)
Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
vkWriteAccelerationStructuresPropertiesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int)
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) :: Word32)) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures) (QueryType
queryType) (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
dataSize)) ("data" ::: Ptr ()
data') (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
stride))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdTraceRaysKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Word32 -> Word32 -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Word32 -> Word32 -> Word32 -> IO ()
cmdTraceRaysKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
->
("missShaderBindingTable" ::: StridedBufferRegionKHR)
->
("hitShaderBindingTable" ::: StridedBufferRegionKHR)
->
("callableShaderBindingTable" ::: StridedBufferRegionKHR)
->
("width" ::: Word32)
->
("height" ::: Word32)
->
("depth" ::: Word32)
-> io ()
cmdTraceRaysKHR :: CommandBuffer
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> io ()
cmdTraceRaysKHR commandBuffer :: CommandBuffer
commandBuffer raygenShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
raygenShaderBindingTable missShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
missShaderBindingTable hitShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
hitShaderBindingTable callableShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
callableShaderBindingTable width :: "bindInfoCount" ::: Word32
width height :: "bindInfoCount" ::: Word32
height depth :: "bindInfoCount" ::: Word32
depth = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdTraceRaysKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdTraceRaysKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
pVkCmdTraceRaysKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdTraceRaysKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdTraceRaysKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdTraceRaysKHR' :: Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdTraceRaysKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ()
mkVkCmdTraceRaysKHR FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdTraceRaysKHRPtr
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pRaygenShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
raygenShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pMissShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
missShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pHitShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
hitShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pCallableShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
callableShaderBindingTable)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdTraceRaysKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pRaygenShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pMissShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pHitShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pCallableShaderBindingTable ("bindInfoCount" ::: Word32
width) ("bindInfoCount" ::: Word32
height) ("bindInfoCount" ::: Word32
depth)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetRayTracingShaderGroupHandlesKHR
:: FunPtr (Ptr Device_T -> Pipeline -> Word32 -> Word32 -> CSize -> Ptr () -> IO Result) -> Ptr Device_T -> Pipeline -> Word32 -> Word32 -> CSize -> Ptr () -> IO Result
getRayTracingShaderGroupHandlesKHR :: forall io
. (MonadIO io)
=>
Device
->
Pipeline
->
("firstGroup" ::: Word32)
->
("groupCount" ::: Word32)
->
("dataSize" ::: Word64)
->
("data" ::: Ptr ())
-> io ()
getRayTracingShaderGroupHandlesKHR :: Device
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: Word64)
-> ("data" ::: Ptr ())
-> io ()
getRayTracingShaderGroupHandlesKHR device :: Device
device pipeline :: Pipeline
pipeline firstGroup :: "bindInfoCount" ::: Word32
firstGroup groupCount :: "bindInfoCount" ::: Word32
groupCount dataSize :: "dataSize" ::: Word64
dataSize data' :: "data" ::: Ptr ()
data' = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkGetRayTracingShaderGroupHandlesKHRPtr :: FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingShaderGroupHandlesKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
pVkGetRayTracingShaderGroupHandlesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingShaderGroupHandlesKHRPtr FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetRayTracingShaderGroupHandlesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetRayTracingShaderGroupHandlesKHR' :: Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetRayTracingShaderGroupHandlesKHR' = FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
mkVkGetRayTracingShaderGroupHandlesKHR FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingShaderGroupHandlesKHRPtr
Result
r <- Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetRayTracingShaderGroupHandlesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Pipeline
pipeline) ("bindInfoCount" ::: Word32
firstGroup) ("bindInfoCount" ::: Word32
groupCount) (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
dataSize)) ("data" ::: Ptr ()
data')
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetRayTracingCaptureReplayShaderGroupHandlesKHR
:: FunPtr (Ptr Device_T -> Pipeline -> Word32 -> Word32 -> CSize -> Ptr () -> IO Result) -> Ptr Device_T -> Pipeline -> Word32 -> Word32 -> CSize -> Ptr () -> IO Result
getRayTracingCaptureReplayShaderGroupHandlesKHR :: forall io
. (MonadIO io)
=>
Device
->
Pipeline
->
("firstGroup" ::: Word32)
->
("groupCount" ::: Word32)
->
("dataSize" ::: Word64)
->
("data" ::: Ptr ())
-> io ()
getRayTracingCaptureReplayShaderGroupHandlesKHR :: Device
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: Word64)
-> ("data" ::: Ptr ())
-> io ()
getRayTracingCaptureReplayShaderGroupHandlesKHR device :: Device
device pipeline :: Pipeline
pipeline firstGroup :: "bindInfoCount" ::: Word32
firstGroup groupCount :: "bindInfoCount" ::: Word32
groupCount dataSize :: "dataSize" ::: Word64
dataSize data' :: "data" ::: Ptr ()
data' = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkGetRayTracingCaptureReplayShaderGroupHandlesKHRPtr :: FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingCaptureReplayShaderGroupHandlesKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
pVkGetRayTracingCaptureReplayShaderGroupHandlesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingCaptureReplayShaderGroupHandlesKHRPtr FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetRayTracingCaptureReplayShaderGroupHandlesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetRayTracingCaptureReplayShaderGroupHandlesKHR' :: Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetRayTracingCaptureReplayShaderGroupHandlesKHR' = FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
-> Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
mkVkGetRayTracingCaptureReplayShaderGroupHandlesKHR FunPtr
(Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result)
vkGetRayTracingCaptureReplayShaderGroupHandlesKHRPtr
Result
r <- Ptr Device_T
-> Pipeline
-> ("bindInfoCount" ::: Word32)
-> ("bindInfoCount" ::: Word32)
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetRayTracingCaptureReplayShaderGroupHandlesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Pipeline
pipeline) ("bindInfoCount" ::: Word32
firstGroup) ("bindInfoCount" ::: Word32
groupCount) (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
dataSize)) ("data" ::: Ptr ()
data')
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateRayTracingPipelinesKHR
:: FunPtr (Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct RayTracingPipelineCreateInfoKHR) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result) -> Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct RayTracingPipelineCreateInfoKHR) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result
createRayTracingPipelinesKHR :: forall io
. (MonadIO io)
=>
Device
->
PipelineCache
->
("createInfos" ::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, ("pipelines" ::: Vector Pipeline))
createRayTracingPipelinesKHR :: Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createRayTracingPipelinesKHR device :: Device
device pipelineCache :: PipelineCache
pipelineCache createInfos :: "createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ do
let vkCreateRayTracingPipelinesKHRPtr :: FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateRayTracingPipelinesKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
pVkCreateRayTracingPipelinesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateRayTracingPipelinesKHRPtr FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateRayTracingPipelinesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateRayTracingPipelinesKHR' :: Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateRayTracingPipelinesKHR' = FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
mkVkCreateRayTracingPipelinesKHR FunPtr
(Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateRayTracingPipelinesKHRPtr
Ptr (RayTracingPipelineCreateInfoKHR Any)
pPCreateInfos <- ((Ptr (RayTracingPipelineCreateInfoKHR Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (RayTracingPipelineCreateInfoKHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (RayTracingPipelineCreateInfoKHR Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (RayTracingPipelineCreateInfoKHR Any)))
-> ((Ptr (RayTracingPipelineCreateInfoKHR Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (RayTracingPipelineCreateInfoKHR Any))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr (RayTracingPipelineCreateInfoKHR Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(RayTracingPipelineCreateInfoKHR _) ((("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 120) 8
(Int
-> SomeStruct RayTracingPipelineCreateInfoKHR
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct RayTracingPipelineCreateInfoKHR
e -> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> SomeStruct RayTracingPipelineCreateInfoKHR
-> IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (RayTracingPipelineCreateInfoKHR Any)
-> "pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (RayTracingPipelineCreateInfoKHR Any)
pPCreateInfos Ptr (RayTracingPipelineCreateInfoKHR Any)
-> Int -> Ptr (RayTracingPipelineCreateInfoKHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (120 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (RayTracingPipelineCreateInfoKHR _))) (SomeStruct RayTracingPipelineCreateInfoKHR
e) (IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> (() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> () -> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ ())) ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pPipelines" ::: Ptr Pipeline
pPPipelines <- ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline))
-> ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall a b. (a -> b) -> a -> b
$ IO ("pPipelines" ::: Ptr Pipeline)
-> (("pPipelines" ::: Ptr Pipeline) -> IO ())
-> (("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPipelines" ::: Ptr Pipeline)
forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((("bindInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos)) :: Word32))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8)) ("pPipelines" ::: Ptr Pipeline) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result)
-> IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> PipelineCache
-> ("bindInfoCount" ::: Word32)
-> ("pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateRayTracingPipelinesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (PipelineCache
pipelineCache) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos)) :: Word32)) (Ptr (RayTracingPipelineCreateInfoKHR Any)
-> "pCreateInfos"
::: Ptr (SomeStruct RayTracingPipelineCreateInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (RayTracingPipelineCreateInfoKHR Any)
pPCreateInfos)) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pPipelines" ::: Ptr Pipeline
pPPipelines)
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"pipelines" ::: Vector Pipeline
pPipelines <- IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline))
-> IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ Int -> (Int -> IO Pipeline) -> IO ("pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("bindInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)
createInfos)) :: Word32))) (\i :: Int
i -> ("pPipelines" ::: Ptr Pipeline) -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines ("pPipelines" ::: Ptr Pipeline)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
(Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline))
-> (Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ (Result
r, "pipelines" ::: Vector Pipeline
pPipelines)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdTraceRaysIndirectKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Buffer -> DeviceSize -> IO ()) -> Ptr CommandBuffer_T -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Ptr StridedBufferRegionKHR -> Buffer -> DeviceSize -> IO ()
cmdTraceRaysIndirectKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
->
("missShaderBindingTable" ::: StridedBufferRegionKHR)
->
("hitShaderBindingTable" ::: StridedBufferRegionKHR)
->
("callableShaderBindingTable" ::: StridedBufferRegionKHR)
->
Buffer
->
("offset" ::: DeviceSize)
-> io ()
cmdTraceRaysIndirectKHR :: CommandBuffer
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> Buffer
-> ("dataSize" ::: Word64)
-> io ()
cmdTraceRaysIndirectKHR commandBuffer :: CommandBuffer
commandBuffer raygenShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
raygenShaderBindingTable missShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
missShaderBindingTable hitShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
hitShaderBindingTable callableShaderBindingTable :: "raygenShaderBindingTable" ::: StridedBufferRegionKHR
callableShaderBindingTable buffer :: Buffer
buffer offset :: "dataSize" ::: Word64
offset = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdTraceRaysIndirectKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
vkCmdTraceRaysIndirectKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
pVkCmdTraceRaysIndirectKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
vkCmdTraceRaysIndirectKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdTraceRaysIndirectKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdTraceRaysIndirectKHR' :: Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ()
vkCmdTraceRaysIndirectKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ()
mkVkCmdTraceRaysIndirectKHR FunPtr
(Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ())
vkCmdTraceRaysIndirectKHRPtr
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pRaygenShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
raygenShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pMissShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
missShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pHitShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
hitShaderBindingTable)
"pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pCallableShaderBindingTable <- ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)))
-> ((("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
forall a b. (a -> b) -> a -> b
$ ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
-> (("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("raygenShaderBindingTable" ::: StridedBufferRegionKHR
callableShaderBindingTable)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> ("pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> IO ()
vkCmdTraceRaysIndirectKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pRaygenShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pMissShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pHitShaderBindingTable "pRaygenShaderBindingTable"
::: Ptr ("raygenShaderBindingTable" ::: StridedBufferRegionKHR)
pCallableShaderBindingTable (Buffer
buffer) ("dataSize" ::: Word64
offset)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetDeviceAccelerationStructureCompatibilityKHR
:: FunPtr (Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result) -> Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result
getDeviceAccelerationStructureCompatibilityKHR :: forall io
. (MonadIO io)
=>
Device
->
AccelerationStructureVersionKHR
-> io ()
getDeviceAccelerationStructureCompatibilityKHR :: Device -> AccelerationStructureVersionKHR -> io ()
getDeviceAccelerationStructureCompatibilityKHR device :: Device
device version :: AccelerationStructureVersionKHR
version = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkGetDeviceAccelerationStructureCompatibilityKHRPtr :: FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
vkGetDeviceAccelerationStructureCompatibilityKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
pVkGetDeviceAccelerationStructureCompatibilityKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
vkGetDeviceAccelerationStructureCompatibilityKHRPtr FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
-> FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetDeviceAccelerationStructureCompatibilityKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetDeviceAccelerationStructureCompatibilityKHR' :: Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result
vkGetDeviceAccelerationStructureCompatibilityKHR' = FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
-> Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result
mkVkGetDeviceAccelerationStructureCompatibilityKHR FunPtr
(Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result)
vkGetDeviceAccelerationStructureCompatibilityKHRPtr
Ptr AccelerationStructureVersionKHR
version' <- ((Ptr AccelerationStructureVersionKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureVersionKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureVersionKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureVersionKHR))
-> ((Ptr AccelerationStructureVersionKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureVersionKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureVersionKHR
-> (Ptr AccelerationStructureVersionKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureVersionKHR
version)
Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T -> Ptr AccelerationStructureVersionKHR -> IO Result
vkGetDeviceAccelerationStructureCompatibilityKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) Ptr AccelerationStructureVersionKHR
version'
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateAccelerationStructureKHR
:: FunPtr (Ptr Device_T -> Ptr AccelerationStructureCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr AccelerationStructureKHR -> IO Result) -> Ptr Device_T -> Ptr AccelerationStructureCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr AccelerationStructureKHR -> IO Result
createAccelerationStructureKHR :: forall io
. (MonadIO io)
=>
Device
->
AccelerationStructureCreateInfoKHR
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (AccelerationStructureKHR)
createAccelerationStructureKHR :: Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
createAccelerationStructureKHR device :: Device
device createInfo :: AccelerationStructureCreateInfoKHR
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO AccelerationStructureKHR -> io AccelerationStructureKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AccelerationStructureKHR -> io AccelerationStructureKHR)
-> (ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> IO AccelerationStructureKHR)
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> io AccelerationStructureKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> IO AccelerationStructureKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> io AccelerationStructureKHR)
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> io AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ do
let vkCreateAccelerationStructureKHRPtr :: FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
vkCreateAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
pVkCreateAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT AccelerationStructureKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureKHR IO ())
-> IO () -> ContT AccelerationStructureKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
vkCreateAccelerationStructureKHRPtr FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateAccelerationStructureKHR' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
vkCreateAccelerationStructureKHR' = FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
mkVkCreateAccelerationStructureKHR FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result)
vkCreateAccelerationStructureKHRPtr
"pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
pCreateInfo <- ((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR))
-> ((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureCreateInfoKHR
-> (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureCreateInfoKHR
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
AccelerationStructureKHR
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> ContT
AccelerationStructureKHR
IO
("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ())
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a. Int -> IO (Ptr a)
callocBytes @AccelerationStructureKHR 8) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT AccelerationStructureKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT AccelerationStructureKHR IO Result)
-> IO Result -> ContT AccelerationStructureKHR IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
vkCreateAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure)
IO () -> ContT AccelerationStructureKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureKHR IO ())
-> IO () -> ContT AccelerationStructureKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
AccelerationStructureKHR
pAccelerationStructure <- IO AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureKHR "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure
AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR)
-> AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ (AccelerationStructureKHR
pAccelerationStructure)
withAccelerationStructureKHR :: forall io r . MonadIO io => Device -> AccelerationStructureCreateInfoKHR -> Maybe AllocationCallbacks -> (io (AccelerationStructureKHR) -> ((AccelerationStructureKHR) -> io ()) -> r) -> r
withAccelerationStructureKHR :: Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io AccelerationStructureKHR
-> (AccelerationStructureKHR -> io ()) -> r)
-> r
withAccelerationStructureKHR device :: Device
device pCreateInfo :: AccelerationStructureCreateInfoKHR
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io AccelerationStructureKHR
-> (AccelerationStructureKHR -> io ()) -> r
b =
io AccelerationStructureKHR
-> (AccelerationStructureKHR -> io ()) -> r
b (Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
createAccelerationStructureKHR Device
device AccelerationStructureCreateInfoKHR
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(AccelerationStructureKHR
o0) -> Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureKHR Device
device AccelerationStructureKHR
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBuildAccelerationStructureKHR
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR) -> IO ()
cmdBuildAccelerationStructureKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("infos" ::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
->
("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> io ()
cmdBuildAccelerationStructureKHR :: CommandBuffer
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> io ()
cmdBuildAccelerationStructureKHR commandBuffer :: CommandBuffer
commandBuffer infos :: "infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos offsetInfos :: "offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdBuildAccelerationStructureKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
vkCmdBuildAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
pVkCmdBuildAccelerationStructureKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
vkCmdBuildAccelerationStructureKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBuildAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBuildAccelerationStructureKHR' :: Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ()
vkCmdBuildAccelerationStructureKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ()
mkVkCmdBuildAccelerationStructureKHR FunPtr
(Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
vkCmdBuildAccelerationStructureKHRPtr
let pInfosLength :: Int
pInfosLength = ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int)
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int)
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "ppOffsetInfos and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos <- ((Ptr (AccelerationStructureBuildGeometryInfoKHR Any) -> IO ())
-> IO ())
-> ContT
() IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (AccelerationStructureBuildGeometryInfoKHR Any) -> IO ())
-> IO ())
-> ContT
() IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)))
-> ((Ptr (AccelerationStructureBuildGeometryInfoKHR Any) -> IO ())
-> IO ())
-> ContT
() IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr (AccelerationStructureBuildGeometryInfoKHR Any) -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(AccelerationStructureBuildGeometryInfoKHR _) ((("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
(Int
-> SomeStruct AccelerationStructureBuildGeometryInfoKHR
-> ContT () IO ())
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct AccelerationStructureBuildGeometryInfoKHR
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> SomeStruct AccelerationStructureBuildGeometryInfoKHR
-> IO ()
-> IO ()
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> "pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> Int -> Ptr (AccelerationStructureBuildGeometryInfoKHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AccelerationStructureBuildGeometryInfoKHR _))) (SomeStruct AccelerationStructureBuildGeometryInfoKHR
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)
"ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos <- ((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)))
-> ((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> IO ())
-> ContT
()
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(Ptr AccelerationStructureBuildOffsetInfoKHR) ((("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
(Int -> AccelerationStructureBuildOffsetInfoKHR -> ContT () IO ())
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureBuildOffsetInfoKHR
e -> do
Ptr AccelerationStructureBuildOffsetInfoKHR
ppOffsetInfos <- ((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> ((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ())
-> IO ())
-> ContT () IO (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureBuildOffsetInfoKHR
-> (Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureBuildOffsetInfoKHR
e)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> Int
-> "ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)) Ptr AccelerationStructureBuildOffsetInfoKHR
ppOffsetInfos) ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO ()
vkCmdBuildAccelerationStructureKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pInfosLength :: Word32)) (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> "pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos)) ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBuildAccelerationStructureIndirectKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Buffer -> DeviceSize -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Buffer -> DeviceSize -> Word32 -> IO ()
cmdBuildAccelerationStructureIndirectKHR :: forall a io
. (Extendss AccelerationStructureBuildGeometryInfoKHR a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(AccelerationStructureBuildGeometryInfoKHR a)
->
("indirectBuffer" ::: Buffer)
->
("indirectOffset" ::: DeviceSize)
->
("indirectStride" ::: Word32)
-> io ()
cmdBuildAccelerationStructureIndirectKHR :: CommandBuffer
-> AccelerationStructureBuildGeometryInfoKHR a
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> io ()
cmdBuildAccelerationStructureIndirectKHR commandBuffer :: CommandBuffer
commandBuffer info :: AccelerationStructureBuildGeometryInfoKHR a
info indirectBuffer :: Buffer
indirectBuffer indirectOffset :: "dataSize" ::: Word64
indirectOffset indirectStride :: "bindInfoCount" ::: Word32
indirectStride = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdBuildAccelerationStructureIndirectKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdBuildAccelerationStructureIndirectKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
pVkCmdBuildAccelerationStructureIndirectKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdBuildAccelerationStructureIndirectKHRPtr FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBuildAccelerationStructureIndirectKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBuildAccelerationStructureIndirectKHR' :: Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdBuildAccelerationStructureIndirectKHR' = FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ()
mkVkCmdBuildAccelerationStructureIndirectKHR FunPtr
(Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ())
vkCmdBuildAccelerationStructureIndirectKHRPtr
Ptr (AccelerationStructureBuildGeometryInfoKHR a)
pInfo <- ((Ptr (AccelerationStructureBuildGeometryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (AccelerationStructureBuildGeometryInfoKHR a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (AccelerationStructureBuildGeometryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (AccelerationStructureBuildGeometryInfoKHR a)))
-> ((Ptr (AccelerationStructureBuildGeometryInfoKHR a) -> IO ())
-> IO ())
-> ContT () IO (Ptr (AccelerationStructureBuildGeometryInfoKHR a))
forall a b. (a -> b) -> a -> b
$ AccelerationStructureBuildGeometryInfoKHR a
-> (Ptr (AccelerationStructureBuildGeometryInfoKHR a) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureBuildGeometryInfoKHR a
info)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Buffer
-> ("dataSize" ::: Word64)
-> ("bindInfoCount" ::: Word32)
-> IO ()
vkCmdBuildAccelerationStructureIndirectKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (Ptr (AccelerationStructureBuildGeometryInfoKHR a)
-> "pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (AccelerationStructureBuildGeometryInfoKHR a)
pInfo) (Buffer
indirectBuffer) ("dataSize" ::: Word64
indirectOffset) ("bindInfoCount" ::: Word32
indirectStride)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkBuildAccelerationStructureKHR
:: FunPtr (Ptr Device_T -> Word32 -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR) -> IO Result) -> Ptr Device_T -> Word32 -> Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR) -> Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR) -> IO Result
buildAccelerationStructureKHR :: forall io
. (MonadIO io)
=>
Device
->
("infos" ::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
->
("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> io (Result)
buildAccelerationStructureKHR :: Device
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> io Result
buildAccelerationStructureKHR device :: Device
device infos :: "infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos offsetInfos :: "offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
let vkBuildAccelerationStructureKHRPtr :: FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
vkBuildAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
pVkBuildAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
vkBuildAccelerationStructureKHRPtr FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkBuildAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkBuildAccelerationStructureKHR' :: Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result
vkBuildAccelerationStructureKHR' = FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result
mkVkBuildAccelerationStructureKHR FunPtr
(Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
vkBuildAccelerationStructureKHRPtr
let pInfosLength :: Int
pInfosLength = ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int)
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int)
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "ppOffsetInfos and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos <- ((Ptr (AccelerationStructureBuildGeometryInfoKHR Any) -> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)))
-> ((Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> IO Result)
-> IO Result)
-> ContT
Result IO (Ptr (AccelerationStructureBuildGeometryInfoKHR Any))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> IO Result)
-> IO Result
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(AccelerationStructureBuildGeometryInfoKHR _) ((("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
(Int
-> SomeStruct AccelerationStructureBuildGeometryInfoKHR
-> ContT Result IO ())
-> ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ContT Result IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct AccelerationStructureBuildGeometryInfoKHR
e -> ((() -> IO Result) -> IO Result) -> ContT Result IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO Result) -> IO Result) -> ContT Result IO ())
-> ((() -> IO Result) -> IO Result) -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> SomeStruct AccelerationStructureBuildGeometryInfoKHR
-> IO Result
-> IO Result
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> "pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> Int -> Ptr (AccelerationStructureBuildGeometryInfoKHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AccelerationStructureBuildGeometryInfoKHR _))) (SomeStruct AccelerationStructureBuildGeometryInfoKHR
e) (IO Result -> IO Result)
-> ((() -> IO Result) -> IO Result)
-> (() -> IO Result)
-> IO Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO Result) -> () -> IO Result
forall a b. (a -> b) -> a -> b
$ ())) ("infos"
::: Vector (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
infos)
"ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos <- ((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> IO Result)
-> ContT
Result
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> IO Result)
-> ContT
Result
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)))
-> ((("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> IO Result)
-> ContT
Result
IO
("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result)
-> IO Result
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(Ptr AccelerationStructureBuildOffsetInfoKHR) ((("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
(Int
-> AccelerationStructureBuildOffsetInfoKHR -> ContT Result IO ())
-> ("offsetInfos"
::: Vector AccelerationStructureBuildOffsetInfoKHR)
-> ContT Result IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureBuildOffsetInfoKHR
e -> do
Ptr AccelerationStructureBuildOffsetInfoKHR
ppOffsetInfos <- ((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> ((Ptr AccelerationStructureBuildOffsetInfoKHR -> IO Result)
-> IO Result)
-> ContT Result IO (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureBuildOffsetInfoKHR
-> (Ptr AccelerationStructureBuildOffsetInfoKHR -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureBuildOffsetInfoKHR
e)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> Ptr AccelerationStructureBuildOffsetInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> Int
-> "ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)) Ptr AccelerationStructureBuildOffsetInfoKHR
ppOffsetInfos) ("offsetInfos" ::: Vector AccelerationStructureBuildOffsetInfoKHR
offsetInfos)
Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("bindInfoCount" ::: Word32)
-> ("pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR))
-> ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR))
-> IO Result
vkBuildAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) ((Int -> "bindInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pInfosLength :: Word32)) (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
-> "pInfos"
::: Ptr (SomeStruct AccelerationStructureBuildGeometryInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AccelerationStructureBuildGeometryInfoKHR Any)
pPInfos)) ("ppOffsetInfos"
::: Ptr (Ptr AccelerationStructureBuildOffsetInfoKHR)
pPpOffsetInfos)
IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetAccelerationStructureDeviceAddressKHR
:: FunPtr (Ptr Device_T -> Ptr