{-# language CPP #-}
-- | = Name
--
-- VK_NV_ray_tracing - device extension
--
-- == VK_NV_ray_tracing
--
-- [__Name String__]
--     @VK_NV_ray_tracing@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     166
--
-- [__Revision__]
--     3
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_memory_requirements2 VK_KHR_get_memory_requirements2>
--
-- [__Contact__]
--
--     -   Eric Werness
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NV_ray_tracing] @ewerness-nv%0A*Here describe the issue or question you have about the VK_NV_ray_tracing extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2018-11-20
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/NV/SPV_NV_ray_tracing.html SPV_NV_ray_tracing>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GLSL_NV_ray_tracing.txt GL_NV_ray_tracing>
--
-- [__Contributors__]
--
--     -   Eric Werness, NVIDIA
--
--     -   Ashwin Lele, NVIDIA
--
--     -   Robert Stepinski, NVIDIA
--
--     -   Nuno Subtil, NVIDIA
--
--     -   Christoph Kubisch, NVIDIA
--
--     -   Martin Stich, NVIDIA
--
--     -   Daniel Koch, NVIDIA
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Joshua Barczak, Intel
--
--     -   Tobias Hector, AMD
--
--     -   Henrik Rydgard, NVIDIA
--
--     -   Pascal Gautron, NVIDIA
--
-- == Description
--
-- Rasterization has been the dominant method to produce interactive
-- graphics, but increasing performance of graphics hardware has made ray
-- tracing a viable option for interactive rendering. Being able to
-- integrate ray tracing with traditional rasterization makes it easier for
-- applications to incrementally add ray traced effects to existing
-- applications or to do hybrid approaches with rasterization for primary
-- visibility and ray tracing for secondary queries.
--
-- To enable ray tracing, this extension adds a few different categories of
-- new functionality:
--
-- -   Acceleration structure objects and build commands
--
-- -   A new pipeline type with new shader domains
--
-- -   An indirection table to link shader groups with acceleration
--     structure items
--
-- This extension adds support for the following SPIR-V extension in
-- Vulkan:
--
-- -   @SPV_NV_ray_tracing@
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.AccelerationStructureNV'
--
-- == New Commands
--
-- -   'bindAccelerationStructureMemoryNV'
--
-- -   'cmdBuildAccelerationStructureNV'
--
-- -   'cmdCopyAccelerationStructureNV'
--
-- -   'cmdTraceRaysNV'
--
-- -   'cmdWriteAccelerationStructuresPropertiesNV'
--
-- -   'compileDeferredNV'
--
-- -   'createAccelerationStructureNV'
--
-- -   'createRayTracingPipelinesNV'
--
-- -   'destroyAccelerationStructureNV'
--
-- -   'getAccelerationStructureHandleNV'
--
-- -   'getAccelerationStructureMemoryRequirementsNV'
--
-- -   'getRayTracingShaderGroupHandlesNV'
--
-- == New Structures
--
-- -   'AabbPositionsNV'
--
-- -   'AccelerationStructureCreateInfoNV'
--
-- -   'AccelerationStructureInfoNV'
--
-- -   'AccelerationStructureInstanceNV'
--
-- -   'AccelerationStructureMemoryRequirementsInfoNV'
--
-- -   'BindAccelerationStructureMemoryInfoNV'
--
-- -   'GeometryAABBNV'
--
-- -   'GeometryDataNV'
--
-- -   'GeometryNV'
--
-- -   'GeometryTrianglesNV'
--
-- -   'RayTracingPipelineCreateInfoNV'
--
-- -   'RayTracingShaderGroupCreateInfoNV'
--
-- -   'TransformMatrixNV'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceRayTracingPropertiesNV'
--
-- -   Extending 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet':
--
--     -   'WriteDescriptorSetAccelerationStructureNV'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_memory_requirements2 VK_KHR_get_memory_requirements2>
-- is supported:
--
-- -   'Vulkan.Extensions.VK_KHR_get_memory_requirements2.MemoryRequirements2KHR'
--
-- == New Enums
--
-- -   'AccelerationStructureMemoryRequirementsTypeNV'
--
-- -   'AccelerationStructureTypeNV'
--
-- -   'BuildAccelerationStructureFlagBitsNV'
--
-- -   'CopyAccelerationStructureModeNV'
--
-- -   'GeometryFlagBitsNV'
--
-- -   'GeometryInstanceFlagBitsNV'
--
-- -   'GeometryTypeNV'
--
-- -   'RayTracingShaderGroupTypeNV'
--
-- == New Bitmasks
--
-- -   'BuildAccelerationStructureFlagsNV'
--
-- -   'GeometryFlagsNV'
--
-- -   'GeometryInstanceFlagsNV'
--
-- == New Enum Constants
--
-- -   'NV_RAY_TRACING_EXTENSION_NAME'
--
-- -   'NV_RAY_TRACING_SPEC_VERSION'
--
-- -   'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureTypeKHR':
--
--     -   'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV'
--
--     -   'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits':
--
--     -   'ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV'
--
--     -   'ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BufferUsageFlagBits':
--
--     -   'BUFFER_USAGE_RAY_TRACING_BIT_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.BuildAccelerationStructureFlagBitsKHR':
--
--     -   'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV'
--
--     -   'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV'
--
--     -   'BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV'
--
--     -   'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV'
--
--     -   'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureModeKHR':
--
--     -   'COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV'
--
--     -   'COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.DescriptorType.DescriptorType':
--
--     -   'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryFlagBitsKHR':
--
--     -   'GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV'
--
--     -   'GEOMETRY_OPAQUE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryInstanceFlagBitsKHR':
--
--     -   'GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV'
--
--     -   'GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV'
--
--     -   'GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV'
--
--     -   'GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryTypeKHR':
--
--     -   'GEOMETRY_TYPE_AABBS_NV'
--
--     -   'GEOMETRY_TYPE_TRIANGLES_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.IndexType.IndexType':
--
--     -   'INDEX_TYPE_NONE_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_ACCELERATION_STRUCTURE_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint':
--
--     -   'PIPELINE_BIND_POINT_RAY_TRACING_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PipelineCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DEFER_COMPILE_BIT_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits':
--
--     -   'PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV'
--
--     -   'PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.QueryType.QueryType':
--
--     -   'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingShaderGroupTypeKHR':
--
--     -   'RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV'
--
--     -   'RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV'
--
--     -   'RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits':
--
--     -   'SHADER_STAGE_ANY_HIT_BIT_NV'
--
--     -   'SHADER_STAGE_CALLABLE_BIT_NV'
--
--     -   'SHADER_STAGE_CLOSEST_HIT_BIT_NV'
--
--     -   'SHADER_STAGE_INTERSECTION_BIT_NV'
--
--     -   'SHADER_STAGE_MISS_BIT_NV'
--
--     -   'SHADER_STAGE_RAYGEN_BIT_NV'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GEOMETRY_AABB_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GEOMETRY_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_debug_report VK_EXT_debug_report>
-- is supported:
--
-- -   Extending
--     'Vulkan.Extensions.VK_EXT_debug_report.DebugReportObjectTypeEXT':
--
--     -   'Vulkan.Extensions.VK_EXT_debug_report.DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT'
--
-- == New or Modified Built-In Variables
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-launchid LaunchIdNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-launchsize LaunchSizeNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-worldrayorigin WorldRayOriginNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-worldraydirection WorldRayDirectionNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-objectrayorigin ObjectRayOriginNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-objectraydirection ObjectRayDirectionNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-raytmin RayTminNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-raytmax RayTmaxNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-instancecustomindex InstanceCustomIndexNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-instanceid InstanceId>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-objecttoworld ObjectToWorldNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-worldtoobject WorldToObjectNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-hitt HitTNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-hitkind HitKindNV>
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables-incomingrayflags IncomingRayFlagsNV>
--
-- -   (modified)@PrimitiveId@
--
-- == New SPIR-V Capabilities
--
-- -   <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-capabilities-table-RayTracingNV RayTracingNV>
--
-- == Issues
--
-- 1) Are there issues?
--
-- __RESOLVED__: Yes.
--
-- == Sample Code
--
-- Example ray generation GLSL shader
--
-- > #version 450 core
-- > #extension GL_NV_ray_tracing : require
-- > layout(set = 0, binding = 0, rgba8) uniform image2D image;
-- > layout(set = 0, binding = 1) uniform accelerationStructureNV as;
-- > layout(location = 0) rayPayloadNV float payload;
-- >
-- > void main()
-- > {
-- >    vec4 col = vec4(0, 0, 0, 1);
-- >
-- >    vec3 origin = vec3(float(gl_LaunchIDNV.x)/float(gl_LaunchSizeNV.x), float(gl_LaunchIDNV.y)/float(gl_LaunchSizeNV.y), 1.0);
-- >    vec3 dir = vec3(0.0, 0.0, -1.0);
-- >
-- >    traceNV(as, 0, 0xff, 0, 1, 0, origin, 0.0, dir, 1000.0, 0);
-- >
-- >    col.y = payload;
-- >
-- >    imageStore(image, ivec2(gl_LaunchIDNV.xy), col);
-- > }
--
-- == Version History
--
-- -   Revision 1, 2018-09-11 (Robert Stepinski, Nuno Subtil, Eric Werness)
--
--     -   Internal revisions
--
-- -   Revision 2, 2018-10-19 (Eric Werness)
--
--     -   rename to VK_NV_ray_tracing, add support for callables.
--
--     -   too many updates to list
--
-- -   Revision 3, 2018-11-20 (Daniel Koch)
--
--     -   update to use InstanceId instead of InstanceIndex as
--         implemented.
--
-- == See Also
--
-- 'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV', 'AabbPositionsNV',
-- 'AccelerationStructureCreateInfoNV', 'AccelerationStructureInfoNV',
-- 'AccelerationStructureInstanceNV',
-- 'AccelerationStructureMemoryRequirementsInfoNV',
-- 'AccelerationStructureMemoryRequirementsTypeNV',
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'AccelerationStructureTypeNV', 'BindAccelerationStructureMemoryInfoNV',
-- 'BuildAccelerationStructureFlagBitsNV',
-- 'BuildAccelerationStructureFlagsNV', 'CopyAccelerationStructureModeNV',
-- 'GeometryAABBNV', 'GeometryDataNV', 'GeometryFlagBitsNV',
-- 'GeometryFlagsNV', 'GeometryInstanceFlagBitsNV',
-- 'GeometryInstanceFlagsNV', 'GeometryNV', 'GeometryTrianglesNV',
-- 'GeometryTypeNV', 'PhysicalDeviceRayTracingPropertiesNV',
-- 'RayTracingPipelineCreateInfoNV', 'RayTracingShaderGroupCreateInfoNV',
-- 'RayTracingShaderGroupTypeNV', 'TransformMatrixNV',
-- 'WriteDescriptorSetAccelerationStructureNV',
-- 'bindAccelerationStructureMemoryNV', 'cmdBuildAccelerationStructureNV',
-- 'cmdCopyAccelerationStructureNV', 'cmdTraceRaysNV',
-- 'cmdWriteAccelerationStructuresPropertiesNV', 'compileDeferredNV',
-- 'createAccelerationStructureNV', 'createRayTracingPipelinesNV',
-- 'destroyAccelerationStructureNV', 'getAccelerationStructureHandleNV',
-- 'getAccelerationStructureMemoryRequirementsNV',
-- 'getRayTracingShaderGroupHandlesNV'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_NV_ray_tracing Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_NV_ray_tracing  ( compileDeferredNV
                                            , createAccelerationStructureNV
                                            , withAccelerationStructureNV
                                            , destroyAccelerationStructureNV
                                            , getAccelerationStructureMemoryRequirementsNV
                                            , bindAccelerationStructureMemoryNV
                                            , cmdCopyAccelerationStructureNV
                                            , cmdWriteAccelerationStructuresPropertiesNV
                                            , cmdBuildAccelerationStructureNV
                                            , cmdTraceRaysNV
                                            , getAccelerationStructureHandleNV
                                            , createRayTracingPipelinesNV
                                            , withRayTracingPipelinesNV
                                            , pattern SHADER_STAGE_RAYGEN_BIT_NV
                                            , pattern SHADER_STAGE_ANY_HIT_BIT_NV
                                            , pattern SHADER_STAGE_CLOSEST_HIT_BIT_NV
                                            , pattern SHADER_STAGE_MISS_BIT_NV
                                            , pattern SHADER_STAGE_INTERSECTION_BIT_NV
                                            , pattern SHADER_STAGE_CALLABLE_BIT_NV
                                            , pattern PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV
                                            , pattern PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV
                                            , pattern BUFFER_USAGE_RAY_TRACING_BIT_NV
                                            , pattern PIPELINE_BIND_POINT_RAY_TRACING_NV
                                            , pattern ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV
                                            , pattern ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV
                                            , pattern INDEX_TYPE_NONE_NV
                                            , pattern RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV
                                            , pattern RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV
                                            , pattern RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV
                                            , pattern GEOMETRY_TYPE_TRIANGLES_NV
                                            , pattern GEOMETRY_TYPE_AABBS_NV
                                            , pattern ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV
                                            , pattern ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV
                                            , pattern GEOMETRY_OPAQUE_BIT_NV
                                            , pattern GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV
                                            , pattern GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV
                                            , pattern GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV
                                            , pattern GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV
                                            , pattern GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV
                                            , pattern BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV
                                            , pattern BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV
                                            , pattern BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV
                                            , pattern BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV
                                            , pattern BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV
                                            , pattern COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV
                                            , pattern COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV
                                            , pattern SHADER_UNUSED_NV
                                            , getRayTracingShaderGroupHandlesNV
                                            , RayTracingShaderGroupCreateInfoNV(..)
                                            , RayTracingPipelineCreateInfoNV(..)
                                            , GeometryTrianglesNV(..)
                                            , GeometryAABBNV(..)
                                            , GeometryDataNV(..)
                                            , GeometryNV(..)
                                            , AccelerationStructureInfoNV(..)
                                            , AccelerationStructureCreateInfoNV(..)
                                            , BindAccelerationStructureMemoryInfoNV(..)
                                            , WriteDescriptorSetAccelerationStructureNV(..)
                                            , AccelerationStructureMemoryRequirementsInfoNV(..)
                                            , PhysicalDeviceRayTracingPropertiesNV(..)
                                            , AccelerationStructureMemoryRequirementsTypeNV( ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
                                                                                           , ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
                                                                                           , ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
                                                                                           , ..
                                                                                           )
                                            , GeometryFlagsNV
                                            , GeometryInstanceFlagsNV
                                            , BuildAccelerationStructureFlagsNV
                                            , GeometryFlagBitsNV
                                            , GeometryInstanceFlagBitsNV
                                            , BuildAccelerationStructureFlagBitsNV
                                            , CopyAccelerationStructureModeNV
                                            , AccelerationStructureTypeNV
                                            , GeometryTypeNV
                                            , RayTracingShaderGroupTypeNV
                                            , AabbPositionsNV
                                            , TransformMatrixNV
                                            , AccelerationStructureInstanceNV
                                            , NV_RAY_TRACING_SPEC_VERSION
                                            , pattern NV_RAY_TRACING_SPEC_VERSION
                                            , NV_RAY_TRACING_EXTENSION_NAME
                                            , pattern NV_RAY_TRACING_EXTENSION_NAME
                                            , AccelerationStructureNV(..)
                                            , AabbPositionsKHR(..)
                                            , TransformMatrixKHR(..)
                                            , AccelerationStructureInstanceKHR(..)
                                            , getRayTracingShaderGroupHandlesKHR
                                            , DebugReportObjectTypeEXT(..)
                                            , GeometryInstanceFlagBitsKHR(..)
                                            , GeometryInstanceFlagsKHR
                                            , GeometryFlagBitsKHR(..)
                                            , GeometryFlagsKHR
                                            , BuildAccelerationStructureFlagBitsKHR(..)
                                            , BuildAccelerationStructureFlagsKHR
                                            , CopyAccelerationStructureModeKHR(..)
                                            , AccelerationStructureTypeKHR(..)
                                            , GeometryTypeKHR(..)
                                            , RayTracingShaderGroupTypeKHR(..)
                                            , MemoryRequirements2KHR
                                            , pattern GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR
                                            , SHADER_UNUSED_KHR
                                            , pattern SHADER_UNUSED_KHR
                                            ) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Foldable (traverse_)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
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.Show (showsPrec)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Foreign.C.Types (CSize(..))
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
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 GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.Pipeline (destroyPipeline)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (getRayTracingShaderGroupHandlesKHR)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AabbPositionsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureInstanceKHR)
import Vulkan.Extensions.Handles (AccelerationStructureNV)
import Vulkan.Extensions.Handles (AccelerationStructureNV(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureTypeKHR)
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Bool32(..))
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (Buffer(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Extensions.VK_KHR_acceleration_structure (CopyAccelerationStructureModeKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (CopyAccelerationStructureModeKHR(..))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkBindAccelerationStructureMemoryNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBuildAccelerationStructureNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyAccelerationStructureNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdTraceRaysNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdWriteAccelerationStructuresPropertiesNV))
import Vulkan.Dynamic (DeviceCmds(pVkCompileDeferredNV))
import Vulkan.Dynamic (DeviceCmds(pVkCreateAccelerationStructureNV))
import Vulkan.Dynamic (DeviceCmds(pVkCreateRayTracingPipelinesNV))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyAccelerationStructureNV))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureHandleNV))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureMemoryRequirementsNV))
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.Enums.Format (Format)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagBitsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagBitsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryTypeKHR)
import Vulkan.Core10.Enums.IndexType (IndexType)
import Vulkan.Extensions.VK_KHR_get_memory_requirements2 (MemoryRequirements2KHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_descriptor_buffer (OpaqueCaptureDescriptorDataCreateInfoEXT)
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_KHR_maintenance5 (PipelineCreateFlags2CreateInfoKHR)
import {-# SOURCE #-} Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback (PipelineCreationFeedbackCreateInfo)
import Vulkan.Core10.Handles (PipelineLayout)
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.Extensions.VK_KHR_ray_tracing_pipeline (RayTracingShaderGroupTypeKHR)
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.Extensions.VK_KHR_acceleration_structure (TransformMatrixKHR)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureTypeKHR(ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureTypeKHR(ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR))
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlagBits(ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR))
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlagBits(ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR))
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlags)
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlagBits(BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (CopyAccelerationStructureModeKHR(COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (CopyAccelerationStructureModeKHR(COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagBitsKHR(GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagBitsKHR(GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagBitsKHR(GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (pattern GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagBitsKHR(GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagBitsKHR(GEOMETRY_OPAQUE_BIT_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryTypeKHR(GEOMETRY_TYPE_AABBS_KHR))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryTypeKHR(GEOMETRY_TYPE_TRIANGLES_KHR))
import Vulkan.Core10.Enums.IndexType (IndexType(INDEX_TYPE_NONE_KHR))
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint(PIPELINE_BIND_POINT_RAY_TRACING_KHR))
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlagBits(PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR))
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlagBits(PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR))
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (RayTracingShaderGroupTypeKHR(RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR))
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (RayTracingShaderGroupTypeKHR(RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR))
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (RayTracingShaderGroupTypeKHR(RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_ANY_HIT_BIT_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_CALLABLE_BIT_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_CLOSEST_HIT_BIT_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_INTERSECTION_BIT_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_MISS_BIT_KHR))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(SHADER_STAGE_RAYGEN_BIT_KHR))
import Vulkan.Core10.APIConstants (pattern SHADER_UNUSED_KHR)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GEOMETRY_AABB_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GEOMETRY_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (getRayTracingShaderGroupHandlesKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (AabbPositionsKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureInstanceKHR(..))
import Vulkan.Extensions.Handles (AccelerationStructureNV(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (AccelerationStructureTypeKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (BuildAccelerationStructureFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (CopyAccelerationStructureModeKHR(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryInstanceFlagsKHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (GeometryTypeKHR(..))
import Vulkan.Extensions.VK_KHR_get_memory_requirements2 (MemoryRequirements2KHR)
import Vulkan.Extensions.VK_KHR_ray_tracing_pipeline (RayTracingShaderGroupTypeKHR(..))
import Vulkan.Core10.APIConstants (SHADER_UNUSED_KHR)
import Vulkan.Extensions.VK_KHR_acceleration_structure (TransformMatrixKHR(..))
import Vulkan.Extensions.VK_KHR_acceleration_structure (pattern GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR)
import Vulkan.Core10.APIConstants (pattern SHADER_UNUSED_KHR)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCompileDeferredNV
  :: FunPtr (Ptr Device_T -> Pipeline -> Word32 -> IO Result) -> Ptr Device_T -> Pipeline -> Word32 -> IO Result

-- | vkCompileDeferredNV - Deferred compilation of shaders
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Pipeline'
compileDeferredNV :: forall io
                   . (MonadIO io)
                  => -- | @device@ is the logical device containing the ray tracing pipeline.
                     --
                     -- #VUID-vkCompileDeferredNV-device-parameter# @device@ /must/ be a valid
                     -- 'Vulkan.Core10.Handles.Device' handle
                     Device
                  -> -- | @pipeline@ is the ray tracing pipeline object containing the shaders.
                     --
                     -- #VUID-vkCompileDeferredNV-pipeline-04621# @pipeline@ /must/ be a ray
                     -- tracing pipeline
                     --
                     -- #VUID-vkCompileDeferredNV-pipeline-02237# @pipeline@ /must/ have been
                     -- created with
                     -- 'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DEFER_COMPILE_BIT_NV'
                     --
                     -- #VUID-vkCompileDeferredNV-pipeline-parameter# @pipeline@ /must/ be a
                     -- valid 'Vulkan.Core10.Handles.Pipeline' handle
                     --
                     -- #VUID-vkCompileDeferredNV-pipeline-parent# @pipeline@ /must/ have been
                     -- created, allocated, or retrieved from @device@
                     Pipeline
                  -> -- | @shader@ is the index of the shader to compile.
                     --
                     -- #VUID-vkCompileDeferredNV-shader-02238# @shader@ /must/ not have been
                     -- called as a deferred compile before
                     ("shader" ::: Word32)
                  -> io ()
compileDeferredNV :: forall (io :: * -> *).
MonadIO io =>
Device -> Pipeline -> ("shader" ::: Word32) -> io ()
compileDeferredNV Device
device Pipeline
pipeline "shader" ::: Word32
shader = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkCompileDeferredNVPtr :: FunPtr
  (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result)
vkCompileDeferredNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result)
pVkCompileDeferredNV (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result)
vkCompileDeferredNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCompileDeferredNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCompileDeferredNV' :: Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result
vkCompileDeferredNV' = FunPtr
  (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result)
-> Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result
mkVkCompileDeferredNV FunPtr
  (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result)
vkCompileDeferredNVPtr
  Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCompileDeferredNV" (Ptr Device_T -> Pipeline -> ("shader" ::: Word32) -> IO Result
vkCompileDeferredNV'
                                                 (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                 (Pipeline
pipeline)
                                                 ("shader" ::: Word32
shader))
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (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" mkVkCreateAccelerationStructureNV
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct AccelerationStructureCreateInfoNV) -> Ptr AllocationCallbacks -> Ptr AccelerationStructureNV -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct AccelerationStructureCreateInfoNV) -> Ptr AllocationCallbacks -> Ptr AccelerationStructureNV -> IO Result

-- | vkCreateAccelerationStructureNV - Create a new acceleration structure
-- object
--
-- = Description
--
-- Similarly to other objects in Vulkan, the acceleration structure
-- creation merely creates an object with a specific “shape” as specified
-- by the information in 'AccelerationStructureInfoNV' and @compactedSize@
-- in @pCreateInfo@.
--
-- Once memory has been bound to the acceleration structure using
-- 'bindAccelerationStructureMemoryNV', that memory is populated by calls
-- to 'cmdBuildAccelerationStructureNV' and
-- 'cmdCopyAccelerationStructureNV'.
--
-- Acceleration structure creation uses the count and type information from
-- the geometries, but does not use the data references in the structures.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateAccelerationStructureNV-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateAccelerationStructureNV-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'AccelerationStructureCreateInfoNV' structure
--
-- -   #VUID-vkCreateAccelerationStructureNV-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateAccelerationStructureNV-pAccelerationStructure-parameter#
--     @pAccelerationStructure@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureCreateInfoNV',
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device'
createAccelerationStructureNV :: forall a io
                               . ( Extendss AccelerationStructureCreateInfoNV a
                                 , PokeChain a
                                 , MonadIO io )
                              => -- | @device@ is the logical device that creates the buffer object.
                                 Device
                              -> -- | @pCreateInfo@ is a pointer to a 'AccelerationStructureCreateInfoNV'
                                 -- structure containing parameters affecting creation of the acceleration
                                 -- structure.
                                 (AccelerationStructureCreateInfoNV a)
                              -> -- | @pAllocator@ controls host memory allocation as described in the
                                 -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                 -- chapter.
                                 ("allocator" ::: Maybe AllocationCallbacks)
                              -> io (AccelerationStructureNV)
createAccelerationStructureNV :: forall (a :: [*]) (io :: * -> *).
(Extendss AccelerationStructureCreateInfoNV a, PokeChain a,
 MonadIO io) =>
Device
-> AccelerationStructureCreateInfoNV a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureNV
createAccelerationStructureNV Device
device
                                AccelerationStructureCreateInfoNV a
createInfo
                                "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCreateAccelerationStructureNVPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo"
       ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> IO Result)
vkCreateAccelerationStructureNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo"
          ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
      -> IO Result)
pVkCreateAccelerationStructureNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo"
       ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> IO Result)
vkCreateAccelerationStructureNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateAccelerationStructureNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateAccelerationStructureNV' :: Ptr Device_T
-> ("pCreateInfo"
    ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> IO Result
vkCreateAccelerationStructureNV' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo"
       ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo"
    ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> IO Result
mkVkCreateAccelerationStructureNV FunPtr
  (Ptr Device_T
   -> ("pCreateInfo"
       ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> IO Result)
vkCreateAccelerationStructureNVPtr
  Ptr (AccelerationStructureCreateInfoNV a)
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureCreateInfoNV a
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructure <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @AccelerationStructureNV Int
8) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateAccelerationStructureNV" (Ptr Device_T
-> ("pCreateInfo"
    ::: Ptr (SomeStruct AccelerationStructureCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> IO Result
vkCreateAccelerationStructureNV'
                                                                    (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                    (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (AccelerationStructureCreateInfoNV a)
pCreateInfo)
                                                                    "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
                                                                    ("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructure))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  AccelerationStructureNV
pAccelerationStructure <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureNV "pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructure
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (AccelerationStructureNV
pAccelerationStructure)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createAccelerationStructureNV' and 'destroyAccelerationStructureNV'
--
-- To ensure that 'destroyAccelerationStructureNV' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withAccelerationStructureNV :: forall a io r . (Extendss AccelerationStructureCreateInfoNV a, PokeChain a, MonadIO io) => Device -> AccelerationStructureCreateInfoNV a -> Maybe AllocationCallbacks -> (io AccelerationStructureNV -> (AccelerationStructureNV -> io ()) -> r) -> r
withAccelerationStructureNV :: forall (a :: [*]) (io :: * -> *) r.
(Extendss AccelerationStructureCreateInfoNV a, PokeChain a,
 MonadIO io) =>
Device
-> AccelerationStructureCreateInfoNV a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io AccelerationStructureNV
    -> (AccelerationStructureNV -> io ()) -> r)
-> r
withAccelerationStructureNV Device
device AccelerationStructureCreateInfoNV a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io AccelerationStructureNV
-> (AccelerationStructureNV -> io ()) -> r
b =
  io AccelerationStructureNV
-> (AccelerationStructureNV -> io ()) -> r
b (forall (a :: [*]) (io :: * -> *).
(Extendss AccelerationStructureCreateInfoNV a, PokeChain a,
 MonadIO io) =>
Device
-> AccelerationStructureCreateInfoNV a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureNV
createAccelerationStructureNV Device
device AccelerationStructureCreateInfoNV a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(AccelerationStructureNV
o0) -> forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureNV Device
device AccelerationStructureNV
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyAccelerationStructureNV
  :: FunPtr (Ptr Device_T -> AccelerationStructureNV -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> AccelerationStructureNV -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyAccelerationStructureNV - Destroy an acceleration structure
-- object
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03752#
--     All submitted commands that refer to @accelerationStructure@ /must/
--     have completed execution
--
-- -   #VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03753#
--     If 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @accelerationStructure@ was created, a compatible set
--     of callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03754#
--     If no 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @accelerationStructure@ was created, @pAllocator@
--     /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyAccelerationStructureNV-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyAccelerationStructureNV-accelerationStructure-parameter#
--     If @accelerationStructure@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @accelerationStructure@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
--
-- -   #VUID-vkDestroyAccelerationStructureNV-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyAccelerationStructureNV-accelerationStructure-parent#
--     If @accelerationStructure@ is a valid handle, it /must/ have been
--     created, allocated, or retrieved from @device@
--
-- == Host Synchronization
--
-- -   Host access to @accelerationStructure@ /must/ be externally
--     synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device'
destroyAccelerationStructureNV :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the logical device that destroys the buffer.
                                  Device
                               -> -- | @accelerationStructure@ is the acceleration structure to destroy.
                                  AccelerationStructureNV
                               -> -- | @pAllocator@ controls host memory allocation as described in the
                                  -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                  -- chapter.
                                  ("allocator" ::: Maybe AllocationCallbacks)
                               -> io ()
destroyAccelerationStructureNV :: forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureNV Device
device
                                 AccelerationStructureNV
accelerationStructure
                                 "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyAccelerationStructureNVPtr :: FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureNV
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyAccelerationStructureNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyAccelerationStructureNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkDestroyAccelerationStructureNV' :: Ptr Device_T
-> AccelerationStructureNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureNV' = FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> AccelerationStructureNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyAccelerationStructureNV FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureNVPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroyAccelerationStructureNV" (Ptr Device_T
-> AccelerationStructureNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureNV'
                                                                (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                (AccelerationStructureNV
accelerationStructure)
                                                                "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetAccelerationStructureMemoryRequirementsNV
  :: FunPtr (Ptr Device_T -> Ptr AccelerationStructureMemoryRequirementsInfoNV -> Ptr (SomeStruct MemoryRequirements2KHR) -> IO ()) -> Ptr Device_T -> Ptr AccelerationStructureMemoryRequirementsInfoNV -> Ptr (SomeStruct MemoryRequirements2KHR) -> IO ()

-- | vkGetAccelerationStructureMemoryRequirementsNV - Get acceleration
-- structure memory requirements
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureMemoryRequirementsInfoNV',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.VK_KHR_get_memory_requirements2.MemoryRequirements2KHR'
getAccelerationStructureMemoryRequirementsNV :: forall a io
                                              . ( Extendss MemoryRequirements2KHR a
                                                , PokeChain a
                                                , PeekChain a
                                                , MonadIO io )
                                             => -- | @device@ is the logical device on which the acceleration structure was
                                                -- created.
                                                --
                                                -- #VUID-vkGetAccelerationStructureMemoryRequirementsNV-device-parameter#
                                                -- @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                                Device
                                             -> -- | @pInfo@ is a pointer to a
                                                -- 'AccelerationStructureMemoryRequirementsInfoNV' structure specifying the
                                                -- acceleration structure to get memory requirements for.
                                                --
                                                -- #VUID-vkGetAccelerationStructureMemoryRequirementsNV-pInfo-parameter#
                                                -- @pInfo@ /must/ be a valid pointer to a valid
                                                -- 'AccelerationStructureMemoryRequirementsInfoNV' structure
                                                AccelerationStructureMemoryRequirementsInfoNV
                                             -> io (MemoryRequirements2KHR a)
getAccelerationStructureMemoryRequirementsNV :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryRequirements2KHR a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device
-> AccelerationStructureMemoryRequirementsInfoNV
-> io (MemoryRequirements2KHR a)
getAccelerationStructureMemoryRequirementsNV Device
device
                                               AccelerationStructureMemoryRequirementsInfoNV
info = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetAccelerationStructureMemoryRequirementsNVPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements"
       ::: Ptr (SomeStruct MemoryRequirements2KHR))
   -> IO ())
vkGetAccelerationStructureMemoryRequirementsNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
      -> ("pMemoryRequirements"
          ::: Ptr (SomeStruct MemoryRequirements2KHR))
      -> IO ())
pVkGetAccelerationStructureMemoryRequirementsNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements"
       ::: Ptr (SomeStruct MemoryRequirements2KHR))
   -> IO ())
vkGetAccelerationStructureMemoryRequirementsNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetAccelerationStructureMemoryRequirementsNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetAccelerationStructureMemoryRequirementsNV' :: Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> ("pMemoryRequirements"
    ::: Ptr (SomeStruct MemoryRequirements2KHR))
-> IO ()
vkGetAccelerationStructureMemoryRequirementsNV' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements"
       ::: Ptr (SomeStruct MemoryRequirements2KHR))
   -> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> ("pMemoryRequirements"
    ::: Ptr (SomeStruct MemoryRequirements2KHR))
-> IO ()
mkVkGetAccelerationStructureMemoryRequirementsNV FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements"
       ::: Ptr (SomeStruct MemoryRequirements2KHR))
   -> IO ())
vkGetAccelerationStructureMemoryRequirementsNVPtr
  "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureMemoryRequirementsInfoNV
info)
  Ptr (MemoryRequirements2KHR a)
pPMemoryRequirements <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(MemoryRequirements2KHR _))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetAccelerationStructureMemoryRequirementsNV" (Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> ("pMemoryRequirements"
    ::: Ptr (SomeStruct MemoryRequirements2KHR))
-> IO ()
vkGetAccelerationStructureMemoryRequirementsNV'
                                                                              (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                              "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
pInfo
                                                                              (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (MemoryRequirements2KHR a)
pPMemoryRequirements)))
  MemoryRequirements2KHR a
pMemoryRequirements <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(MemoryRequirements2KHR _) Ptr (MemoryRequirements2KHR a)
pPMemoryRequirements
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryRequirements2KHR a
pMemoryRequirements)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkBindAccelerationStructureMemoryNV
  :: FunPtr (Ptr Device_T -> Word32 -> Ptr BindAccelerationStructureMemoryInfoNV -> IO Result) -> Ptr Device_T -> Word32 -> Ptr BindAccelerationStructureMemoryInfoNV -> IO Result

-- | vkBindAccelerationStructureMemoryNV - Bind acceleration structure memory
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'BindAccelerationStructureMemoryInfoNV', 'Vulkan.Core10.Handles.Device'
bindAccelerationStructureMemoryNV :: forall io
                                   . (MonadIO io)
                                  => -- | @device@ is the logical device that owns the acceleration structures and
                                     -- memory.
                                     --
                                     -- #VUID-vkBindAccelerationStructureMemoryNV-device-parameter# @device@
                                     -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                     Device
                                  -> -- | @pBindInfos@ is a pointer to an array of
                                     -- 'BindAccelerationStructureMemoryInfoNV' structures describing
                                     -- acceleration structures and memory to bind.
                                     --
                                     -- #VUID-vkBindAccelerationStructureMemoryNV-pBindInfos-parameter#
                                     -- @pBindInfos@ /must/ be a valid pointer to an array of @bindInfoCount@
                                     -- valid 'BindAccelerationStructureMemoryInfoNV' structures
                                     ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV)
                                  -> io ()
bindAccelerationStructureMemoryNV :: forall (io :: * -> *).
MonadIO io =>
Device
-> ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV)
-> io ()
bindAccelerationStructureMemoryNV Device
device "bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV
bindInfos = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkBindAccelerationStructureMemoryNVPtr :: FunPtr
  (Ptr Device_T
   -> ("shader" ::: Word32)
   -> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
   -> IO Result)
vkBindAccelerationStructureMemoryNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("shader" ::: Word32)
      -> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
      -> IO Result)
pVkBindAccelerationStructureMemoryNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("shader" ::: Word32)
   -> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
   -> IO Result)
vkBindAccelerationStructureMemoryNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkBindAccelerationStructureMemoryNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkBindAccelerationStructureMemoryNV' :: Ptr Device_T
-> ("shader" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO Result
vkBindAccelerationStructureMemoryNV' = FunPtr
  (Ptr Device_T
   -> ("shader" ::: Word32)
   -> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
   -> IO Result)
-> Ptr Device_T
-> ("shader" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO Result
mkVkBindAccelerationStructureMemoryNV FunPtr
  (Ptr Device_T
   -> ("shader" ::: Word32)
   -> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
   -> IO Result)
vkBindAccelerationStructureMemoryNVPtr
  "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
pPBindInfos <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @BindAccelerationStructureMemoryInfoNV ((forall a. Vector a -> Int
Data.Vector.length ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV
bindInfos)) forall a. Num a => a -> a -> a
* Int
56)
  forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i BindAccelerationStructureMemoryInfoNV
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
pPBindInfos forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
56 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BindAccelerationStructureMemoryInfoNV) (BindAccelerationStructureMemoryInfoNV
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV
bindInfos)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkBindAccelerationStructureMemoryNV" (Ptr Device_T
-> ("shader" ::: Word32)
-> ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO Result
vkBindAccelerationStructureMemoryNV'
                                                                        (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                        ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("bindInfos" ::: Vector BindAccelerationStructureMemoryInfoNV
bindInfos)) :: Word32))
                                                                        ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
pPBindInfos))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (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" mkVkCmdCopyAccelerationStructureNV
  :: FunPtr (Ptr CommandBuffer_T -> AccelerationStructureNV -> AccelerationStructureNV -> CopyAccelerationStructureModeKHR -> IO ()) -> Ptr CommandBuffer_T -> AccelerationStructureNV -> AccelerationStructureNV -> CopyAccelerationStructureModeKHR -> IO ()

-- | vkCmdCopyAccelerationStructureNV - Copy an acceleration structure
--
-- = Description
--
-- Accesses to @src@ and @dst@ /must/ be
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core13.Enums.PipelineStageFlags2.PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR'
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- or the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>,
-- and an
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'
-- or
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR'
-- as appropriate.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-mode-03410# @mode@ /must/ be
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR'
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-src-04963# The source
--     acceleration structure @src@ /must/ have been constructed prior to
--     the execution of this command
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-src-03411# If @mode@ is
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR',
--     @src@ /must/ have been constructed with
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR'
--     in the build
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-buffer-03718# The @buffer@
--     used to create @src@ /must/ be bound to device memory
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-buffer-03719# The @buffer@
--     used to create @dst@ /must/ be bound to device memory
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-dst-07791# The range of
--     memory backing @dst@ that is accessed by this command /must/ not
--     overlap the memory backing @src@ that is accessed by this command
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-dst-07792# @dst@ /must/ be
--     bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object via
--     'bindAccelerationStructureMemoryNV'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-dst-parameter# @dst@ /must/
--     be a valid 'Vulkan.Extensions.Handles.AccelerationStructureNV'
--     handle
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-src-parameter# @src@ /must/
--     be a valid 'Vulkan.Extensions.Handles.AccelerationStructureNV'
--     handle
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-mode-parameter# @mode@ /must/
--     be a valid
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureModeKHR'
--     value
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-renderpass# This command
--     /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-videocoding# This command
--     /must/ only be called outside of a video coding scope
--
-- -   #VUID-vkCmdCopyAccelerationStructureNV-commonparent# Each of
--     @commandBuffer@, @dst@, and @src@ /must/ have been created,
--     allocated, or retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | Compute                                                                                                               | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureModeKHR'
cmdCopyAccelerationStructureNV :: forall io
                                . (MonadIO io)
                               => -- | @commandBuffer@ is the command buffer into which the command will be
                                  -- recorded.
                                  CommandBuffer
                               -> -- | @dst@ is the target acceleration structure for the copy.
                                  ("dst" ::: AccelerationStructureNV)
                               -> -- | @src@ is the source acceleration structure for the copy.
                                  ("src" ::: AccelerationStructureNV)
                               -> -- | @mode@ is a
                                  -- 'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureModeKHR'
                                  -- value specifying additional operations to perform during the copy.
                                  CopyAccelerationStructureModeKHR
                               -> io ()
cmdCopyAccelerationStructureNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> AccelerationStructureNV
-> AccelerationStructureNV
-> CopyAccelerationStructureModeKHR
-> io ()
cmdCopyAccelerationStructureNV CommandBuffer
commandBuffer AccelerationStructureNV
dst AccelerationStructureNV
src CopyAccelerationStructureModeKHR
mode = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyAccelerationStructureNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> CopyAccelerationStructureModeKHR
   -> IO ())
vkCmdCopyAccelerationStructureNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> AccelerationStructureNV
      -> AccelerationStructureNV
      -> CopyAccelerationStructureModeKHR
      -> IO ())
pVkCmdCopyAccelerationStructureNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> CopyAccelerationStructureModeKHR
   -> IO ())
vkCmdCopyAccelerationStructureNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCopyAccelerationStructureNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdCopyAccelerationStructureNV' :: Ptr CommandBuffer_T
-> AccelerationStructureNV
-> AccelerationStructureNV
-> CopyAccelerationStructureModeKHR
-> IO ()
vkCmdCopyAccelerationStructureNV' = FunPtr
  (Ptr CommandBuffer_T
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> CopyAccelerationStructureModeKHR
   -> IO ())
-> Ptr CommandBuffer_T
-> AccelerationStructureNV
-> AccelerationStructureNV
-> CopyAccelerationStructureModeKHR
-> IO ()
mkVkCmdCopyAccelerationStructureNV FunPtr
  (Ptr CommandBuffer_T
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> CopyAccelerationStructureModeKHR
   -> IO ())
vkCmdCopyAccelerationStructureNVPtr
  forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdCopyAccelerationStructureNV" (Ptr CommandBuffer_T
-> AccelerationStructureNV
-> AccelerationStructureNV
-> CopyAccelerationStructureModeKHR
-> IO ()
vkCmdCopyAccelerationStructureNV'
                                                         (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                         (AccelerationStructureNV
dst)
                                                         (AccelerationStructureNV
src)
                                                         (CopyAccelerationStructureModeKHR
mode))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdWriteAccelerationStructuresPropertiesNV
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureNV -> QueryType -> QueryPool -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureNV -> QueryType -> QueryPool -> Word32 -> IO ()

-- | vkCmdWriteAccelerationStructuresPropertiesNV - Write acceleration
-- structure result parameters to query results.
--
-- = Description
--
-- Accesses to any of the acceleration structures listed in
-- @pAccelerationStructures@ /must/ be
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryPool-03755#
--     @queryPool@ /must/ have been created with a @queryType@ matching
--     @queryType@
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryPool-03756#
--     The queries identified by @queryPool@ and @firstQuery@ /must/ be
--     /unavailable/
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructure-03757#
--     @accelerationStructure@ /must/ be bound completely and contiguously
--     to a single 'Vulkan.Core10.Handles.DeviceMemory' object via
--     'bindAccelerationStructureMemoryNV'
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-pAccelerationStructures-04958#
--     All acceleration structures in @pAccelerationStructures@ /must/ have
--     been built prior to the execution of this command
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-pAccelerationStructures-06215#
--     All acceleration structures in @pAccelerationStructures@ /must/ have
--     been built with
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR'
--     if @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV'
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-06216#
--     @queryType@ /must/ be
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-pAccelerationStructures-parameter#
--     @pAccelerationStructures@ /must/ be a valid pointer to an array of
--     @accelerationStructureCount@ valid
--     'Vulkan.Extensions.Handles.AccelerationStructureNV' handles
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-parameter#
--     @queryType@ /must/ be a valid
--     'Vulkan.Core10.Enums.QueryType.QueryType' value
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryPool-parameter#
--     @queryPool@ /must/ be a valid 'Vulkan.Core10.Handles.QueryPool'
--     handle
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-renderpass# This
--     command /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-videocoding# This
--     command /must/ only be called outside of a video coding scope
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructureCount-arraylength#
--     @accelerationStructureCount@ /must/ be greater than @0@
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesNV-commonparent#
--     Each of @commandBuffer@, @queryPool@, and the elements of
--     @pAccelerationStructures@ /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | Compute                                                                                                               | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.Handles.QueryPool',
-- 'Vulkan.Core10.Enums.QueryType.QueryType'
cmdWriteAccelerationStructuresPropertiesNV :: forall io
                                            . (MonadIO io)
                                           => -- | @commandBuffer@ is the command buffer into which the command will be
                                              -- recorded.
                                              CommandBuffer
                                           -> -- | @pAccelerationStructures@ is a pointer to an array of existing
                                              -- previously built acceleration structures.
                                              ("accelerationStructures" ::: Vector AccelerationStructureNV)
                                           -> -- | @queryType@ is a 'Vulkan.Core10.Enums.QueryType.QueryType' value
                                              -- specifying the type of queries managed by the pool.
                                              QueryType
                                           -> -- | @queryPool@ is the query pool that will manage the results of the query.
                                              QueryPool
                                           -> -- | @firstQuery@ is the first query index within the query pool that will
                                              -- contain the @accelerationStructureCount@ number of results.
                                              ("firstQuery" ::: Word32)
                                           -> io ()
cmdWriteAccelerationStructuresPropertiesNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("accelerationStructures" ::: Vector AccelerationStructureNV)
-> QueryType
-> QueryPool
-> ("shader" ::: Word32)
-> io ()
cmdWriteAccelerationStructuresPropertiesNV CommandBuffer
commandBuffer
                                             "accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures
                                             QueryType
queryType
                                             QueryPool
queryPool
                                             "shader" ::: Word32
firstQuery = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCmdWriteAccelerationStructuresPropertiesNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("shader" ::: Word32)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> QueryType
   -> QueryPool
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("shader" ::: Word32)
      -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
      -> QueryType
      -> QueryPool
      -> ("shader" ::: Word32)
      -> IO ())
pVkCmdWriteAccelerationStructuresPropertiesNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("shader" ::: Word32)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> QueryType
   -> QueryPool
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdWriteAccelerationStructuresPropertiesNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdWriteAccelerationStructuresPropertiesNV' :: Ptr CommandBuffer_T
-> ("shader" ::: Word32)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> QueryType
-> QueryPool
-> ("shader" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("shader" ::: Word32)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> QueryType
   -> QueryPool
   -> ("shader" ::: Word32)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("shader" ::: Word32)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> QueryType
-> QueryPool
-> ("shader" ::: Word32)
-> IO ()
mkVkCmdWriteAccelerationStructuresPropertiesNV FunPtr
  (Ptr CommandBuffer_T
   -> ("shader" ::: Word32)
   -> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
   -> QueryType
   -> QueryPool
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesNVPtr
  "pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @AccelerationStructureNV ((forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)) forall a. Num a => a -> a -> a
* Int
8)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i AccelerationStructureNV
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureNV) (AccelerationStructureNV
e)) ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdWriteAccelerationStructuresPropertiesNV" (Ptr CommandBuffer_T
-> ("shader" ::: Word32)
-> ("pAccelerationStructure" ::: Ptr AccelerationStructureNV)
-> QueryType
-> QueryPool
-> ("shader" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesNV'
                                                                            (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                            ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)) :: Word32))
                                                                            ("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures)
                                                                            (QueryType
queryType)
                                                                            (QueryPool
queryPool)
                                                                            ("shader" ::: Word32
firstQuery))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBuildAccelerationStructureNV
  :: FunPtr (Ptr CommandBuffer_T -> Ptr AccelerationStructureInfoNV -> Buffer -> DeviceSize -> Bool32 -> AccelerationStructureNV -> AccelerationStructureNV -> Buffer -> DeviceSize -> IO ()) -> Ptr CommandBuffer_T -> Ptr AccelerationStructureInfoNV -> Buffer -> DeviceSize -> Bool32 -> AccelerationStructureNV -> AccelerationStructureNV -> Buffer -> DeviceSize -> IO ()

-- | vkCmdBuildAccelerationStructureNV - Build an acceleration structure
--
-- = Description
--
-- Accesses to @dst@, @src@, and @scratch@ /must/ be
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'
-- or
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-geometryCount-02241#
--     @geometryCount@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxGeometryCount@
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-dst-02488# @dst@ /must/ have
--     been created with compatible 'AccelerationStructureInfoNV' where
--     'AccelerationStructureInfoNV'::@type@ and
--     'AccelerationStructureInfoNV'::@flags@ are identical,
--     'AccelerationStructureInfoNV'::@instanceCount@ and
--     'AccelerationStructureInfoNV'::@geometryCount@ for @dst@ are greater
--     than or equal to the build size and each geometry in
--     'AccelerationStructureInfoNV'::@pGeometries@ for @dst@ has greater
--     than or equal to the number of vertices, indices, and AABBs
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-02489# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', @src@ /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-02490# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', @src@ /must/ have previously
--     been constructed with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV' set in
--     'AccelerationStructureInfoNV'::@flags@ in the original build
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-02491# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.FALSE', the @size@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to
--     'getAccelerationStructureMemoryRequirementsNV' with
--     'AccelerationStructureMemoryRequirementsInfoNV'::@accelerationStructure@
--     set to @dst@ and
--     'AccelerationStructureMemoryRequirementsInfoNV'::@type@ set to
--     'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV'
--     /must/ be less than or equal to the size of @scratch@ minus
--     @scratchOffset@
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-02492# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', the @size@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to
--     'getAccelerationStructureMemoryRequirementsNV' with
--     'AccelerationStructureMemoryRequirementsInfoNV'::@accelerationStructure@
--     set to @dst@ and
--     'AccelerationStructureMemoryRequirementsInfoNV'::@type@ set to
--     'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV'
--     /must/ be less than or equal to the size of @scratch@ minus
--     @scratchOffset@
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-scratch-03522# @scratch@
--     /must/ have been created with 'BUFFER_USAGE_RAY_TRACING_BIT_NV'
--     usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-instanceData-03523# If
--     @instanceData@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @instanceData@ /must/ have been created with
--     'BUFFER_USAGE_RAY_TRACING_BIT_NV' usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-accelerationStructureReference-03786#
--     Each
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureInstanceKHR'::@accelerationStructureReference@
--     value in @instanceData@ /must/ be a valid device address containing
--     a value obtained from 'getAccelerationStructureHandleNV'
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-03524# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', then objects that were
--     previously active /must/ not be made inactive as per
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#acceleration-structure-inactive-prims>
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-03525# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', then objects that were
--     previously inactive /must/ not be made active as per
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#acceleration-structure-inactive-prims>
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-update-03526# If @update@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', the @src@ and @dst@ objects
--     /must/ either be the same object or not have any
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-memory-aliasing memory aliasing>
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-dst-07787# @dst@ /must/ be
--     bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object via
--     'bindAccelerationStructureMemoryNV'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-pInfo-parameter# @pInfo@
--     /must/ be a valid pointer to a valid 'AccelerationStructureInfoNV'
--     structure
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-instanceData-parameter# If
--     @instanceData@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @instanceData@ /must/ be a valid 'Vulkan.Core10.Handles.Buffer'
--     handle
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-dst-parameter# @dst@ /must/
--     be a valid 'Vulkan.Extensions.Handles.AccelerationStructureNV'
--     handle
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-src-parameter# If @src@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @src@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-scratch-parameter# @scratch@
--     /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-renderpass# This command
--     /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-videocoding# This command
--     /must/ only be called outside of a video coding scope
--
-- -   #VUID-vkCmdBuildAccelerationStructureNV-commonparent# Each of
--     @commandBuffer@, @dst@, @instanceData@, @scratch@, and @src@ that
--     are valid handles of non-ignored parameters /must/ have been
--     created, allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | Compute                                                                                                               | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureInfoNV',
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.FundamentalTypes.Bool32', 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize'
cmdBuildAccelerationStructureNV :: forall io
                                 . (MonadIO io)
                                => -- | @commandBuffer@ is the command buffer into which the command will be
                                   -- recorded.
                                   CommandBuffer
                                -> -- | @pInfo@ contains the shared information for the acceleration structure’s
                                   -- structure.
                                   AccelerationStructureInfoNV
                                -> -- | @instanceData@ is the buffer containing an array of
                                   -- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureInstanceKHR'
                                   -- structures defining acceleration structures. This parameter /must/ be
                                   -- @NULL@ for bottom level acceleration structures.
                                   ("instanceData" ::: Buffer)
                                -> -- | @instanceOffset@ is the offset in bytes (relative to the start of
                                   -- @instanceData@) at which the instance data is located.
                                   ("instanceOffset" ::: DeviceSize)
                                -> -- | @update@ specifies whether to update the @dst@ acceleration structure
                                   -- with the data in @src@.
                                   ("update" ::: Bool)
                                -> -- | @dst@ is a pointer to the target acceleration structure for the build.
                                   ("dst" ::: AccelerationStructureNV)
                                -> -- | @src@ is a pointer to an existing acceleration structure that is to be
                                   -- used to update the @dst@ acceleration structure.
                                   ("src" ::: AccelerationStructureNV)
                                -> -- | @scratch@ is the 'Vulkan.Core10.Handles.Buffer' that will be used as
                                   -- scratch memory for the build.
                                   ("scratch" ::: Buffer)
                                -> -- | @scratchOffset@ is the offset in bytes relative to the start of
                                   -- @scratch@ that will be used as a scratch memory.
                                   ("scratchOffset" ::: DeviceSize)
                                -> io ()
cmdBuildAccelerationStructureNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> AccelerationStructureInfoNV
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> Bool
-> AccelerationStructureNV
-> AccelerationStructureNV
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> io ()
cmdBuildAccelerationStructureNV CommandBuffer
commandBuffer
                                  AccelerationStructureInfoNV
info
                                  "instanceData" ::: Buffer
instanceData
                                  "instanceOffset" ::: DeviceSize
instanceOffset
                                  Bool
update
                                  AccelerationStructureNV
dst
                                  AccelerationStructureNV
src
                                  "instanceData" ::: Buffer
scratch
                                  "instanceOffset" ::: DeviceSize
scratchOffset = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBuildAccelerationStructureNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("update" ::: Bool32)
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> IO ())
vkCmdBuildAccelerationStructureNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("update" ::: Bool32)
      -> AccelerationStructureNV
      -> AccelerationStructureNV
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> IO ())
pVkCmdBuildAccelerationStructureNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("update" ::: Bool32)
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> IO ())
vkCmdBuildAccelerationStructureNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBuildAccelerationStructureNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdBuildAccelerationStructureNV' :: Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("update" ::: Bool32)
-> AccelerationStructureNV
-> AccelerationStructureNV
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> IO ()
vkCmdBuildAccelerationStructureNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("update" ::: Bool32)
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("update" ::: Bool32)
-> AccelerationStructureNV
-> AccelerationStructureNV
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> IO ()
mkVkCmdBuildAccelerationStructureNV FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("update" ::: Bool32)
   -> AccelerationStructureNV
   -> AccelerationStructureNV
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> IO ())
vkCmdBuildAccelerationStructureNVPtr
  "pInfo" ::: Ptr AccelerationStructureInfoNV
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureInfoNV
info)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBuildAccelerationStructureNV" (Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr AccelerationStructureInfoNV)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("update" ::: Bool32)
-> AccelerationStructureNV
-> AccelerationStructureNV
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> IO ()
vkCmdBuildAccelerationStructureNV'
                                                                 (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                 "pInfo" ::: Ptr AccelerationStructureInfoNV
pInfo
                                                                 ("instanceData" ::: Buffer
instanceData)
                                                                 ("instanceOffset" ::: DeviceSize
instanceOffset)
                                                                 (Bool -> "update" ::: Bool32
boolToBool32 (Bool
update))
                                                                 (AccelerationStructureNV
dst)
                                                                 (AccelerationStructureNV
src)
                                                                 ("instanceData" ::: Buffer
scratch)
                                                                 ("instanceOffset" ::: DeviceSize
scratchOffset))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdTraceRaysNV
  :: FunPtr (Ptr CommandBuffer_T -> Buffer -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Word32 -> Word32 -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Buffer -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Buffer -> DeviceSize -> DeviceSize -> Word32 -> Word32 -> Word32 -> IO ()

-- | vkCmdTraceRaysNV - Initialize a ray tracing dispatch
--
-- = Description
--
-- When the command is executed, a ray generation group of @width@ ×
-- @height@ × @depth@ rays is assembled.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdTraceRaysNV-magFilter-04553# If a
--     'Vulkan.Core10.Handles.Sampler' created with @magFilter@ or
--     @minFilter@ equal to 'Vulkan.Core10.Enums.Filter.FILTER_LINEAR' and
--     @compareEnable@ equal to 'Vulkan.Core10.FundamentalTypes.FALSE' is
--     used to sample a 'Vulkan.Core10.Handles.ImageView' as a result of
--     this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-mipmapMode-04770# If a
--     'Vulkan.Core10.Handles.Sampler' created with @mipmapMode@ equal to
--     'Vulkan.Core10.Enums.SamplerMipmapMode.SAMPLER_MIPMAP_MODE_LINEAR'
--     and @compareEnable@ equal to 'Vulkan.Core10.FundamentalTypes.FALSE'
--     is used to sample a 'Vulkan.Core10.Handles.ImageView' as a result of
--     this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-06479# If a
--     'Vulkan.Core10.Handles.ImageView' is sampled with
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-depth-compare-operation depth comparison>,
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-02691# If a
--     'Vulkan.Core10.Handles.ImageView' is accessed using atomic
--     operations as a result of this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-07888# If a
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER'
--     descriptor is accessed using atomic operations as a result of this
--     command, then the storage texel buffer’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-buffer-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-02692# If a
--     'Vulkan.Core10.Handles.ImageView' is sampled with
--     'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' as a result of this
--     command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-02693# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_filter_cubic VK_EXT_filter_cubic>
--     extension is not enabled and any 'Vulkan.Core10.Handles.ImageView'
--     is sampled with 'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' as a
--     result of this command, it /must/ not have a
--     'Vulkan.Core10.Enums.ImageViewType.ImageViewType' of
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_3D',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE', or
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE_ARRAY'
--
-- -   #VUID-vkCmdTraceRaysNV-filterCubic-02694# Any
--     'Vulkan.Core10.Handles.ImageView' being sampled with
--     'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' as a result of this
--     command /must/ have a
--     'Vulkan.Core10.Enums.ImageViewType.ImageViewType' and format that
--     supports cubic filtering, as specified by
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FilterCubicImageViewImageFormatPropertiesEXT'::@filterCubic@
--     returned by
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceImageFormatProperties2'
--
-- -   #VUID-vkCmdTraceRaysNV-filterCubicMinmax-02695# Any
--     'Vulkan.Core10.Handles.ImageView' being sampled with
--     'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' with a reduction mode
--     of either
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_MIN'
--     or
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_MAX'
--     as a result of this command /must/ have a
--     'Vulkan.Core10.Enums.ImageViewType.ImageViewType' and format that
--     supports cubic filtering together with minmax filtering, as
--     specified by
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FilterCubicImageViewImageFormatPropertiesEXT'::@filterCubicMinmax@
--     returned by
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceImageFormatProperties2'
--
-- -   #VUID-vkCmdTraceRaysNV-cubicRangeClamp-09212# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-filter-cubic-range-clamp cubicRangeClamp>
--     feature is not enabled, then any 'Vulkan.Core10.Handles.ImageView'
--     being sampled with 'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' as
--     a result of this command /must/ not have a
--     'Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax.SamplerReductionModeCreateInfo'::@reductionMode@
--     equal to
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-reductionMode-09213# Any
--     'Vulkan.Core10.Handles.ImageView' being sampled with a
--     'Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax.SamplerReductionModeCreateInfo'::@reductionMode@
--     equal to
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM'
--     as a result of this command /must/ sample with
--     'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-selectableCubicWeights-09214# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-filter-cubic-weight-selection selectableCubicWeights>
--     feature is not enabled, then any 'Vulkan.Core10.Handles.ImageView'
--     being sampled with 'Vulkan.Core10.Enums.Filter.FILTER_CUBIC_EXT' as
--     a result of this command /must/ have
--     'Vulkan.Extensions.VK_QCOM_filter_cubic_weights.SamplerCubicWeightsCreateInfoQCOM'::@cubicWeights@
--     equal to
--     'Vulkan.Extensions.VK_QCOM_filter_cubic_weights.CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-flags-02696# Any
--     'Vulkan.Core10.Handles.Image' created with a
--     'Vulkan.Core10.Image.ImageCreateInfo'::@flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_CORNER_SAMPLED_BIT_NV'
--     sampled as a result of this command /must/ only be sampled using a
--     'Vulkan.Core10.Enums.SamplerAddressMode.SamplerAddressMode' of
--     'Vulkan.Core10.Enums.SamplerAddressMode.SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE'
--
-- -   #VUID-vkCmdTraceRaysNV-OpTypeImage-07027# For any
--     'Vulkan.Core10.Handles.ImageView' being written as a storage image
--     where the image format field of the @OpTypeImage@ is @Unknown@, the
--     view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-OpTypeImage-07028# For any
--     'Vulkan.Core10.Handles.ImageView' being read as a storage image
--     where the image format field of the @OpTypeImage@ is @Unknown@, the
--     view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-OpTypeImage-07029# For any
--     'Vulkan.Core10.Handles.BufferView' being written as a storage texel
--     buffer where the image format field of the @OpTypeImage@ is
--     @Unknown@, the view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkFormatProperties3 buffer features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-OpTypeImage-07030# Any
--     'Vulkan.Core10.Handles.BufferView' being read as a storage texel
--     buffer where the image format field of the @OpTypeImage@ is
--     @Unknown@ then the view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkFormatProperties3 buffer features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-08600# For each set /n/ that is
--     statically used by
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding a bound shader>,
--     a descriptor set /must/ have been bound to /n/ at the same pipeline
--     bind point, with a 'Vulkan.Core10.Handles.PipelineLayout' that is
--     compatible for set /n/, with the
--     'Vulkan.Core10.Handles.PipelineLayout' or
--     'Vulkan.Core10.Handles.DescriptorSetLayout' array that was used to
--     create the current 'Vulkan.Core10.Handles.Pipeline' or
--     'Vulkan.Extensions.Handles.ShaderEXT', as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility ???>
--
-- -   #VUID-vkCmdTraceRaysNV-None-08601# For each push constant that is
--     statically used by
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding a bound shader>,
--     a push constant value /must/ have been set for the same pipeline
--     bind point, with a 'Vulkan.Core10.Handles.PipelineLayout' that is
--     compatible for push constants, with the
--     'Vulkan.Core10.Handles.PipelineLayout' or
--     'Vulkan.Core10.Handles.DescriptorSetLayout' and
--     'Vulkan.Core10.PipelineLayout.PushConstantRange' arrays used to
--     create the current 'Vulkan.Core10.Handles.Pipeline' or
--     'Vulkan.Extensions.Handles.ShaderEXT', as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility ???>
--
-- -   #VUID-vkCmdTraceRaysNV-maintenance4-08602# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-maintenance4 maintenance4>
--     feature is not enabled, then for each push constant that is
--     statically used by
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding a bound shader>,
--     a push constant value /must/ have been set for the same pipeline
--     bind point, with a 'Vulkan.Core10.Handles.PipelineLayout' that is
--     compatible for push constants, with the
--     'Vulkan.Core10.Handles.PipelineLayout' or
--     'Vulkan.Core10.Handles.DescriptorSetLayout' and
--     'Vulkan.Core10.PipelineLayout.PushConstantRange' arrays used to
--     create the current 'Vulkan.Core10.Handles.Pipeline' or
--     'Vulkan.Extensions.Handles.ShaderEXT', as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility ???>
--
-- -   #VUID-vkCmdTraceRaysNV-None-08114# Descriptors in each bound
--     descriptor set, specified via
--     'Vulkan.Core10.CommandBufferBuilding.cmdBindDescriptorSets', /must/
--     be valid if they are statically used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     used by this command and the bound 'Vulkan.Core10.Handles.Pipeline'
--     was not created with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-08115# If the descriptors used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     were specified via
--     'Vulkan.Core10.CommandBufferBuilding.cmdBindDescriptorSets', the
--     bound 'Vulkan.Core10.Handles.Pipeline' /must/ have been created
--     without
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-08116# Descriptors in bound descriptor
--     buffers, specified via
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.cmdSetDescriptorBufferOffsetsEXT',
--     /must/ be valid if they are dynamically used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     used by this command and the bound 'Vulkan.Core10.Handles.Pipeline'
--     was created with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-08604# Descriptors in bound descriptor
--     buffers, specified via
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.cmdSetDescriptorBufferOffsetsEXT',
--     /must/ be valid if they are dynamically used by any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command
--
-- -   #VUID-vkCmdTraceRaysNV-None-08117# If the descriptors used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     were specified via
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.cmdSetDescriptorBufferOffsetsEXT',
--     the bound 'Vulkan.Core10.Handles.Pipeline' /must/ have been created
--     with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--
-- -   #VUID-vkCmdTraceRaysNV-None-08119# If a descriptor is dynamically
--     used with a 'Vulkan.Core10.Handles.Pipeline' created with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT',
--     the descriptor memory /must/ be resident
--
-- -   #VUID-vkCmdTraceRaysNV-None-08605# If a descriptor is dynamically
--     used with a 'Vulkan.Extensions.Handles.ShaderEXT' created with a
--     'Vulkan.Core10.Handles.DescriptorSetLayout' that was created with
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT',
--     the descriptor memory /must/ be resident
--
-- -   #VUID-vkCmdTraceRaysNV-None-08606# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shaderObject shaderObject>
--     feature is not enabled, a valid pipeline /must/ be bound to the
--     pipeline bind point used by this command
--
-- -   #VUID-vkCmdTraceRaysNV-None-08607# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shaderObject shaderObject>
--     is enabled, either a valid pipeline /must/ be bound to the pipeline
--     bind point used by this command, or a valid combination of valid and
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' shader objects /must/ be
--     bound to every supported shader stage corresponding to the pipeline
--     bind point used by this command
--
-- -   #VUID-vkCmdTraceRaysNV-None-08608# If a pipeline is bound to the
--     pipeline bind point used by this command, there /must/ not have been
--     any calls to dynamic state setting commands for any state not
--     specified as dynamic in the 'Vulkan.Core10.Handles.Pipeline' object
--     bound to the pipeline bind point used by this command, since that
--     pipeline was bound
--
-- -   #VUID-vkCmdTraceRaysNV-None-08609# If the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command or any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used to sample from any
--     'Vulkan.Core10.Handles.Image' with a
--     'Vulkan.Core10.Handles.ImageView' of the type
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_3D',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_1D_ARRAY',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_2D_ARRAY' or
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE_ARRAY', in
--     any shader stage
--
-- -   #VUID-vkCmdTraceRaysNV-None-08610# If the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command or any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used with any of the SPIR-V
--     @OpImageSample*@ or @OpImageSparseSample*@ instructions with
--     @ImplicitLod@, @Dref@ or @Proj@ in their name, in any shader stage
--
-- -   #VUID-vkCmdTraceRaysNV-None-08611# If the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command or any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used with any of the SPIR-V
--     @OpImageSample*@ or @OpImageSparseSample*@ instructions that
--     includes a LOD bias or any offset values, in any shader stage
--
-- -   #VUID-vkCmdTraceRaysNV-uniformBuffers-06935# If any stage of the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command accesses a uniform buffer, and that stage
--     was created without enabling either
--     'Vulkan.Extensions.VK_EXT_pipeline_robustness.PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT'
--     or
--     'Vulkan.Extensions.VK_EXT_pipeline_robustness.PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT'
--     for @uniformBuffers@, and the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robustBufferAccess>
--     feature is not enabled, that stage /must/ not access values outside
--     of the range of the buffer as specified in the descriptor set bound
--     to the same pipeline bind point
--
-- -   #VUID-vkCmdTraceRaysNV-None-08612# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robustBufferAccess>
--     feature is not enabled, and any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command accesses a uniform
--     buffer, it /must/ not access values outside of the range of the
--     buffer as specified in the descriptor set bound to the same pipeline
--     bind point
--
-- -   #VUID-vkCmdTraceRaysNV-storageBuffers-06936# If any stage of the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command accesses a storage buffer, and that stage
--     was created without enabling either
--     'Vulkan.Extensions.VK_EXT_pipeline_robustness.PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT'
--     or
--     'Vulkan.Extensions.VK_EXT_pipeline_robustness.PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT'
--     for @storageBuffers@, and the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robustBufferAccess>
--     feature is not enabled, that stage /must/ not access values outside
--     of the range of the buffer as specified in the descriptor set bound
--     to the same pipeline bind point
--
-- -   #VUID-vkCmdTraceRaysNV-None-08613# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robustBufferAccess>
--     feature is not enabled, and any
--     'Vulkan.Extensions.Handles.ShaderEXT' bound to a stage corresponding
--     to the pipeline bind point used by this command accesses a storage
--     buffer, it /must/ not access values outside of the range of the
--     buffer as specified in the descriptor set bound to the same pipeline
--     bind point
--
-- -   #VUID-vkCmdTraceRaysNV-commandBuffer-02707# If @commandBuffer@ is an
--     unprotected command buffer and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-protectedNoFault protectedNoFault>
--     is not supported, any resource accessed by
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding bound shaders>
--     /must/ not be a protected resource
--
-- -   #VUID-vkCmdTraceRaysNV-None-06550# If
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding a bound shader>
--     accesses a 'Vulkan.Core10.Handles.Sampler' or
--     'Vulkan.Core10.Handles.ImageView' object that enables
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#samplers-YCbCr-conversion sampler Y′CBCR conversion>,
--     that object /must/ only be used with @OpImageSample*@ or
--     @OpImageSparseSample*@ instructions
--
-- -   #VUID-vkCmdTraceRaysNV-ConstOffset-06551# If
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-binding a bound shader>
--     accesses a 'Vulkan.Core10.Handles.Sampler' or
--     'Vulkan.Core10.Handles.ImageView' object that enables
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#samplers-YCbCr-conversion sampler Y′CBCR conversion>,
--     that object /must/ not use the @ConstOffset@ and @Offset@ operands
--
-- -   #VUID-vkCmdTraceRaysNV-viewType-07752# If a
--     'Vulkan.Core10.Handles.ImageView' is accessed as a result of this
--     command, then the image view’s @viewType@ /must/ match the @Dim@
--     operand of the @OpTypeImage@ as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-operation-validation ???>
--
-- -   #VUID-vkCmdTraceRaysNV-format-07753# If a
--     'Vulkan.Core10.Handles.ImageView' is accessed as a result of this
--     command, then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-numericformat numeric type>
--     of the image view’s @format@ and the @Sampled@ @Type@ operand of the
--     @OpTypeImage@ /must/ match
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWrite-08795# If a
--     'Vulkan.Core10.Handles.ImageView' created with a format other than
--     'Vulkan.Core10.Enums.Format.FORMAT_A8_UNORM_KHR' is accessed using
--     @OpImageWrite@ as a result of this command, then the @Type@ of the
--     @Texel@ operand of that instruction /must/ have at least as many
--     components as the image view’s format
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWrite-08796# If a
--     'Vulkan.Core10.Handles.ImageView' created with the format
--     'Vulkan.Core10.Enums.Format.FORMAT_A8_UNORM_KHR' is accessed using
--     @OpImageWrite@ as a result of this command, then the @Type@ of the
--     @Texel@ operand of that instruction /must/ have four components
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWrite-04469# If a
--     'Vulkan.Core10.Handles.BufferView' is accessed using @OpImageWrite@
--     as a result of this command, then the @Type@ of the @Texel@ operand
--     of that instruction /must/ have at least as many components as the
--     buffer view’s format
--
-- -   #VUID-vkCmdTraceRaysNV-SampledType-04470# If a
--     'Vulkan.Core10.Handles.ImageView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a 64-bit component
--     width is accessed as a result of this command, the @SampledType@ of
--     the @OpTypeImage@ operand of that instruction /must/ have a @Width@
--     of 64
--
-- -   #VUID-vkCmdTraceRaysNV-SampledType-04471# If a
--     'Vulkan.Core10.Handles.ImageView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a component width less
--     than 64-bit is accessed as a result of this command, the
--     @SampledType@ of the @OpTypeImage@ operand of that instruction
--     /must/ have a @Width@ of 32
--
-- -   #VUID-vkCmdTraceRaysNV-SampledType-04472# If a
--     'Vulkan.Core10.Handles.BufferView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a 64-bit component
--     width is accessed as a result of this command, the @SampledType@ of
--     the @OpTypeImage@ operand of that instruction /must/ have a @Width@
--     of 64
--
-- -   #VUID-vkCmdTraceRaysNV-SampledType-04473# If a
--     'Vulkan.Core10.Handles.BufferView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a component width less
--     than 64-bit is accessed as a result of this command, the
--     @SampledType@ of the @OpTypeImage@ operand of that instruction
--     /must/ have a @Width@ of 32
--
-- -   #VUID-vkCmdTraceRaysNV-sparseImageInt64Atomics-04474# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-sparseImageInt64Atomics sparseImageInt64Atomics>
--     feature is not enabled, 'Vulkan.Core10.Handles.Image' objects
--     created with the
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SPARSE_RESIDENCY_BIT'
--     flag /must/ not be accessed by atomic instructions through an
--     @OpTypeImage@ with a @SampledType@ with a @Width@ of 64 by this
--     command
--
-- -   #VUID-vkCmdTraceRaysNV-sparseImageInt64Atomics-04475# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-sparseImageInt64Atomics sparseImageInt64Atomics>
--     feature is not enabled, 'Vulkan.Core10.Handles.Buffer' objects
--     created with the
--     'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_SPARSE_RESIDENCY_BIT'
--     flag /must/ not be accessed by atomic instructions through an
--     @OpTypeImage@ with a @SampledType@ with a @Width@ of 64 by this
--     command
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWeightedSampleQCOM-06971# If
--     @OpImageWeightedSampleQCOM@ is used to sample a
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWeightedSampleQCOM-06972# If
--     @OpImageWeightedSampleQCOM@ uses a 'Vulkan.Core10.Handles.ImageView'
--     as a sample weight image as a result of this command, then the image
--     view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBoxFilterQCOM-06973# If
--     @OpImageBoxFilterQCOM@ is used to sample a
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchSSDQCOM-06974# If
--     @OpImageBlockMatchSSDQCOM@ is used to read from an
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchSADQCOM-06975# If
--     @OpImageBlockMatchSADQCOM@ is used to read from an
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchSADQCOM-06976# If
--     @OpImageBlockMatchSADQCOM@ or OpImageBlockMatchSSDQCOM is used to
--     read from a reference image as result of this command, then the
--     specified reference coordinates /must/ not fail
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-integer-coordinate-validation integer texel coordinate validation>
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWeightedSampleQCOM-06977# If
--     @OpImageWeightedSampleQCOM@, @OpImageBoxFilterQCOM@,
--     @OpImageBlockMatchWindowSSDQCOM@, @OpImageBlockMatchWindowSADQCOM@,
--     @OpImageBlockMatchGatherSSDQCOM@, @OpImageBlockMatchGatherSADQCOM@,
--     @OpImageBlockMatchSSDQCOM@, or @OpImageBlockMatchSADQCOM@ uses a
--     'Vulkan.Core10.Handles.Sampler' as a result of this command, then
--     the sampler /must/ have been created with
--     'Vulkan.Core10.Enums.SamplerCreateFlagBits.SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageWeightedSampleQCOM-06978# If any
--     command other than @OpImageWeightedSampleQCOM@,
--     @OpImageBoxFilterQCOM@, @OpImageBlockMatchWindowSSDQCOM@,
--     @OpImageBlockMatchWindowSADQCOM@, @OpImageBlockMatchGatherSSDQCOM@,
--     @OpImageBlockMatchGatherSADQCOM@, @OpImageBlockMatchSSDQCOM@, or
--     @OpImageBlockMatchSADQCOM@ uses a 'Vulkan.Core10.Handles.Sampler' as
--     a result of this command, then the sampler /must/ not have been
--     created with
--     'Vulkan.Core10.Enums.SamplerCreateFlagBits.SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchWindow-09215# If a
--     @OpImageBlockMatchWindow*QCOM@ or @OpImageBlockMatchGather*QCOM@
--     instruction is used to read from an
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM'
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchWindow-09216# If a
--     @OpImageBlockMatchWindow*QCOM@ or @OpImageBlockMatchGather*QCOM@
--     instruction is used to read from an
--     'Vulkan.Core10.Handles.ImageView' as a result of this command, then
--     the image view’s format /must/ be a single-component format.
--
-- -   #VUID-vkCmdTraceRaysNV-OpImageBlockMatchWindow-09217# If a
--     @OpImageBlockMatchWindow*QCOM@ or @OpImageBlockMatchGather*QCOM@
--     read from a reference image as result of this command, then the
--     specified reference coordinates /must/ not fail
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-integer-coordinate-validation integer texel coordinate validation>
--
-- -   #VUID-vkCmdTraceRaysNV-None-07288# Any shader invocation executed by
--     this command /must/
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-termination terminate>
--
-- -   #VUID-vkCmdTraceRaysNV-None-03429# Any shader group handle
--     referenced by this call /must/ have been queried from the currently
--     bound ray tracing pipeline
--
-- -   #VUID-vkCmdTraceRaysNV-commandBuffer-04624# @commandBuffer@ /must/
--     not be a protected command buffer
--
-- -   #VUID-vkCmdTraceRaysNV-maxRecursionDepth-03625# This command /must/
--     not cause a pipeline trace ray instruction to be executed from a
--     shader invocation with a
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#ray-tracing-recursion-depth recursion depth>
--     greater than the value of @maxRecursionDepth@ used to create the
--     bound ray tracing pipeline
--
-- -   #VUID-vkCmdTraceRaysNV-raygenShaderBindingTableBuffer-04042# If
--     @raygenShaderBindingTableBuffer@ is non-sparse then it /must/ be
--     bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdTraceRaysNV-raygenShaderBindingOffset-02455#
--     @raygenShaderBindingOffset@ /must/ be less than the size of
--     @raygenShaderBindingTableBuffer@
--
-- -   #VUID-vkCmdTraceRaysNV-raygenShaderBindingOffset-02456#
--     @raygenShaderBindingOffset@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupBaseAlignment@
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingTableBuffer-04043# If
--     @missShaderBindingTableBuffer@ is non-sparse then it /must/ be bound
--     completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingOffset-02457#
--     @missShaderBindingOffset@ /must/ be less than the size of
--     @missShaderBindingTableBuffer@
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingOffset-02458#
--     @missShaderBindingOffset@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupBaseAlignment@
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingTableBuffer-04044# If
--     @hitShaderBindingTableBuffer@ is non-sparse then it /must/ be bound
--     completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingOffset-02459#
--     @hitShaderBindingOffset@ /must/ be less than the size of
--     @hitShaderBindingTableBuffer@
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingOffset-02460#
--     @hitShaderBindingOffset@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupBaseAlignment@
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingTableBuffer-04045# If
--     @callableShaderBindingTableBuffer@ is non-sparse then it /must/ be
--     bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingOffset-02461#
--     @callableShaderBindingOffset@ /must/ be less than the size of
--     @callableShaderBindingTableBuffer@
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingOffset-02462#
--     @callableShaderBindingOffset@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupBaseAlignment@
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingStride-02463#
--     @missShaderBindingStride@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupHandleSize@
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingStride-02464#
--     @hitShaderBindingStride@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupHandleSize@
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingStride-02465#
--     @callableShaderBindingStride@ /must/ be a multiple of
--     'PhysicalDeviceRayTracingPropertiesNV'::@shaderGroupHandleSize@
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingStride-02466#
--     @missShaderBindingStride@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxShaderGroupStride@
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingStride-02467#
--     @hitShaderBindingStride@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxShaderGroupStride@
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingStride-02468#
--     @callableShaderBindingStride@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxShaderGroupStride@
--
-- -   #VUID-vkCmdTraceRaysNV-width-02469# @width@ /must/ be less than or
--     equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxComputeWorkGroupCount@[0]
--
-- -   #VUID-vkCmdTraceRaysNV-height-02470# @height@ /must/ be less than or
--     equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxComputeWorkGroupCount@[1]
--
-- -   #VUID-vkCmdTraceRaysNV-depth-02471# @depth@ /must/ be less than or
--     equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxComputeWorkGroupCount@[2]
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdTraceRaysNV-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdTraceRaysNV-raygenShaderBindingTableBuffer-parameter#
--     @raygenShaderBindingTableBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdTraceRaysNV-missShaderBindingTableBuffer-parameter# If
--     @missShaderBindingTableBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @missShaderBindingTableBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdTraceRaysNV-hitShaderBindingTableBuffer-parameter# If
--     @hitShaderBindingTableBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @hitShaderBindingTableBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdTraceRaysNV-callableShaderBindingTableBuffer-parameter#
--     If @callableShaderBindingTableBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @callableShaderBindingTableBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdTraceRaysNV-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdTraceRaysNV-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdTraceRaysNV-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- -   #VUID-vkCmdTraceRaysNV-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- -   #VUID-vkCmdTraceRaysNV-commonparent# Each of
--     @callableShaderBindingTableBuffer@, @commandBuffer@,
--     @hitShaderBindingTableBuffer@, @missShaderBindingTableBuffer@, and
--     @raygenShaderBindingTableBuffer@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | Compute                                                                                                               | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Handles.Buffer', 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize'
cmdTraceRaysNV :: forall io
                . (MonadIO io)
               => -- | @commandBuffer@ is the command buffer into which the command will be
                  -- recorded.
                  CommandBuffer
               -> -- | @raygenShaderBindingTableBuffer@ is the buffer object that holds the
                  -- shader binding table data for the ray generation shader stage.
                  ("raygenShaderBindingTableBuffer" ::: Buffer)
               -> -- | @raygenShaderBindingOffset@ is the offset in bytes (relative to
                  -- @raygenShaderBindingTableBuffer@) of the ray generation shader being
                  -- used for the trace.
                  ("raygenShaderBindingOffset" ::: DeviceSize)
               -> -- | @missShaderBindingTableBuffer@ is the buffer object that holds the
                  -- shader binding table data for the miss shader stage.
                  ("missShaderBindingTableBuffer" ::: Buffer)
               -> -- | @missShaderBindingOffset@ is the offset in bytes (relative to
                  -- @missShaderBindingTableBuffer@) of the miss shader being used for the
                  -- trace.
                  ("missShaderBindingOffset" ::: DeviceSize)
               -> -- | @missShaderBindingStride@ is the size in bytes of each shader binding
                  -- table record in @missShaderBindingTableBuffer@.
                  ("missShaderBindingStride" ::: DeviceSize)
               -> -- | @hitShaderBindingTableBuffer@ is the buffer object that holds the shader
                  -- binding table data for the hit shader stages.
                  ("hitShaderBindingTableBuffer" ::: Buffer)
               -> -- | @hitShaderBindingOffset@ is the offset in bytes (relative to
                  -- @hitShaderBindingTableBuffer@) of the hit shader group being used for
                  -- the trace.
                  ("hitShaderBindingOffset" ::: DeviceSize)
               -> -- | @hitShaderBindingStride@ is the size in bytes of each shader binding
                  -- table record in @hitShaderBindingTableBuffer@.
                  ("hitShaderBindingStride" ::: DeviceSize)
               -> -- | @callableShaderBindingTableBuffer@ is the buffer object that holds the
                  -- shader binding table data for the callable shader stage.
                  ("callableShaderBindingTableBuffer" ::: Buffer)
               -> -- | @callableShaderBindingOffset@ is the offset in bytes (relative to
                  -- @callableShaderBindingTableBuffer@) of the callable shader being used
                  -- for the trace.
                  ("callableShaderBindingOffset" ::: DeviceSize)
               -> -- | @callableShaderBindingStride@ is the size in bytes of each shader
                  -- binding table record in @callableShaderBindingTableBuffer@.
                  ("callableShaderBindingStride" ::: DeviceSize)
               -> -- | @width@ is the width of the ray trace query dimensions.
                  ("width" ::: Word32)
               -> -- | @height@ is height of the ray trace query dimensions.
                  ("height" ::: Word32)
               -> -- | @depth@ is depth of the ray trace query dimensions.
                  ("depth" ::: Word32)
               -> io ()
cmdTraceRaysNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> io ()
cmdTraceRaysNV CommandBuffer
commandBuffer
                 "instanceData" ::: Buffer
raygenShaderBindingTableBuffer
                 "instanceOffset" ::: DeviceSize
raygenShaderBindingOffset
                 "instanceData" ::: Buffer
missShaderBindingTableBuffer
                 "instanceOffset" ::: DeviceSize
missShaderBindingOffset
                 "instanceOffset" ::: DeviceSize
missShaderBindingStride
                 "instanceData" ::: Buffer
hitShaderBindingTableBuffer
                 "instanceOffset" ::: DeviceSize
hitShaderBindingOffset
                 "instanceOffset" ::: DeviceSize
hitShaderBindingStride
                 "instanceData" ::: Buffer
callableShaderBindingTableBuffer
                 "instanceOffset" ::: DeviceSize
callableShaderBindingOffset
                 "instanceOffset" ::: DeviceSize
callableShaderBindingStride
                 "shader" ::: Word32
width
                 "shader" ::: Word32
height
                 "shader" ::: Word32
depth = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkCmdTraceRaysNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdTraceRaysNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceData" ::: Buffer)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("instanceOffset" ::: DeviceSize)
      -> ("shader" ::: Word32)
      -> ("shader" ::: Word32)
      -> ("shader" ::: Word32)
      -> IO ())
pVkCmdTraceRaysNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdTraceRaysNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdTraceRaysNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdTraceRaysNV' :: Ptr CommandBuffer_T
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> IO ()
vkCmdTraceRaysNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> IO ()
mkVkCmdTraceRaysNV FunPtr
  (Ptr CommandBuffer_T
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceData" ::: Buffer)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("instanceOffset" ::: DeviceSize)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> ("shader" ::: Word32)
   -> IO ())
vkCmdTraceRaysNVPtr
  forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdTraceRaysNV" (Ptr CommandBuffer_T
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> IO ()
vkCmdTraceRaysNV'
                                         (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                         ("instanceData" ::: Buffer
raygenShaderBindingTableBuffer)
                                         ("instanceOffset" ::: DeviceSize
raygenShaderBindingOffset)
                                         ("instanceData" ::: Buffer
missShaderBindingTableBuffer)
                                         ("instanceOffset" ::: DeviceSize
missShaderBindingOffset)
                                         ("instanceOffset" ::: DeviceSize
missShaderBindingStride)
                                         ("instanceData" ::: Buffer
hitShaderBindingTableBuffer)
                                         ("instanceOffset" ::: DeviceSize
hitShaderBindingOffset)
                                         ("instanceOffset" ::: DeviceSize
hitShaderBindingStride)
                                         ("instanceData" ::: Buffer
callableShaderBindingTableBuffer)
                                         ("instanceOffset" ::: DeviceSize
callableShaderBindingOffset)
                                         ("instanceOffset" ::: DeviceSize
callableShaderBindingStride)
                                         ("shader" ::: Word32
width)
                                         ("shader" ::: Word32
height)
                                         ("shader" ::: Word32
depth))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetAccelerationStructureHandleNV
  :: FunPtr (Ptr Device_T -> AccelerationStructureNV -> CSize -> Ptr () -> IO Result) -> Ptr Device_T -> AccelerationStructureNV -> CSize -> Ptr () -> IO Result

-- | vkGetAccelerationStructureHandleNV - Get opaque acceleration structure
-- handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Handles.Device'
getAccelerationStructureHandleNV :: forall io
                                  . (MonadIO io)
                                 => -- | @device@ is the logical device that owns the acceleration structures.
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-device-parameter# @device@
                                    -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                    Device
                                 -> -- | @accelerationStructure@ is the acceleration structure.
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-accelerationStructure-02787#
                                    -- @accelerationStructure@ /must/ be bound completely and contiguously to a
                                    -- single 'Vulkan.Core10.Handles.DeviceMemory' object via
                                    -- 'bindAccelerationStructureMemoryNV'
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-accelerationStructure-parameter#
                                    -- @accelerationStructure@ /must/ be a valid
                                    -- 'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-accelerationStructure-parent#
                                    -- @accelerationStructure@ /must/ have been created, allocated, or
                                    -- retrieved from @device@
                                    AccelerationStructureNV
                                 -> -- | @dataSize@ is the size in bytes of the buffer pointed to by @pData@.
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-dataSize-02240# @dataSize@
                                    -- /must/ be large enough to contain the result of the query, as described
                                    -- above
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-dataSize-arraylength#
                                    -- @dataSize@ /must/ be greater than @0@
                                    ("dataSize" ::: Word64)
                                 -> -- | @pData@ is a pointer to a user-allocated buffer where the results will
                                    -- be written.
                                    --
                                    -- #VUID-vkGetAccelerationStructureHandleNV-pData-parameter# @pData@ /must/
                                    -- be a valid pointer to an array of @dataSize@ bytes
                                    ("data" ::: Ptr ())
                                 -> io ()
getAccelerationStructureHandleNV :: forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureNV
-> ("instanceOffset" ::: DeviceSize)
-> ("data" ::: Ptr ())
-> io ()
getAccelerationStructureHandleNV Device
device
                                   AccelerationStructureNV
accelerationStructure
                                   "instanceOffset" ::: DeviceSize
dataSize
                                   "data" ::: Ptr ()
data' = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkGetAccelerationStructureHandleNVPtr :: FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> IO Result)
vkGetAccelerationStructureHandleNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureNV
      -> ("dataSize" ::: CSize)
      -> ("data" ::: Ptr ())
      -> IO Result)
pVkGetAccelerationStructureHandleNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> IO Result)
vkGetAccelerationStructureHandleNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetAccelerationStructureHandleNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetAccelerationStructureHandleNV' :: Ptr Device_T
-> AccelerationStructureNV
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetAccelerationStructureHandleNV' = FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> IO Result)
-> Ptr Device_T
-> AccelerationStructureNV
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
mkVkGetAccelerationStructureHandleNV FunPtr
  (Ptr Device_T
   -> AccelerationStructureNV
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> IO Result)
vkGetAccelerationStructureHandleNVPtr
  Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetAccelerationStructureHandleNV" (Ptr Device_T
-> AccelerationStructureNV
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> IO Result
vkGetAccelerationStructureHandleNV'
                                                                (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                (AccelerationStructureNV
accelerationStructure)
                                                                (("instanceOffset" ::: DeviceSize) -> "dataSize" ::: CSize
CSize ("instanceOffset" ::: DeviceSize
dataSize))
                                                                ("data" ::: Ptr ()
data'))
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (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" mkVkCreateRayTracingPipelinesNV
  :: FunPtr (Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct RayTracingPipelineCreateInfoNV) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result) -> Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct RayTracingPipelineCreateInfoNV) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result

-- | vkCreateRayTracingPipelinesNV - Creates a new ray tracing pipeline
-- object
--
-- == Valid Usage
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-flags-03415# If the @flags@
--     member of any element of @pCreateInfos@ contains the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DERIVATIVE_BIT'
--     flag, and the @basePipelineIndex@ member of that same element is not
--     @-1@, @basePipelineIndex@ /must/ be less than the index into
--     @pCreateInfos@ that corresponds to that element
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-flags-03416# If the @flags@
--     member of any element of @pCreateInfos@ contains the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DERIVATIVE_BIT'
--     flag, the base pipeline /must/ have been created with the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT'
--     flag set
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-flags-03816# @flags@ /must/ not
--     contain the
--     'Vulkan.Core11.Promoted_From_VK_KHR_device_group.PIPELINE_CREATE_DISPATCH_BASE'
--     flag
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pipelineCache-02903# If
--     @pipelineCache@ was created with
--     'Vulkan.Core10.Enums.PipelineCacheCreateFlagBits.PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',
--     host access to @pipelineCache@ /must/ be
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-threadingbehavior externally synchronized>
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pipelineCache-parameter# If
--     @pipelineCache@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @pipelineCache@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineCache' handle
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pCreateInfos-parameter#
--     @pCreateInfos@ /must/ be a valid pointer to an array of
--     @createInfoCount@ valid 'RayTracingPipelineCreateInfoNV' structures
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pPipelines-parameter#
--     @pPipelines@ /must/ be a valid pointer to an array of
--     @createInfoCount@ 'Vulkan.Core10.Handles.Pipeline' handles
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-createInfoCount-arraylength#
--     @createInfoCount@ /must/ be greater than @0@
--
-- -   #VUID-vkCreateRayTracingPipelinesNV-pipelineCache-parent# If
--     @pipelineCache@ is a valid handle, it /must/ have been created,
--     allocated, or retrieved from @device@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Extensions.VK_EXT_pipeline_creation_cache_control.PIPELINE_COMPILE_REQUIRED_EXT'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INVALID_SHADER_NV'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Handles.PipelineCache', 'RayTracingPipelineCreateInfoNV'
createRayTracingPipelinesNV :: forall io
                             . (MonadIO io)
                            => -- | @device@ is the logical device that creates the ray tracing pipelines.
                               Device
                            -> -- | @pipelineCache@ is either 'Vulkan.Core10.APIConstants.NULL_HANDLE',
                               -- indicating that pipeline caching is disabled, or the handle of a valid
                               -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-cache pipeline cache>
                               -- object, in which case use of that cache is enabled for the duration of
                               -- the command.
                               PipelineCache
                            -> -- | @pCreateInfos@ is a pointer to an array of
                               -- 'RayTracingPipelineCreateInfoNV' structures.
                               ("createInfos" ::: Vector (SomeStruct RayTracingPipelineCreateInfoNV))
                            -> -- | @pAllocator@ controls host memory allocation as described in the
                               -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                               -- chapter.
                               ("allocator" ::: Maybe AllocationCallbacks)
                            -> io (Result, ("pipelines" ::: Vector Pipeline))
createRayTracingPipelinesNV :: forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineCache
-> ("createInfos"
    ::: Vector (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createRayTracingPipelinesNV Device
device
                              PipelineCache
pipelineCache
                              "createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos
                              "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCreateRayTracingPipelinesNVPtr :: FunPtr
  (Ptr Device_T
   -> PipelineCache
   -> ("shader" ::: Word32)
   -> ("pCreateInfos"
       ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPipelines" ::: Ptr Pipeline)
   -> IO Result)
vkCreateRayTracingPipelinesNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> PipelineCache
      -> ("shader" ::: Word32)
      -> ("pCreateInfos"
          ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pPipelines" ::: Ptr Pipeline)
      -> IO Result)
pVkCreateRayTracingPipelinesNV (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> PipelineCache
   -> ("shader" ::: Word32)
   -> ("pCreateInfos"
       ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPipelines" ::: Ptr Pipeline)
   -> IO Result)
vkCreateRayTracingPipelinesNVPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateRayTracingPipelinesNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateRayTracingPipelinesNV' :: Ptr Device_T
-> PipelineCache
-> ("shader" ::: Word32)
-> ("pCreateInfos"
    ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateRayTracingPipelinesNV' = FunPtr
  (Ptr Device_T
   -> PipelineCache
   -> ("shader" ::: Word32)
   -> ("pCreateInfos"
       ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPipelines" ::: Ptr Pipeline)
   -> IO Result)
-> Ptr Device_T
-> PipelineCache
-> ("shader" ::: Word32)
-> ("pCreateInfos"
    ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
mkVkCreateRayTracingPipelinesNV FunPtr
  (Ptr Device_T
   -> PipelineCache
   -> ("shader" ::: Word32)
   -> ("pCreateInfos"
       ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pPipelines" ::: Ptr Pipeline)
   -> IO Result)
vkCreateRayTracingPipelinesNVPtr
  Ptr (RayTracingPipelineCreateInfoNV Any)
pPCreateInfos <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(RayTracingPipelineCreateInfoNV _) ((forall a. Vector a -> Int
Data.Vector.length ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos)) forall a. Num a => a -> a -> a
* Int
80)
  forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct RayTracingPipelineCreateInfoNV
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (RayTracingPipelineCreateInfoNV Any)
pPCreateInfos forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
80 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (RayTracingPipelineCreateInfoNV _))) (SomeStruct RayTracingPipelineCreateInfoNV
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pPipelines" ::: Ptr Pipeline
pPPipelines <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos)) :: Word32))) forall a. Num a => a -> a -> a
* Int
8)) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateRayTracingPipelinesNV" (Ptr Device_T
-> PipelineCache
-> ("shader" ::: Word32)
-> ("pCreateInfos"
    ::: Ptr (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateRayTracingPipelinesNV'
                                                                  (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                  (PipelineCache
pipelineCache)
                                                                  ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos)) :: Word32))
                                                                  (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (RayTracingPipelineCreateInfoNV Any)
pPCreateInfos))
                                                                  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
                                                                  ("pPipelines" ::: Ptr Pipeline
pPPipelines))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  "pipelines" ::: Vector Pipeline
pPipelines <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
createInfos)) :: Word32))) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Result
r, "pipelines" ::: Vector Pipeline
pPipelines)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createRayTracingPipelinesNV' and 'destroyPipeline'
--
-- To ensure that 'destroyPipeline' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withRayTracingPipelinesNV :: forall io r . MonadIO io => Device -> PipelineCache -> Vector (SomeStruct RayTracingPipelineCreateInfoNV) -> Maybe AllocationCallbacks -> (io (Result, Vector Pipeline) -> ((Result, Vector Pipeline) -> io ()) -> r) -> r
withRayTracingPipelinesNV :: forall (io :: * -> *) r.
MonadIO io =>
Device
-> PipelineCache
-> ("createInfos"
    ::: Vector (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io (Result, "pipelines" ::: Vector Pipeline)
    -> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r)
-> r
withRayTracingPipelinesNV Device
device PipelineCache
pipelineCache "createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b =
  io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineCache
-> ("createInfos"
    ::: Vector (SomeStruct RayTracingPipelineCreateInfoNV))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createRayTracingPipelinesNV Device
device PipelineCache
pipelineCache "createInfos"
::: Vector (SomeStruct RayTracingPipelineCreateInfoNV)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(Result
_, "pipelines" ::: Vector Pipeline
o1) -> forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_ (\Pipeline
o1Elem -> forall (io :: * -> *).
MonadIO io =>
Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
destroyPipeline Device
device
                                                         Pipeline
o1Elem
                                                         "allocator" ::: Maybe AllocationCallbacks
pAllocator) "pipelines" ::: Vector Pipeline
o1)


-- No documentation found for TopLevel "VK_SHADER_STAGE_RAYGEN_BIT_NV"
pattern $bSHADER_STAGE_RAYGEN_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_RAYGEN_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_RAYGEN_BIT_NV = SHADER_STAGE_RAYGEN_BIT_KHR


-- No documentation found for TopLevel "VK_SHADER_STAGE_ANY_HIT_BIT_NV"
pattern $bSHADER_STAGE_ANY_HIT_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_ANY_HIT_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_ANY_HIT_BIT_NV = SHADER_STAGE_ANY_HIT_BIT_KHR


-- No documentation found for TopLevel "VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV"
pattern $bSHADER_STAGE_CLOSEST_HIT_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_CLOSEST_HIT_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_CLOSEST_HIT_BIT_NV = SHADER_STAGE_CLOSEST_HIT_BIT_KHR


-- No documentation found for TopLevel "VK_SHADER_STAGE_MISS_BIT_NV"
pattern $bSHADER_STAGE_MISS_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_MISS_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_MISS_BIT_NV = SHADER_STAGE_MISS_BIT_KHR


-- No documentation found for TopLevel "VK_SHADER_STAGE_INTERSECTION_BIT_NV"
pattern $bSHADER_STAGE_INTERSECTION_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_INTERSECTION_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_INTERSECTION_BIT_NV = SHADER_STAGE_INTERSECTION_BIT_KHR


-- No documentation found for TopLevel "VK_SHADER_STAGE_CALLABLE_BIT_NV"
pattern $bSHADER_STAGE_CALLABLE_BIT_NV :: ShaderStageFlagBits
$mSHADER_STAGE_CALLABLE_BIT_NV :: forall {r}.
ShaderStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_STAGE_CALLABLE_BIT_NV = SHADER_STAGE_CALLABLE_BIT_KHR


-- No documentation found for TopLevel "VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV"
pattern $bPIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV :: PipelineStageFlagBits
$mPIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV :: forall {r}.
PipelineStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR


-- No documentation found for TopLevel "VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV"
pattern $bPIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV :: PipelineStageFlagBits
$mPIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV :: forall {r}.
PipelineStageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR


-- No documentation found for TopLevel "VK_BUFFER_USAGE_RAY_TRACING_BIT_NV"
pattern $bBUFFER_USAGE_RAY_TRACING_BIT_NV :: BufferUsageFlagBits
$mBUFFER_USAGE_RAY_TRACING_BIT_NV :: forall {r}.
BufferUsageFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_USAGE_RAY_TRACING_BIT_NV = BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR


-- No documentation found for TopLevel "VK_PIPELINE_BIND_POINT_RAY_TRACING_NV"
pattern $bPIPELINE_BIND_POINT_RAY_TRACING_NV :: PipelineBindPoint
$mPIPELINE_BIND_POINT_RAY_TRACING_NV :: forall {r}. PipelineBindPoint -> ((# #) -> r) -> ((# #) -> r) -> r
PIPELINE_BIND_POINT_RAY_TRACING_NV = PIPELINE_BIND_POINT_RAY_TRACING_KHR


-- No documentation found for TopLevel "VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV"
pattern $bACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV :: AccessFlagBits
$mACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV :: forall {r}. AccessFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR


-- No documentation found for TopLevel "VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV"
pattern $bACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV :: AccessFlagBits
$mACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV :: forall {r}. AccessFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR


-- No documentation found for TopLevel "VK_INDEX_TYPE_NONE_NV"
pattern $bINDEX_TYPE_NONE_NV :: IndexType
$mINDEX_TYPE_NONE_NV :: forall {r}. IndexType -> ((# #) -> r) -> ((# #) -> r) -> r
INDEX_TYPE_NONE_NV = INDEX_TYPE_NONE_KHR


-- No documentation found for TopLevel "VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV"
pattern $bRAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV :: RayTracingShaderGroupTypeKHR
$mRAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV :: forall {r}.
RayTracingShaderGroupTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV = RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR


-- No documentation found for TopLevel "VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV"
pattern $bRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV :: RayTracingShaderGroupTypeKHR
$mRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV :: forall {r}.
RayTracingShaderGroupTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV = RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR


-- No documentation found for TopLevel "VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV"
pattern $bRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV :: RayTracingShaderGroupTypeKHR
$mRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV :: forall {r}.
RayTracingShaderGroupTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV = RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_TYPE_TRIANGLES_NV"
pattern $bGEOMETRY_TYPE_TRIANGLES_NV :: GeometryTypeKHR
$mGEOMETRY_TYPE_TRIANGLES_NV :: forall {r}. GeometryTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_TYPE_TRIANGLES_NV = GEOMETRY_TYPE_TRIANGLES_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_TYPE_AABBS_NV"
pattern $bGEOMETRY_TYPE_AABBS_NV :: GeometryTypeKHR
$mGEOMETRY_TYPE_AABBS_NV :: forall {r}. GeometryTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_TYPE_AABBS_NV = GEOMETRY_TYPE_AABBS_KHR


-- No documentation found for TopLevel "VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV"
pattern $bACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV :: AccelerationStructureTypeKHR
$mACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV :: forall {r}.
AccelerationStructureTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV = ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR


-- No documentation found for TopLevel "VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV"
pattern $bACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV :: AccelerationStructureTypeKHR
$mACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV :: forall {r}.
AccelerationStructureTypeKHR -> ((# #) -> r) -> ((# #) -> r) -> r
ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV = ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_OPAQUE_BIT_NV"
pattern $bGEOMETRY_OPAQUE_BIT_NV :: GeometryFlagBitsKHR
$mGEOMETRY_OPAQUE_BIT_NV :: forall {r}.
GeometryFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_OPAQUE_BIT_NV = GEOMETRY_OPAQUE_BIT_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV"
pattern $bGEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV :: GeometryFlagBitsKHR
$mGEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV :: forall {r}.
GeometryFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV = GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV"
pattern $bGEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV :: GeometryInstanceFlagBitsKHR
$mGEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV :: forall {r}.
GeometryInstanceFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV"
pattern $bGEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV :: GeometryInstanceFlagBitsKHR
$mGEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV :: forall {r}.
GeometryInstanceFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV"
pattern $bGEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV :: GeometryInstanceFlagBitsKHR
$mGEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV :: forall {r}.
GeometryInstanceFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV = GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR


-- No documentation found for TopLevel "VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV"
pattern $bGEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV :: GeometryInstanceFlagBitsKHR
$mGEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV :: forall {r}.
GeometryInstanceFlagBitsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV = GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR


-- No documentation found for TopLevel "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV"
pattern $bBUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV :: BuildAccelerationStructureFlagBitsKHR
$mBUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV :: forall {r}.
BuildAccelerationStructureFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR


-- No documentation found for TopLevel "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV"
pattern $bBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV :: BuildAccelerationStructureFlagBitsKHR
$mBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV :: forall {r}.
BuildAccelerationStructureFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR


-- No documentation found for TopLevel "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV"
pattern $bBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV :: BuildAccelerationStructureFlagBitsKHR
$mBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV :: forall {r}.
BuildAccelerationStructureFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR


-- No documentation found for TopLevel "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV"
pattern $bBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV :: BuildAccelerationStructureFlagBitsKHR
$mBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV :: forall {r}.
BuildAccelerationStructureFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV = BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR


-- No documentation found for TopLevel "VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV"
pattern $bBUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV :: BuildAccelerationStructureFlagBitsKHR
$mBUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV :: forall {r}.
BuildAccelerationStructureFlagBitsKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV = BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR


-- No documentation found for TopLevel "VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV"
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV :: forall {r}.
CopyAccelerationStructureModeKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV = COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR


-- No documentation found for TopLevel "VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV"
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV :: forall {r}.
CopyAccelerationStructureModeKHR
-> ((# #) -> r) -> ((# #) -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV = COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR


-- No documentation found for TopLevel "VK_SHADER_UNUSED_NV"
pattern $bSHADER_UNUSED_NV :: "shader" ::: Word32
$mSHADER_UNUSED_NV :: forall {r}.
("shader" ::: Word32) -> ((# #) -> r) -> ((# #) -> r) -> r
SHADER_UNUSED_NV = SHADER_UNUSED_KHR


-- No documentation found for TopLevel "vkGetRayTracingShaderGroupHandlesNV"
getRayTracingShaderGroupHandlesNV :: Device
-> Pipeline
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> ("data" ::: Ptr ())
-> io ()
getRayTracingShaderGroupHandlesNV = forall (io :: * -> *).
MonadIO io =>
Device
-> Pipeline
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> ("data" ::: Ptr ())
-> io ()
getRayTracingShaderGroupHandlesKHR


-- | VkRayTracingShaderGroupCreateInfoNV - Structure specifying shaders in a
-- shader group
--
-- == Valid Usage
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-type-02413# If @type@ is
--     'RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV' then @generalShader@
--     /must/ be a valid index into
--     'RayTracingPipelineCreateInfoNV'::@pStages@ referring to a shader of
--     'SHADER_STAGE_RAYGEN_BIT_NV', 'SHADER_STAGE_MISS_BIT_NV', or
--     'SHADER_STAGE_CALLABLE_BIT_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-type-02414# If @type@ is
--     'RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV' then @closestHitShader@,
--     @anyHitShader@, and @intersectionShader@ /must/ be
--     'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-type-02415# If @type@ is
--     'RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV' then
--     @intersectionShader@ /must/ be a valid index into
--     'RayTracingPipelineCreateInfoNV'::@pStages@ referring to a shader of
--     'SHADER_STAGE_INTERSECTION_BIT_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-type-02416# If @type@ is
--     'RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV' then
--     @intersectionShader@ /must/ be
--     'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-closestHitShader-02417#
--     @closestHitShader@ /must/ be either
--     'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' or a valid index into
--     'RayTracingPipelineCreateInfoNV'::@pStages@ referring to a shader of
--     'SHADER_STAGE_CLOSEST_HIT_BIT_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-anyHitShader-02418#
--     @anyHitShader@ /must/ be either
--     'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' or a valid index into
--     'RayTracingPipelineCreateInfoNV'::@pStages@ referring to a shader of
--     'SHADER_STAGE_ANY_HIT_BIT_NV'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV'
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkRayTracingShaderGroupCreateInfoNV-type-parameter# @type@
--     /must/ be a valid
--     'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingShaderGroupTypeKHR'
--     value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'RayTracingPipelineCreateInfoNV',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingShaderGroupTypeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data RayTracingShaderGroupCreateInfoNV = RayTracingShaderGroupCreateInfoNV
  { -- | @type@ is the type of hit group specified in this structure.
    RayTracingShaderGroupCreateInfoNV -> RayTracingShaderGroupTypeKHR
type' :: RayTracingShaderGroupTypeKHR
  , -- | @generalShader@ is the index of the ray generation, miss, or callable
    -- shader from 'RayTracingPipelineCreateInfoNV'::@pStages@ in the group if
    -- the shader group has @type@ of
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV', and
    -- 'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' otherwise.
    RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
generalShader :: Word32
  , -- | @closestHitShader@ is the optional index of the closest hit shader from
    -- 'RayTracingPipelineCreateInfoNV'::@pStages@ in the group if the shader
    -- group has @type@ of
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV' or
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV', and
    -- 'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' otherwise.
    RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
closestHitShader :: Word32
  , -- | @anyHitShader@ is the optional index of the any-hit shader from
    -- 'RayTracingPipelineCreateInfoNV'::@pStages@ in the group if the shader
    -- group has @type@ of
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV' or
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV', and
    -- 'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' otherwise.
    RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
anyHitShader :: Word32
  , -- | @intersectionShader@ is the index of the intersection shader from
    -- 'RayTracingPipelineCreateInfoNV'::@pStages@ in the group if the shader
    -- group has @type@ of
    -- 'RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV', and
    -- 'Vulkan.Core10.APIConstants.SHADER_UNUSED_NV' otherwise.
    RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
intersectionShader :: Word32
  }
  deriving (Typeable, RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> Bool
$c/= :: RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> Bool
== :: RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> Bool
$c== :: RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RayTracingShaderGroupCreateInfoNV)
#endif
deriving instance Show RayTracingShaderGroupCreateInfoNV

instance ToCStruct RayTracingShaderGroupCreateInfoNV where
  withCStruct :: forall b.
RayTracingShaderGroupCreateInfoNV
-> (Ptr RayTracingShaderGroupCreateInfoNV -> IO b) -> IO b
withCStruct RayTracingShaderGroupCreateInfoNV
x Ptr RayTracingShaderGroupCreateInfoNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr RayTracingShaderGroupCreateInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RayTracingShaderGroupCreateInfoNV
p RayTracingShaderGroupCreateInfoNV
x (Ptr RayTracingShaderGroupCreateInfoNV -> IO b
f Ptr RayTracingShaderGroupCreateInfoNV
p)
  pokeCStruct :: forall b.
Ptr RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> IO b -> IO b
pokeCStruct Ptr RayTracingShaderGroupCreateInfoNV
p RayTracingShaderGroupCreateInfoNV{"shader" ::: Word32
RayTracingShaderGroupTypeKHR
intersectionShader :: "shader" ::: Word32
anyHitShader :: "shader" ::: Word32
closestHitShader :: "shader" ::: Word32
generalShader :: "shader" ::: Word32
type' :: RayTracingShaderGroupTypeKHR
$sel:intersectionShader:RayTracingShaderGroupCreateInfoNV :: RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
$sel:anyHitShader:RayTracingShaderGroupCreateInfoNV :: RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
$sel:closestHitShader:RayTracingShaderGroupCreateInfoNV :: RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
$sel:generalShader:RayTracingShaderGroupCreateInfoNV :: RayTracingShaderGroupCreateInfoNV -> "shader" ::: Word32
$sel:type':RayTracingShaderGroupCreateInfoNV :: RayTracingShaderGroupCreateInfoNV -> RayTracingShaderGroupTypeKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RayTracingShaderGroupTypeKHR)) (RayTracingShaderGroupTypeKHR
type')
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("shader" ::: Word32
generalShader)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("shader" ::: Word32
closestHitShader)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("shader" ::: Word32
anyHitShader)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ("shader" ::: Word32
intersectionShader)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr RayTracingShaderGroupCreateInfoNV -> IO b -> IO b
pokeZeroCStruct Ptr RayTracingShaderGroupCreateInfoNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RayTracingShaderGroupTypeKHR)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct RayTracingShaderGroupCreateInfoNV where
  peekCStruct :: Ptr RayTracingShaderGroupCreateInfoNV
-> IO RayTracingShaderGroupCreateInfoNV
peekCStruct Ptr RayTracingShaderGroupCreateInfoNV
p = do
    RayTracingShaderGroupTypeKHR
type' <- forall a. Storable a => Ptr a -> IO a
peek @RayTracingShaderGroupTypeKHR ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RayTracingShaderGroupTypeKHR))
    "shader" ::: Word32
generalShader <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    "shader" ::: Word32
closestHitShader <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    "shader" ::: Word32
anyHitShader <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
    "shader" ::: Word32
intersectionShader <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RayTracingShaderGroupCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ RayTracingShaderGroupTypeKHR
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> RayTracingShaderGroupCreateInfoNV
RayTracingShaderGroupCreateInfoNV
             RayTracingShaderGroupTypeKHR
type'
             "shader" ::: Word32
generalShader
             "shader" ::: Word32
closestHitShader
             "shader" ::: Word32
anyHitShader
             "shader" ::: Word32
intersectionShader

instance Storable RayTracingShaderGroupCreateInfoNV where
  sizeOf :: RayTracingShaderGroupCreateInfoNV -> Int
sizeOf ~RayTracingShaderGroupCreateInfoNV
_ = Int
40
  alignment :: RayTracingShaderGroupCreateInfoNV -> Int
alignment ~RayTracingShaderGroupCreateInfoNV
_ = Int
8
  peek :: Ptr RayTracingShaderGroupCreateInfoNV
-> IO RayTracingShaderGroupCreateInfoNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr RayTracingShaderGroupCreateInfoNV
-> RayTracingShaderGroupCreateInfoNV -> IO ()
poke Ptr RayTracingShaderGroupCreateInfoNV
ptr RayTracingShaderGroupCreateInfoNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RayTracingShaderGroupCreateInfoNV
ptr RayTracingShaderGroupCreateInfoNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero RayTracingShaderGroupCreateInfoNV where
  zero :: RayTracingShaderGroupCreateInfoNV
zero = RayTracingShaderGroupTypeKHR
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> RayTracingShaderGroupCreateInfoNV
RayTracingShaderGroupCreateInfoNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkRayTracingPipelineCreateInfoNV - Structure specifying parameters of a
-- newly created ray tracing pipeline
--
-- = Description
--
-- The parameters @basePipelineHandle@ and @basePipelineIndex@ are
-- described in more detail in
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-pipeline-derivatives Pipeline Derivatives>.
--
-- If a
-- 'Vulkan.Extensions.VK_KHR_maintenance5.PipelineCreateFlags2CreateInfoKHR'
-- structure is present in the @pNext@ chain,
-- 'Vulkan.Extensions.VK_KHR_maintenance5.PipelineCreateFlags2CreateInfoKHR'::@flags@
-- from that structure is used instead of @flags@ from this structure.
--
-- == Valid Usage
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-07984# If @flags@
--     contains the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DERIVATIVE_BIT'
--     flag, and @basePipelineIndex@ is -1, @basePipelineHandle@ /must/ be
--     a valid ray tracing 'Vulkan.Core10.Handles.Pipeline' handle
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-07985# If @flags@
--     contains the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DERIVATIVE_BIT'
--     flag, and @basePipelineHandle@ is
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @basePipelineIndex@ /must/
--     be a valid index into the calling command’s @pCreateInfos@ parameter
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-07986# If @flags@
--     contains the
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DERIVATIVE_BIT'
--     flag, @basePipelineIndex@ /must/ be -1 or @basePipelineHandle@
--     /must/ be 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-07987# If a push
--     constant block is declared in a shader, a push constant range in
--     @layout@ /must/ match both the shader stage and range
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-07988# If a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-resources resource variables>
--     is declared in a shader, a descriptor slot in @layout@ /must/ match
--     the shader stage
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-07990# If a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-resources resource variables>
--     is declared in a shader, and the descriptor type is not
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_MUTABLE_EXT', a
--     descriptor slot in @layout@ /must/ match the descriptor type
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-07991# If a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-resources resource variables>
--     is declared in a shader as an array, a descriptor slot in @layout@
--     /must/ match the descriptor count
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pStages-03426# The shader
--     code for the entry points identified by @pStages@, and the rest of
--     the state identified by this structure /must/ adhere to the pipeline
--     linking rules described in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces Shader Interfaces>
--     chapter
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-03428# The number of
--     resources in @layout@ accessible to each shader stage that is used
--     by the pipeline /must/ be less than or equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPerStageResources@
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-02904# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pipelineCreationCacheControl-02905#
--     If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-pipelineCreationCacheControl pipelineCreationCacheControl>
--     feature is not enabled, @flags@ /must/ not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT'
--     or
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-stage-06232# The @stage@
--     member of at least one element of @pStages@ /must/ be
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_RAYGEN_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03456# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_LIBRARY_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-maxRecursionDepth-03457#
--     @maxRecursionDepth@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxRecursionDepth@
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03458# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03459# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03460# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03461# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03462# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03463# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-03588# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-04948# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-02957# @flags@ /must/
--     not include both
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DEFER_COMPILE_BIT_NV'
--     and
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT'
--     at the same time
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pipelineStageCreationFeedbackCount-06651#
--     If
--     'Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback.PipelineCreationFeedbackCreateInfo'::@pipelineStageCreationFeedbackCount@
--     is not @0@, it /must/ be equal to @stageCount@
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-stage-06898# The @stage@
--     value in all @pStages@ elements /must/ be one of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_RAYGEN_BIT_KHR',
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_ANY_HIT_BIT_KHR',
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_CLOSEST_HIT_BIT_KHR',
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_MISS_BIT_KHR',
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_INTERSECTION_BIT_KHR',
--     or
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_CALLABLE_BIT_KHR'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-07402# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-07998# @flags@ /must/
--     not include
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pNext-pNext# Each @pNext@
--     member of any structure (including this one) in the @pNext@ chain
--     /must/ be either @NULL@ or a pointer to a valid instance of
--     'Vulkan.Extensions.VK_KHR_maintenance5.PipelineCreateFlags2CreateInfoKHR'
--     or
--     'Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback.PipelineCreationFeedbackCreateInfo'
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-sType-unique# The @sType@
--     value of each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-flags-parameter# @flags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PipelineCreateFlagBits'
--     values
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pStages-parameter# @pStages@
--     /must/ be a valid pointer to an array of @stageCount@ valid
--     'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo' structures
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-pGroups-parameter# @pGroups@
--     /must/ be a valid pointer to an array of @groupCount@ valid
--     'RayTracingShaderGroupCreateInfoNV' structures
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-layout-parameter# @layout@
--     /must/ be a valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-stageCount-arraylength#
--     @stageCount@ /must/ be greater than @0@
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-groupCount-arraylength#
--     @groupCount@ /must/ be greater than @0@
--
-- -   #VUID-VkRayTracingPipelineCreateInfoNV-commonparent# Both of
--     @basePipelineHandle@, and @layout@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Enums.PipelineCreateFlagBits.PipelineCreateFlags',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo',
-- 'RayTracingShaderGroupCreateInfoNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createRayTracingPipelinesNV'
data RayTracingPipelineCreateInfoNV (es :: [Type]) = RayTracingPipelineCreateInfoNV
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.PipelineCreateFlagBits.PipelineCreateFlagBits'
    -- specifying how the pipeline will be generated.
    forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineCreateFlags
flags :: PipelineCreateFlags
  , -- | @pStages@ is a pointer to an array of
    -- 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo' structures
    -- specifying the set of the shader stages to be included in the ray
    -- tracing pipeline.
    forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
  , -- | @pGroups@ is a pointer to an array of
    -- 'RayTracingShaderGroupCreateInfoNV' structures describing the set of the
    -- shader stages to be included in each shader group in the ray tracing
    -- pipeline.
    forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector RayTracingShaderGroupCreateInfoNV
groups :: Vector RayTracingShaderGroupCreateInfoNV
  , -- | @maxRecursionDepth@ is the
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#ray-tracing-recursion-depth maximum recursion depth>
    -- of shaders executed by this pipeline.
    forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> "shader" ::: Word32
maxRecursionDepth :: Word32
  , -- | @layout@ is the description of binding locations used by both the
    -- pipeline and descriptor sets used with the pipeline.
    forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineLayout
layout :: PipelineLayout
  , -- | @basePipelineHandle@ is a pipeline to derive from.
    forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Pipeline
basePipelineHandle :: Pipeline
  , -- | @basePipelineIndex@ is an index into the @pCreateInfos@ parameter to use
    -- as a pipeline to derive from.
    forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Int32
basePipelineIndex :: Int32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RayTracingPipelineCreateInfoNV (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (RayTracingPipelineCreateInfoNV es)

instance Extensible RayTracingPipelineCreateInfoNV where
  extensibleTypeName :: String
extensibleTypeName = String
"RayTracingPipelineCreateInfoNV"
  setNext :: forall (ds :: [*]) (es :: [*]).
RayTracingPipelineCreateInfoNV ds
-> Chain es -> RayTracingPipelineCreateInfoNV es
setNext RayTracingPipelineCreateInfoNV{Int32
"shader" ::: Word32
Vector RayTracingShaderGroupCreateInfoNV
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain ds
PipelineLayout
Pipeline
PipelineCreateFlags
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
maxRecursionDepth :: "shader" ::: Word32
groups :: Vector RayTracingShaderGroupCreateInfoNV
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain ds
$sel:basePipelineIndex:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Int32
$sel:basePipelineHandle:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Pipeline
$sel:layout:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineLayout
$sel:maxRecursionDepth:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> "shader" ::: Word32
$sel:groups:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector RayTracingShaderGroupCreateInfoNV
$sel:stages:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineCreateFlags
$sel:next:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Chain es
..} Chain es
next' = RayTracingPipelineCreateInfoNV{$sel:next:RayTracingPipelineCreateInfoNV :: Chain es
next = Chain es
next', Int32
"shader" ::: Word32
Vector RayTracingShaderGroupCreateInfoNV
Vector (SomeStruct PipelineShaderStageCreateInfo)
PipelineLayout
Pipeline
PipelineCreateFlags
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
maxRecursionDepth :: "shader" ::: Word32
groups :: Vector RayTracingShaderGroupCreateInfoNV
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
$sel:basePipelineIndex:RayTracingPipelineCreateInfoNV :: Int32
$sel:basePipelineHandle:RayTracingPipelineCreateInfoNV :: Pipeline
$sel:layout:RayTracingPipelineCreateInfoNV :: PipelineLayout
$sel:maxRecursionDepth:RayTracingPipelineCreateInfoNV :: "shader" ::: Word32
$sel:groups:RayTracingPipelineCreateInfoNV :: Vector RayTracingShaderGroupCreateInfoNV
$sel:stages:RayTracingPipelineCreateInfoNV :: Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:RayTracingPipelineCreateInfoNV :: PipelineCreateFlags
..}
  getNext :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Chain es
getNext RayTracingPipelineCreateInfoNV{Int32
"shader" ::: Word32
Vector RayTracingShaderGroupCreateInfoNV
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
PipelineLayout
Pipeline
PipelineCreateFlags
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
maxRecursionDepth :: "shader" ::: Word32
groups :: Vector RayTracingShaderGroupCreateInfoNV
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Int32
$sel:basePipelineHandle:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Pipeline
$sel:layout:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineLayout
$sel:maxRecursionDepth:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> "shader" ::: Word32
$sel:groups:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector RayTracingShaderGroupCreateInfoNV
$sel:stages:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineCreateFlags
$sel:next:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends RayTracingPipelineCreateInfoNV e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends RayTracingPipelineCreateInfoNV e => b) -> Maybe b
extends proxy e
_ Extends RayTracingPipelineCreateInfoNV e => b
f
    | Just e :~: PipelineCreationFeedbackCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreationFeedbackCreateInfo = forall a. a -> Maybe a
Just Extends RayTracingPipelineCreateInfoNV e => b
f
    | Just e :~: PipelineCreateFlags2CreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreateFlags2CreateInfoKHR = forall a. a -> Maybe a
Just Extends RayTracingPipelineCreateInfoNV e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss RayTracingPipelineCreateInfoNV es
         , PokeChain es ) => ToCStruct (RayTracingPipelineCreateInfoNV es) where
  withCStruct :: forall b.
RayTracingPipelineCreateInfoNV es
-> (Ptr (RayTracingPipelineCreateInfoNV es) -> IO b) -> IO b
withCStruct RayTracingPipelineCreateInfoNV es
x Ptr (RayTracingPipelineCreateInfoNV es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 forall a b. (a -> b) -> a -> b
$ \Ptr (RayTracingPipelineCreateInfoNV es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (RayTracingPipelineCreateInfoNV es)
p RayTracingPipelineCreateInfoNV es
x (Ptr (RayTracingPipelineCreateInfoNV es) -> IO b
f Ptr (RayTracingPipelineCreateInfoNV es)
p)
  pokeCStruct :: forall b.
Ptr (RayTracingPipelineCreateInfoNV es)
-> RayTracingPipelineCreateInfoNV es -> IO b -> IO b
pokeCStruct Ptr (RayTracingPipelineCreateInfoNV es)
p RayTracingPipelineCreateInfoNV{Int32
"shader" ::: Word32
Vector RayTracingShaderGroupCreateInfoNV
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
PipelineLayout
Pipeline
PipelineCreateFlags
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
maxRecursionDepth :: "shader" ::: Word32
groups :: Vector RayTracingShaderGroupCreateInfoNV
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Int32
$sel:basePipelineHandle:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Pipeline
$sel:layout:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineLayout
$sel:maxRecursionDepth:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> "shader" ::: Word32
$sel:groups:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector RayTracingShaderGroupCreateInfoNV
$sel:stages:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:RayTracingPipelineCreateInfoNV :: forall (es :: [*]).
RayTracingPipelineCreateInfoNV es -> PipelineCreateFlags
$sel:next:RayTracingPipelineCreateInfoNV :: forall (es :: [*]). RayTracingPipelineCreateInfoNV es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV)
    "data" ::: Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags)) (PipelineCreateFlags
flags)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) :: Word32))
    Ptr (PipelineShaderStageCreateInfo Any)
pPStages' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(PipelineShaderStageCreateInfo _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) forall a. Num a => a -> a -> a
* Int
48)
    forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct PipelineShaderStageCreateInfo
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineShaderStageCreateInfo Any)
pPStages' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _))) (SomeStruct PipelineShaderStageCreateInfo
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _)))) (Ptr (PipelineShaderStageCreateInfo Any)
pPStages')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector RayTracingShaderGroupCreateInfoNV
groups)) :: Word32))
    Ptr RayTracingShaderGroupCreateInfoNV
pPGroups' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @RayTracingShaderGroupCreateInfoNV ((forall a. Vector a -> Int
Data.Vector.length (Vector RayTracingShaderGroupCreateInfoNV
groups)) forall a. Num a => a -> a -> a
* Int
40)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i RayTracingShaderGroupCreateInfoNV
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RayTracingShaderGroupCreateInfoNV
pPGroups' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
40 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr RayTracingShaderGroupCreateInfoNV) (RayTracingShaderGroupCreateInfoNV
e)) (Vector RayTracingShaderGroupCreateInfoNV
groups)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr RayTracingShaderGroupCreateInfoNV))) (Ptr RayTracingShaderGroupCreateInfoNV
pPGroups')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) ("shader" ::: Word32
maxRecursionDepth)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Pipeline)) (Pipeline
basePipelineHandle)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Int32)) (Int32
basePipelineIndex)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
80
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (RayTracingPipelineCreateInfoNV es) -> IO b -> IO b
pokeZeroCStruct Ptr (RayTracingPipelineCreateInfoNV es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV)
    "data" ::: Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr PipelineLayout)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Int32)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss RayTracingPipelineCreateInfoNV es
         , PeekChain es ) => FromCStruct (RayTracingPipelineCreateInfoNV es) where
  peekCStruct :: Ptr (RayTracingPipelineCreateInfoNV es)
-> IO (RayTracingPipelineCreateInfoNV es)
peekCStruct Ptr (RayTracingPipelineCreateInfoNV es)
p = do
    "data" ::: Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr "data" ::: Ptr ()
pNext)
    PipelineCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineCreateFlags ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags))
    "shader" ::: Word32
stageCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    Ptr (PipelineShaderStageCreateInfo Any)
pStages <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineShaderStageCreateInfo _)) ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _))))
    Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "shader" ::: Word32
stageCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (PipelineShaderStageCreateInfo Any)
pStages forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _)))))
    "shader" ::: Word32
groupCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    Ptr RayTracingShaderGroupCreateInfoNV
pGroups <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr RayTracingShaderGroupCreateInfoNV) ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr RayTracingShaderGroupCreateInfoNV)))
    Vector RayTracingShaderGroupCreateInfoNV
pGroups' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "shader" ::: Word32
groupCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @RayTracingShaderGroupCreateInfoNV ((Ptr RayTracingShaderGroupCreateInfoNV
pGroups forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
40 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr RayTracingShaderGroupCreateInfoNV)))
    "shader" ::: Word32
maxRecursionDepth <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32))
    PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr PipelineLayout))
    Pipeline
basePipelineHandle <- forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Pipeline))
    Int32
basePipelineIndex <- forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (RayTracingPipelineCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Int32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Vector RayTracingShaderGroupCreateInfoNV
-> ("shader" ::: Word32)
-> PipelineLayout
-> Pipeline
-> Int32
-> RayTracingPipelineCreateInfoNV es
RayTracingPipelineCreateInfoNV
             Chain es
next
             PipelineCreateFlags
flags
             Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages'
             Vector RayTracingShaderGroupCreateInfoNV
pGroups'
             "shader" ::: Word32
maxRecursionDepth
             PipelineLayout
layout
             Pipeline
basePipelineHandle
             Int32
basePipelineIndex

instance es ~ '[] => Zero (RayTracingPipelineCreateInfoNV es) where
  zero :: RayTracingPipelineCreateInfoNV es
zero = forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Vector RayTracingShaderGroupCreateInfoNV
-> ("shader" ::: Word32)
-> PipelineLayout
-> Pipeline
-> Int32
-> RayTracingPipelineCreateInfoNV es
RayTracingPipelineCreateInfoNV
           ()
           forall a. Zero a => a
zero
           forall a. Monoid a => a
mempty
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkGeometryTrianglesNV - Structure specifying a triangle geometry in a
-- bottom-level acceleration structure
--
-- = Description
--
-- If @indexType@ is 'INDEX_TYPE_NONE_NV', then this structure describes a
-- set of triangles determined by @vertexCount@. Otherwise, this structure
-- describes a set of indexed triangles determined by @indexCount@.
--
-- == Valid Usage
--
-- -   #VUID-VkGeometryTrianglesNV-vertexOffset-02428# @vertexOffset@
--     /must/ be less than the size of @vertexData@
--
-- -   #VUID-VkGeometryTrianglesNV-vertexOffset-02429# @vertexOffset@
--     /must/ be a multiple of the component size of @vertexFormat@
--
-- -   #VUID-VkGeometryTrianglesNV-vertexFormat-02430# @vertexFormat@
--     /must/ be one of
--     'Vulkan.Core10.Enums.Format.FORMAT_R32G32B32_SFLOAT',
--     'Vulkan.Core10.Enums.Format.FORMAT_R32G32_SFLOAT',
--     'Vulkan.Core10.Enums.Format.FORMAT_R16G16B16_SFLOAT',
--     'Vulkan.Core10.Enums.Format.FORMAT_R16G16_SFLOAT',
--     'Vulkan.Core10.Enums.Format.FORMAT_R16G16_SNORM', or
--     'Vulkan.Core10.Enums.Format.FORMAT_R16G16B16_SNORM'
--
-- -   #VUID-VkGeometryTrianglesNV-vertexStride-03818# @vertexStride@
--     /must/ be less than or equal to 232-1
--
-- -   #VUID-VkGeometryTrianglesNV-indexOffset-02431# @indexOffset@ /must/
--     be less than the size of @indexData@
--
-- -   #VUID-VkGeometryTrianglesNV-indexOffset-02432# @indexOffset@ /must/
--     be a multiple of the element size of @indexType@
--
-- -   #VUID-VkGeometryTrianglesNV-indexType-02433# @indexType@ /must/ be
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT16',
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT32', or
--     'INDEX_TYPE_NONE_NV'
--
-- -   #VUID-VkGeometryTrianglesNV-indexData-02434# @indexData@ /must/ be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' if @indexType@ is
--     'INDEX_TYPE_NONE_NV'
--
-- -   #VUID-VkGeometryTrianglesNV-indexData-02435# @indexData@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Buffer' handle if @indexType@ is not
--     'INDEX_TYPE_NONE_NV'
--
-- -   #VUID-VkGeometryTrianglesNV-indexCount-02436# @indexCount@ /must/ be
--     @0@ if @indexType@ is 'INDEX_TYPE_NONE_NV'
--
-- -   #VUID-VkGeometryTrianglesNV-transformOffset-02437# @transformOffset@
--     /must/ be less than the size of @transformData@
--
-- -   #VUID-VkGeometryTrianglesNV-transformOffset-02438# @transformOffset@
--     /must/ be a multiple of @16@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkGeometryTrianglesNV-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV'
--
-- -   #VUID-VkGeometryTrianglesNV-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkGeometryTrianglesNV-vertexData-parameter# If @vertexData@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @vertexData@ /must/ be
--     a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkGeometryTrianglesNV-vertexFormat-parameter# @vertexFormat@
--     /must/ be a valid 'Vulkan.Core10.Enums.Format.Format' value
--
-- -   #VUID-VkGeometryTrianglesNV-indexData-parameter# If @indexData@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @indexData@ /must/ be
--     a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkGeometryTrianglesNV-indexType-parameter# @indexType@ /must/
--     be a valid 'Vulkan.Core10.Enums.IndexType.IndexType' value
--
-- -   #VUID-VkGeometryTrianglesNV-transformData-parameter# If
--     @transformData@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @transformData@ /must/ be a valid 'Vulkan.Core10.Handles.Buffer'
--     handle
--
-- -   #VUID-VkGeometryTrianglesNV-commonparent# Each of @indexData@,
--     @transformData@, and @vertexData@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.Format.Format', 'GeometryDataNV',
-- 'Vulkan.Core10.Enums.IndexType.IndexType',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data GeometryTrianglesNV = GeometryTrianglesNV
  { -- | @vertexData@ is the buffer containing vertex data for this geometry.
    GeometryTrianglesNV -> "instanceData" ::: Buffer
vertexData :: Buffer
  , -- | @vertexOffset@ is the offset in bytes within @vertexData@ containing
    -- vertex data for this geometry.
    GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
vertexOffset :: DeviceSize
  , -- | @vertexCount@ is the number of valid vertices.
    GeometryTrianglesNV -> "shader" ::: Word32
vertexCount :: Word32
  , -- | @vertexStride@ is the stride in bytes between each vertex.
    GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
vertexStride :: DeviceSize
  , -- | @vertexFormat@ is a 'Vulkan.Core10.Enums.Format.Format' describing the
    -- format of each vertex element.
    GeometryTrianglesNV -> Format
vertexFormat :: Format
  , -- | @indexData@ is the buffer containing index data for this geometry.
    GeometryTrianglesNV -> "instanceData" ::: Buffer
indexData :: Buffer
  , -- | @indexOffset@ is the offset in bytes within @indexData@ containing index
    -- data for this geometry.
    GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
indexOffset :: DeviceSize
  , -- | @indexCount@ is the number of indices to include in this geometry.
    GeometryTrianglesNV -> "shader" ::: Word32
indexCount :: Word32
  , -- | @indexType@ is a 'Vulkan.Core10.Enums.IndexType.IndexType' describing
    -- the format of each index.
    GeometryTrianglesNV -> IndexType
indexType :: IndexType
  , -- | @transformData@ is an optional buffer containing an 'TransformMatrixNV'
    -- structure defining a transformation to be applied to this geometry.
    GeometryTrianglesNV -> "instanceData" ::: Buffer
transformData :: Buffer
  , -- | @transformOffset@ is the offset in bytes in @transformData@ of the
    -- transform information described above.
    GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
transformOffset :: DeviceSize
  }
  deriving (Typeable, GeometryTrianglesNV -> GeometryTrianglesNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeometryTrianglesNV -> GeometryTrianglesNV -> Bool
$c/= :: GeometryTrianglesNV -> GeometryTrianglesNV -> Bool
== :: GeometryTrianglesNV -> GeometryTrianglesNV -> Bool
$c== :: GeometryTrianglesNV -> GeometryTrianglesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GeometryTrianglesNV)
#endif
deriving instance Show GeometryTrianglesNV

instance ToCStruct GeometryTrianglesNV where
  withCStruct :: forall b.
GeometryTrianglesNV -> (Ptr GeometryTrianglesNV -> IO b) -> IO b
withCStruct GeometryTrianglesNV
x Ptr GeometryTrianglesNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
96 forall a b. (a -> b) -> a -> b
$ \Ptr GeometryTrianglesNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryTrianglesNV
p GeometryTrianglesNV
x (Ptr GeometryTrianglesNV -> IO b
f Ptr GeometryTrianglesNV
p)
  pokeCStruct :: forall b.
Ptr GeometryTrianglesNV -> GeometryTrianglesNV -> IO b -> IO b
pokeCStruct Ptr GeometryTrianglesNV
p GeometryTrianglesNV{"shader" ::: Word32
"instanceOffset" ::: DeviceSize
Format
IndexType
"instanceData" ::: Buffer
transformOffset :: "instanceOffset" ::: DeviceSize
transformData :: "instanceData" ::: Buffer
indexType :: IndexType
indexCount :: "shader" ::: Word32
indexOffset :: "instanceOffset" ::: DeviceSize
indexData :: "instanceData" ::: Buffer
vertexFormat :: Format
vertexStride :: "instanceOffset" ::: DeviceSize
vertexCount :: "shader" ::: Word32
vertexOffset :: "instanceOffset" ::: DeviceSize
vertexData :: "instanceData" ::: Buffer
$sel:transformOffset:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
$sel:transformData:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceData" ::: Buffer
$sel:indexType:GeometryTrianglesNV :: GeometryTrianglesNV -> IndexType
$sel:indexCount:GeometryTrianglesNV :: GeometryTrianglesNV -> "shader" ::: Word32
$sel:indexOffset:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
$sel:indexData:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceData" ::: Buffer
$sel:vertexFormat:GeometryTrianglesNV :: GeometryTrianglesNV -> Format
$sel:vertexStride:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
$sel:vertexCount:GeometryTrianglesNV :: GeometryTrianglesNV -> "shader" ::: Word32
$sel:vertexOffset:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceOffset" ::: DeviceSize
$sel:vertexData:GeometryTrianglesNV :: GeometryTrianglesNV -> "instanceData" ::: Buffer
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) ("instanceData" ::: Buffer
vertexData)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
vertexOffset)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ("shader" ::: Word32
vertexCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
vertexStride)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Format)) (Format
vertexFormat)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Buffer)) ("instanceData" ::: Buffer
indexData)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
indexOffset)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) ("shader" ::: Word32
indexCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
76 :: Ptr IndexType)) (IndexType
indexType)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Buffer)) ("instanceData" ::: Buffer
transformData)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
transformOffset)
    IO b
f
  cStructSize :: Int
cStructSize = Int
96
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr GeometryTrianglesNV -> IO b -> IO b
pokeZeroCStruct Ptr GeometryTrianglesNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Format)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
76 :: Ptr IndexType)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GeometryTrianglesNV where
  peekCStruct :: Ptr GeometryTrianglesNV -> IO GeometryTrianglesNV
peekCStruct Ptr GeometryTrianglesNV
p = do
    "instanceData" ::: Buffer
vertexData <- forall a. Storable a => Ptr a -> IO a
peek @Buffer ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer))
    "instanceOffset" ::: DeviceSize
vertexOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize))
    "shader" ::: Word32
vertexCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    "instanceOffset" ::: DeviceSize
vertexStride <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize))
    Format
vertexFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Format))
    "instanceData" ::: Buffer
indexData <- forall a. Storable a => Ptr a -> IO a
peek @Buffer ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Buffer))
    "instanceOffset" ::: DeviceSize
indexOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr DeviceSize))
    "shader" ::: Word32
indexCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32))
    IndexType
indexType <- forall a. Storable a => Ptr a -> IO a
peek @IndexType ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
76 :: Ptr IndexType))
    "instanceData" ::: Buffer
transformData <- forall a. Storable a => Ptr a -> IO a
peek @Buffer ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Buffer))
    "instanceOffset" ::: DeviceSize
transformOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr GeometryTrianglesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr DeviceSize))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> Format
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> IndexType
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> GeometryTrianglesNV
GeometryTrianglesNV
             "instanceData" ::: Buffer
vertexData
             "instanceOffset" ::: DeviceSize
vertexOffset
             "shader" ::: Word32
vertexCount
             "instanceOffset" ::: DeviceSize
vertexStride
             Format
vertexFormat
             "instanceData" ::: Buffer
indexData
             "instanceOffset" ::: DeviceSize
indexOffset
             "shader" ::: Word32
indexCount
             IndexType
indexType
             "instanceData" ::: Buffer
transformData
             "instanceOffset" ::: DeviceSize
transformOffset

instance Storable GeometryTrianglesNV where
  sizeOf :: GeometryTrianglesNV -> Int
sizeOf ~GeometryTrianglesNV
_ = Int
96
  alignment :: GeometryTrianglesNV -> Int
alignment ~GeometryTrianglesNV
_ = Int
8
  peek :: Ptr GeometryTrianglesNV -> IO GeometryTrianglesNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GeometryTrianglesNV -> GeometryTrianglesNV -> IO ()
poke Ptr GeometryTrianglesNV
ptr GeometryTrianglesNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryTrianglesNV
ptr GeometryTrianglesNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GeometryTrianglesNV where
  zero :: GeometryTrianglesNV
zero = ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> Format
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> IndexType
-> ("instanceData" ::: Buffer)
-> ("instanceOffset" ::: DeviceSize)
-> GeometryTrianglesNV
GeometryTrianglesNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkGeometryAABBNV - Structure specifying axis-aligned bounding box
-- geometry in a bottom-level acceleration structure
--
-- = Description
--
-- The AABB data in memory is six 32-bit floats consisting of the minimum
-- x, y, and z values followed by the maximum x, y, and z values.
--
-- == Valid Usage
--
-- -   #VUID-VkGeometryAABBNV-offset-02439# @offset@ /must/ be less than
--     the size of @aabbData@
--
-- -   #VUID-VkGeometryAABBNV-offset-02440# @offset@ /must/ be a multiple
--     of @8@
--
-- -   #VUID-VkGeometryAABBNV-stride-02441# @stride@ /must/ be a multiple
--     of @8@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkGeometryAABBNV-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GEOMETRY_AABB_NV'
--
-- -   #VUID-VkGeometryAABBNV-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkGeometryAABBNV-aabbData-parameter# If @aabbData@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @aabbData@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize', 'GeometryDataNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data GeometryAABBNV = GeometryAABBNV
  { -- | @aabbData@ is the buffer containing axis-aligned bounding box data.
    GeometryAABBNV -> "instanceData" ::: Buffer
aabbData :: Buffer
  , -- | @numAABBs@ is the number of AABBs in this geometry.
    GeometryAABBNV -> "shader" ::: Word32
numAABBs :: Word32
  , -- | @stride@ is the stride in bytes between AABBs in @aabbData@.
    GeometryAABBNV -> "shader" ::: Word32
stride :: Word32
  , -- | @offset@ is the offset in bytes of the first AABB in @aabbData@.
    GeometryAABBNV -> "instanceOffset" ::: DeviceSize
offset :: DeviceSize
  }
  deriving (Typeable, GeometryAABBNV -> GeometryAABBNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeometryAABBNV -> GeometryAABBNV -> Bool
$c/= :: GeometryAABBNV -> GeometryAABBNV -> Bool
== :: GeometryAABBNV -> GeometryAABBNV -> Bool
$c== :: GeometryAABBNV -> GeometryAABBNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GeometryAABBNV)
#endif
deriving instance Show GeometryAABBNV

instance ToCStruct GeometryAABBNV where
  withCStruct :: forall b. GeometryAABBNV -> (Ptr GeometryAABBNV -> IO b) -> IO b
withCStruct GeometryAABBNV
x Ptr GeometryAABBNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr GeometryAABBNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryAABBNV
p GeometryAABBNV
x (Ptr GeometryAABBNV -> IO b
f Ptr GeometryAABBNV
p)
  pokeCStruct :: forall b. Ptr GeometryAABBNV -> GeometryAABBNV -> IO b -> IO b
pokeCStruct Ptr GeometryAABBNV
p GeometryAABBNV{"shader" ::: Word32
"instanceOffset" ::: DeviceSize
"instanceData" ::: Buffer
offset :: "instanceOffset" ::: DeviceSize
stride :: "shader" ::: Word32
numAABBs :: "shader" ::: Word32
aabbData :: "instanceData" ::: Buffer
$sel:offset:GeometryAABBNV :: GeometryAABBNV -> "instanceOffset" ::: DeviceSize
$sel:stride:GeometryAABBNV :: GeometryAABBNV -> "shader" ::: Word32
$sel:numAABBs:GeometryAABBNV :: GeometryAABBNV -> "shader" ::: Word32
$sel:aabbData:GeometryAABBNV :: GeometryAABBNV -> "instanceData" ::: Buffer
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_AABB_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) ("instanceData" ::: Buffer
aabbData)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("shader" ::: Word32
numAABBs)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("shader" ::: Word32
stride)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
offset)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr GeometryAABBNV -> IO b -> IO b
pokeZeroCStruct Ptr GeometryAABBNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_AABB_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GeometryAABBNV where
  peekCStruct :: Ptr GeometryAABBNV -> IO GeometryAABBNV
peekCStruct Ptr GeometryAABBNV
p = do
    "instanceData" ::: Buffer
aabbData <- forall a. Storable a => Ptr a -> IO a
peek @Buffer ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer))
    "shader" ::: Word32
numAABBs <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    "shader" ::: Word32
stride <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
    "instanceOffset" ::: DeviceSize
offset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr GeometryAABBNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("instanceData" ::: Buffer)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> GeometryAABBNV
GeometryAABBNV
             "instanceData" ::: Buffer
aabbData "shader" ::: Word32
numAABBs "shader" ::: Word32
stride "instanceOffset" ::: DeviceSize
offset

instance Storable GeometryAABBNV where
  sizeOf :: GeometryAABBNV -> Int
sizeOf ~GeometryAABBNV
_ = Int
40
  alignment :: GeometryAABBNV -> Int
alignment ~GeometryAABBNV
_ = Int
8
  peek :: Ptr GeometryAABBNV -> IO GeometryAABBNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GeometryAABBNV -> GeometryAABBNV -> IO ()
poke Ptr GeometryAABBNV
ptr GeometryAABBNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryAABBNV
ptr GeometryAABBNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GeometryAABBNV where
  zero :: GeometryAABBNV
zero = ("instanceData" ::: Buffer)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> GeometryAABBNV
GeometryAABBNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkGeometryDataNV - Structure specifying geometry in a bottom-level
-- acceleration structure
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'GeometryAABBNV', 'GeometryNV', 'GeometryTrianglesNV'
data GeometryDataNV = GeometryDataNV
  { -- | @triangles@ contains triangle data if 'GeometryNV'::@geometryType@ is
    -- 'GEOMETRY_TYPE_TRIANGLES_NV'.
    --
    -- #VUID-VkGeometryDataNV-triangles-parameter# @triangles@ /must/ be a
    -- valid 'GeometryTrianglesNV' structure
    GeometryDataNV -> GeometryTrianglesNV
triangles :: GeometryTrianglesNV
  , -- | @aabbs@ contains axis-aligned bounding box data if
    -- 'GeometryNV'::@geometryType@ is 'GEOMETRY_TYPE_AABBS_NV'.
    --
    -- #VUID-VkGeometryDataNV-aabbs-parameter# @aabbs@ /must/ be a valid
    -- 'GeometryAABBNV' structure
    GeometryDataNV -> GeometryAABBNV
aabbs :: GeometryAABBNV
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GeometryDataNV)
#endif
deriving instance Show GeometryDataNV

instance ToCStruct GeometryDataNV where
  withCStruct :: forall b. GeometryDataNV -> (Ptr GeometryDataNV -> IO b) -> IO b
withCStruct GeometryDataNV
x Ptr GeometryDataNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
136 forall a b. (a -> b) -> a -> b
$ \Ptr GeometryDataNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryDataNV
p GeometryDataNV
x (Ptr GeometryDataNV -> IO b
f Ptr GeometryDataNV
p)
  pokeCStruct :: forall b. Ptr GeometryDataNV -> GeometryDataNV -> IO b -> IO b
pokeCStruct Ptr GeometryDataNV
p GeometryDataNV{GeometryTrianglesNV
GeometryAABBNV
aabbs :: GeometryAABBNV
triangles :: GeometryTrianglesNV
$sel:aabbs:GeometryDataNV :: GeometryDataNV -> GeometryAABBNV
$sel:triangles:GeometryDataNV :: GeometryDataNV -> GeometryTrianglesNV
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr GeometryTrianglesNV)) (GeometryTrianglesNV
triangles)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr GeometryAABBNV)) (GeometryAABBNV
aabbs)
    IO b
f
  cStructSize :: Int
cStructSize = Int
136
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr GeometryDataNV -> IO b -> IO b
pokeZeroCStruct Ptr GeometryDataNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr GeometryTrianglesNV)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr GeometryAABBNV)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GeometryDataNV where
  peekCStruct :: Ptr GeometryDataNV -> IO GeometryDataNV
peekCStruct Ptr GeometryDataNV
p = do
    GeometryTrianglesNV
triangles <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GeometryTrianglesNV ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr GeometryTrianglesNV))
    GeometryAABBNV
aabbs <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GeometryAABBNV ((Ptr GeometryDataNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr GeometryAABBNV))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ GeometryTrianglesNV -> GeometryAABBNV -> GeometryDataNV
GeometryDataNV
             GeometryTrianglesNV
triangles GeometryAABBNV
aabbs

instance Storable GeometryDataNV where
  sizeOf :: GeometryDataNV -> Int
sizeOf ~GeometryDataNV
_ = Int
136
  alignment :: GeometryDataNV -> Int
alignment ~GeometryDataNV
_ = Int
8
  peek :: Ptr GeometryDataNV -> IO GeometryDataNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GeometryDataNV -> GeometryDataNV -> IO ()
poke Ptr GeometryDataNV
ptr GeometryDataNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryDataNV
ptr GeometryDataNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GeometryDataNV where
  zero :: GeometryDataNV
zero = GeometryTrianglesNV -> GeometryAABBNV -> GeometryDataNV
GeometryDataNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkGeometryNV - Structure specifying a geometry in a bottom-level
-- acceleration structure
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureInfoNV', 'GeometryDataNV',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryFlagsKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryTypeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data GeometryNV = GeometryNV
  { -- | @geometryType@ specifies the
    -- 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryTypeKHR' which
    -- this geometry refers to.
    --
    -- #VUID-VkGeometryNV-geometryType-03503# @geometryType@ /must/ be
    -- 'GEOMETRY_TYPE_TRIANGLES_NV' or 'GEOMETRY_TYPE_AABBS_NV'
    --
    -- #VUID-VkGeometryNV-geometryType-parameter# @geometryType@ /must/ be a
    -- valid 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryTypeKHR'
    -- value
    GeometryNV -> GeometryTypeKHR
geometryType :: GeometryTypeKHR
  , -- | @geometry@ contains the geometry data as described in 'GeometryDataNV'.
    --
    -- #VUID-VkGeometryNV-geometry-parameter# @geometry@ /must/ be a valid
    -- 'GeometryDataNV' structure
    GeometryNV -> GeometryDataNV
geometry :: GeometryDataNV
  , -- | @flags@ has
    -- 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryFlagBitsKHR'
    -- describing options for this geometry.
    --
    -- #VUID-VkGeometryNV-flags-parameter# @flags@ /must/ be a valid
    -- combination of
    -- 'Vulkan.Extensions.VK_KHR_acceleration_structure.GeometryFlagBitsKHR'
    -- values
    GeometryNV -> GeometryFlagBitsKHR
flags :: GeometryFlagsKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GeometryNV)
#endif
deriving instance Show GeometryNV

instance ToCStruct GeometryNV where
  withCStruct :: forall b. GeometryNV -> (Ptr GeometryNV -> IO b) -> IO b
withCStruct GeometryNV
x Ptr GeometryNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
168 forall a b. (a -> b) -> a -> b
$ \Ptr GeometryNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryNV
p GeometryNV
x (Ptr GeometryNV -> IO b
f Ptr GeometryNV
p)
  pokeCStruct :: forall b. Ptr GeometryNV -> GeometryNV -> IO b -> IO b
pokeCStruct Ptr GeometryNV
p GeometryNV{GeometryTypeKHR
GeometryFlagBitsKHR
GeometryDataNV
flags :: GeometryFlagBitsKHR
geometry :: GeometryDataNV
geometryType :: GeometryTypeKHR
$sel:flags:GeometryNV :: GeometryNV -> GeometryFlagBitsKHR
$sel:geometry:GeometryNV :: GeometryNV -> GeometryDataNV
$sel:geometryType:GeometryNV :: GeometryNV -> GeometryTypeKHR
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GeometryTypeKHR)) (GeometryTypeKHR
geometryType)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr GeometryDataNV)) (GeometryDataNV
geometry)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
160 :: Ptr GeometryFlagsKHR)) (GeometryFlagBitsKHR
flags)
    IO b
f
  cStructSize :: Int
cStructSize = Int
168
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr GeometryNV -> IO b -> IO b
pokeZeroCStruct Ptr GeometryNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GEOMETRY_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GeometryTypeKHR)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr GeometryDataNV)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GeometryNV where
  peekCStruct :: Ptr GeometryNV -> IO GeometryNV
peekCStruct Ptr GeometryNV
p = do
    GeometryTypeKHR
geometryType <- forall a. Storable a => Ptr a -> IO a
peek @GeometryTypeKHR ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr GeometryTypeKHR))
    GeometryDataNV
geometry <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GeometryDataNV ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr GeometryDataNV))
    GeometryFlagBitsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @GeometryFlagsKHR ((Ptr GeometryNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
160 :: Ptr GeometryFlagsKHR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ GeometryTypeKHR
-> GeometryDataNV -> GeometryFlagBitsKHR -> GeometryNV
GeometryNV
             GeometryTypeKHR
geometryType GeometryDataNV
geometry GeometryFlagBitsKHR
flags

instance Storable GeometryNV where
  sizeOf :: GeometryNV -> Int
sizeOf ~GeometryNV
_ = Int
168
  alignment :: GeometryNV -> Int
alignment ~GeometryNV
_ = Int
8
  peek :: Ptr GeometryNV -> IO GeometryNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GeometryNV -> GeometryNV -> IO ()
poke Ptr GeometryNV
ptr GeometryNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GeometryNV
ptr GeometryNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GeometryNV where
  zero :: GeometryNV
zero = GeometryTypeKHR
-> GeometryDataNV -> GeometryFlagBitsKHR -> GeometryNV
GeometryNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkAccelerationStructureInfoNV - Structure specifying the parameters of
-- acceleration structure object
--
-- = Description
--
-- 'AccelerationStructureInfoNV' contains information that is used both for
-- acceleration structure creation with 'createAccelerationStructureNV' and
-- in combination with the actual geometric data to build the acceleration
-- structure with 'cmdBuildAccelerationStructureNV'.
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureInfoNV-geometryCount-02422#
--     @geometryCount@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxGeometryCount@
--
-- -   #VUID-VkAccelerationStructureInfoNV-instanceCount-02423#
--     @instanceCount@ /must/ be less than or equal to
--     'PhysicalDeviceRayTracingPropertiesNV'::@maxInstanceCount@
--
-- -   #VUID-VkAccelerationStructureInfoNV-maxTriangleCount-02424# The
--     total number of triangles in all geometries /must/ be less than or
--     equal to 'PhysicalDeviceRayTracingPropertiesNV'::@maxTriangleCount@
--
-- -   #VUID-VkAccelerationStructureInfoNV-type-02425# If @type@ is
--     'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV' then @geometryCount@
--     /must/ be @0@
--
-- -   #VUID-VkAccelerationStructureInfoNV-type-02426# If @type@ is
--     'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV' then @instanceCount@
--     /must/ be @0@
--
-- -   #VUID-VkAccelerationStructureInfoNV-type-02786# If @type@ is
--     'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV' then the
--     @geometryType@ member of each geometry in @pGeometries@ /must/ be
--     the same
--
-- -   #VUID-VkAccelerationStructureInfoNV-type-04623# @type@ /must/ not be
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-VkAccelerationStructureInfoNV-flags-02592# If @flags@ has the
--     'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV' bit set,
--     then it /must/ not have the
--     'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV' bit set
--
-- -   #VUID-VkAccelerationStructureInfoNV-scratch-02781# @scratch@ /must/
--     have been created with 'BUFFER_USAGE_RAY_TRACING_BIT_NV' usage flag
--
-- -   #VUID-VkAccelerationStructureInfoNV-instanceData-02782# If
--     @instanceData@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @instanceData@ /must/ have been created with
--     'BUFFER_USAGE_RAY_TRACING_BIT_NV' usage flag
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureInfoNV-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV'
--
-- -   #VUID-VkAccelerationStructureInfoNV-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkAccelerationStructureInfoNV-type-parameter# @type@ /must/ be
--     a valid 'AccelerationStructureTypeNV' value
--
-- -   #VUID-VkAccelerationStructureInfoNV-flags-parameter# @flags@ /must/
--     be a valid combination of 'BuildAccelerationStructureFlagBitsNV'
--     values
--
-- -   #VUID-VkAccelerationStructureInfoNV-pGeometries-parameter# If
--     @geometryCount@ is not @0@, @pGeometries@ /must/ be a valid pointer
--     to an array of @geometryCount@ valid 'GeometryNV' structures
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureCreateInfoNV', 'AccelerationStructureTypeNV',
-- 'BuildAccelerationStructureFlagsNV', 'GeometryNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdBuildAccelerationStructureNV'
data AccelerationStructureInfoNV = AccelerationStructureInfoNV
  { -- | @type@ is a 'AccelerationStructureTypeNV' value specifying the type of
    -- acceleration structure that will be created.
    AccelerationStructureInfoNV -> AccelerationStructureTypeKHR
type' :: AccelerationStructureTypeNV
  , -- | @flags@ is a bitmask of 'BuildAccelerationStructureFlagBitsNV'
    -- specifying additional parameters of the acceleration structure.
    AccelerationStructureInfoNV
-> BuildAccelerationStructureFlagBitsKHR
flags :: BuildAccelerationStructureFlagsNV
  , -- | @instanceCount@ specifies the number of instances that will be in the
    -- new acceleration structure.
    AccelerationStructureInfoNV -> "shader" ::: Word32
instanceCount :: Word32
  , -- | @pGeometries@ is a pointer to an array of @geometryCount@ 'GeometryNV'
    -- structures containing the scene data being passed into the acceleration
    -- structure.
    AccelerationStructureInfoNV -> Vector GeometryNV
geometries :: Vector GeometryNV
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureInfoNV)
#endif
deriving instance Show AccelerationStructureInfoNV

instance ToCStruct AccelerationStructureInfoNV where
  withCStruct :: forall b.
AccelerationStructureInfoNV
-> (("pInfo" ::: Ptr AccelerationStructureInfoNV) -> IO b) -> IO b
withCStruct AccelerationStructureInfoNV
x ("pInfo" ::: Ptr AccelerationStructureInfoNV) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \"pInfo" ::: Ptr AccelerationStructureInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureInfoNV
p AccelerationStructureInfoNV
x (("pInfo" ::: Ptr AccelerationStructureInfoNV) -> IO b
f "pInfo" ::: Ptr AccelerationStructureInfoNV
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr AccelerationStructureInfoNV)
-> AccelerationStructureInfoNV -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureInfoNV
p AccelerationStructureInfoNV{"shader" ::: Word32
Vector GeometryNV
AccelerationStructureTypeKHR
BuildAccelerationStructureFlagBitsKHR
geometries :: Vector GeometryNV
instanceCount :: "shader" ::: Word32
flags :: BuildAccelerationStructureFlagBitsKHR
type' :: AccelerationStructureTypeKHR
$sel:geometries:AccelerationStructureInfoNV :: AccelerationStructureInfoNV -> Vector GeometryNV
$sel:instanceCount:AccelerationStructureInfoNV :: AccelerationStructureInfoNV -> "shader" ::: Word32
$sel:flags:AccelerationStructureInfoNV :: AccelerationStructureInfoNV
-> BuildAccelerationStructureFlagBitsKHR
$sel:type':AccelerationStructureInfoNV :: AccelerationStructureInfoNV -> AccelerationStructureTypeKHR
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureTypeNV)) (AccelerationStructureTypeKHR
type')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BuildAccelerationStructureFlagsNV)) (BuildAccelerationStructureFlagBitsKHR
flags)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("shader" ::: Word32
instanceCount)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector GeometryNV
geometries)) :: Word32))
    Ptr GeometryNV
pPGeometries' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @GeometryNV ((forall a. Vector a -> Int
Data.Vector.length (Vector GeometryNV
geometries)) forall a. Num a => a -> a -> a
* Int
168)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i GeometryNV
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GeometryNV
pPGeometries' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
168 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr GeometryNV) (GeometryNV
e)) (Vector GeometryNV
geometries)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr GeometryNV))) (Ptr GeometryNV
pPGeometries')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pInfo" ::: Ptr AccelerationStructureInfoNV) -> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr AccelerationStructureInfoNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureTypeNV)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureInfoNV where
  peekCStruct :: ("pInfo" ::: Ptr AccelerationStructureInfoNV)
-> IO AccelerationStructureInfoNV
peekCStruct "pInfo" ::: Ptr AccelerationStructureInfoNV
p = do
    AccelerationStructureTypeKHR
type' <- forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureTypeNV (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureTypeNV))
    BuildAccelerationStructureFlagBitsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @BuildAccelerationStructureFlagsNV (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BuildAccelerationStructureFlagsNV))
    "shader" ::: Word32
instanceCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    "shader" ::: Word32
geometryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
    Ptr GeometryNV
pGeometries <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr GeometryNV) (("pInfo" ::: Ptr AccelerationStructureInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr GeometryNV)))
    Vector GeometryNV
pGeometries' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "shader" ::: Word32
geometryCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GeometryNV ((Ptr GeometryNV
pGeometries forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
168 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr GeometryNV)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ AccelerationStructureTypeKHR
-> BuildAccelerationStructureFlagBitsKHR
-> ("shader" ::: Word32)
-> Vector GeometryNV
-> AccelerationStructureInfoNV
AccelerationStructureInfoNV
             AccelerationStructureTypeKHR
type' BuildAccelerationStructureFlagBitsKHR
flags "shader" ::: Word32
instanceCount Vector GeometryNV
pGeometries'

instance Zero AccelerationStructureInfoNV where
  zero :: AccelerationStructureInfoNV
zero = AccelerationStructureTypeKHR
-> BuildAccelerationStructureFlagBitsKHR
-> ("shader" ::: Word32)
-> Vector GeometryNV
-> AccelerationStructureInfoNV
AccelerationStructureInfoNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Monoid a => a
mempty


-- | VkAccelerationStructureCreateInfoNV - Structure specifying the
-- parameters of a newly created acceleration structure object
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureCreateInfoNV-compactedSize-02421# If
--     @compactedSize@ is not @0@ then both @info.geometryCount@ and
--     @info.instanceCount@ /must/ be @0@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureCreateInfoNV-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV'
--
-- -   #VUID-VkAccelerationStructureCreateInfoNV-pNext-pNext# @pNext@
--     /must/ be @NULL@ or a pointer to a valid instance of
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
--
-- -   #VUID-VkAccelerationStructureCreateInfoNV-sType-unique# The @sType@
--     value of each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkAccelerationStructureCreateInfoNV-info-parameter# @info@
--     /must/ be a valid 'AccelerationStructureInfoNV' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureInfoNV',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createAccelerationStructureNV'
data AccelerationStructureCreateInfoNV (es :: [Type]) = AccelerationStructureCreateInfoNV
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> Chain es
next :: Chain es
  , -- | @compactedSize@ is the size from the result of
    -- 'cmdWriteAccelerationStructuresPropertiesNV' if this acceleration
    -- structure is going to be the target of a compacting copy.
    forall (es :: [*]).
AccelerationStructureCreateInfoNV es
-> "instanceOffset" ::: DeviceSize
compactedSize :: DeviceSize
  , -- | @info@ is the 'AccelerationStructureInfoNV' structure specifying further
    -- parameters of the created acceleration structure.
    forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> AccelerationStructureInfoNV
info :: AccelerationStructureInfoNV
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureCreateInfoNV (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (AccelerationStructureCreateInfoNV es)

instance Extensible AccelerationStructureCreateInfoNV where
  extensibleTypeName :: String
extensibleTypeName = String
"AccelerationStructureCreateInfoNV"
  setNext :: forall (ds :: [*]) (es :: [*]).
AccelerationStructureCreateInfoNV ds
-> Chain es -> AccelerationStructureCreateInfoNV es
setNext AccelerationStructureCreateInfoNV{"instanceOffset" ::: DeviceSize
Chain ds
AccelerationStructureInfoNV
info :: AccelerationStructureInfoNV
compactedSize :: "instanceOffset" ::: DeviceSize
next :: Chain ds
$sel:info:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> AccelerationStructureInfoNV
$sel:compactedSize:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es
-> "instanceOffset" ::: DeviceSize
$sel:next:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> Chain es
..} Chain es
next' = AccelerationStructureCreateInfoNV{$sel:next:AccelerationStructureCreateInfoNV :: Chain es
next = Chain es
next', "instanceOffset" ::: DeviceSize
AccelerationStructureInfoNV
info :: AccelerationStructureInfoNV
compactedSize :: "instanceOffset" ::: DeviceSize
$sel:info:AccelerationStructureCreateInfoNV :: AccelerationStructureInfoNV
$sel:compactedSize:AccelerationStructureCreateInfoNV :: "instanceOffset" ::: DeviceSize
..}
  getNext :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> Chain es
getNext AccelerationStructureCreateInfoNV{"instanceOffset" ::: DeviceSize
Chain es
AccelerationStructureInfoNV
info :: AccelerationStructureInfoNV
compactedSize :: "instanceOffset" ::: DeviceSize
next :: Chain es
$sel:info:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> AccelerationStructureInfoNV
$sel:compactedSize:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es
-> "instanceOffset" ::: DeviceSize
$sel:next:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends AccelerationStructureCreateInfoNV e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends AccelerationStructureCreateInfoNV e => b) -> Maybe b
extends proxy e
_ Extends AccelerationStructureCreateInfoNV e => b
f
    | Just e :~: OpaqueCaptureDescriptorDataCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @OpaqueCaptureDescriptorDataCreateInfoEXT = forall a. a -> Maybe a
Just Extends AccelerationStructureCreateInfoNV e => b
f
    | Bool
otherwise = forall a. Maybe a
Nothing

instance ( Extendss AccelerationStructureCreateInfoNV es
         , PokeChain es ) => ToCStruct (AccelerationStructureCreateInfoNV es) where
  withCStruct :: forall b.
AccelerationStructureCreateInfoNV es
-> (Ptr (AccelerationStructureCreateInfoNV es) -> IO b) -> IO b
withCStruct AccelerationStructureCreateInfoNV es
x Ptr (AccelerationStructureCreateInfoNV es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr (AccelerationStructureCreateInfoNV es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (AccelerationStructureCreateInfoNV es)
p AccelerationStructureCreateInfoNV es
x (Ptr (AccelerationStructureCreateInfoNV es) -> IO b
f Ptr (AccelerationStructureCreateInfoNV es)
p)
  pokeCStruct :: forall b.
Ptr (AccelerationStructureCreateInfoNV es)
-> AccelerationStructureCreateInfoNV es -> IO b -> IO b
pokeCStruct Ptr (AccelerationStructureCreateInfoNV es)
p AccelerationStructureCreateInfoNV{"instanceOffset" ::: DeviceSize
Chain es
AccelerationStructureInfoNV
info :: AccelerationStructureInfoNV
compactedSize :: "instanceOffset" ::: DeviceSize
next :: Chain es
$sel:info:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> AccelerationStructureInfoNV
$sel:compactedSize:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es
-> "instanceOffset" ::: DeviceSize
$sel:next:AccelerationStructureCreateInfoNV :: forall (es :: [*]).
AccelerationStructureCreateInfoNV es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV)
    "data" ::: Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext''
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
compactedSize)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureInfoNV)) (AccelerationStructureInfoNV
info) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr (AccelerationStructureCreateInfoNV es) -> IO b -> IO b
pokeZeroCStruct Ptr (AccelerationStructureCreateInfoNV es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV)
    "data" ::: Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) "data" ::: Ptr ()
pNext'
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureInfoNV)) (forall a. Zero a => a
zero) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss AccelerationStructureCreateInfoNV es
         , PeekChain es ) => FromCStruct (AccelerationStructureCreateInfoNV es) where
  peekCStruct :: Ptr (AccelerationStructureCreateInfoNV es)
-> IO (AccelerationStructureCreateInfoNV es)
peekCStruct Ptr (AccelerationStructureCreateInfoNV es)
p = do
    "data" ::: Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr "data" ::: Ptr ()
pNext)
    "instanceOffset" ::: DeviceSize
compactedSize <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
    AccelerationStructureInfoNV
info <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AccelerationStructureInfoNV ((Ptr (AccelerationStructureCreateInfoNV es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureInfoNV))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> ("instanceOffset" ::: DeviceSize)
-> AccelerationStructureInfoNV
-> AccelerationStructureCreateInfoNV es
AccelerationStructureCreateInfoNV
             Chain es
next "instanceOffset" ::: DeviceSize
compactedSize AccelerationStructureInfoNV
info

instance es ~ '[] => Zero (AccelerationStructureCreateInfoNV es) where
  zero :: AccelerationStructureCreateInfoNV es
zero = forall (es :: [*]).
Chain es
-> ("instanceOffset" ::: DeviceSize)
-> AccelerationStructureInfoNV
-> AccelerationStructureCreateInfoNV es
AccelerationStructureCreateInfoNV
           ()
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBindAccelerationStructureMemoryInfoNV - Structure specifying
-- acceleration structure memory binding
--
-- == Valid Usage
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-accelerationStructure-03620#
--     @accelerationStructure@ /must/ not already be backed by a memory
--     object
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-memoryOffset-03621#
--     @memoryOffset@ /must/ be less than the size of @memory@
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-memory-03622# @memory@
--     /must/ have been allocated using one of the memory types allowed in
--     the @memoryTypeBits@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to
--     'getAccelerationStructureMemoryRequirementsNV' with
--     @accelerationStructure@ and @type@ of
--     'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV'
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-memoryOffset-03623#
--     @memoryOffset@ /must/ be an integer multiple of the @alignment@
--     member of the 'Vulkan.Core10.MemoryManagement.MemoryRequirements'
--     structure returned from a call to
--     'getAccelerationStructureMemoryRequirementsNV' with
--     @accelerationStructure@ and @type@ of
--     'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV'
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-size-03624# The @size@
--     member of the 'Vulkan.Core10.MemoryManagement.MemoryRequirements'
--     structure returned from a call to
--     'getAccelerationStructureMemoryRequirementsNV' with
--     @accelerationStructure@ and @type@ of
--     'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV' /must/
--     be less than or equal to the size of @memory@ minus @memoryOffset@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV'
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-accelerationStructure-parameter#
--     @accelerationStructure@ /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-memory-parameter#
--     @memory@ /must/ be a valid 'Vulkan.Core10.Handles.DeviceMemory'
--     handle
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-pDeviceIndices-parameter#
--     If @deviceIndexCount@ is not @0@, @pDeviceIndices@ /must/ be a valid
--     pointer to an array of @deviceIndexCount@ @uint32_t@ values
--
-- -   #VUID-VkBindAccelerationStructureMemoryInfoNV-commonparent# Both of
--     @accelerationStructure@, and @memory@ /must/ have been created,
--     allocated, or retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'bindAccelerationStructureMemoryNV'
data BindAccelerationStructureMemoryInfoNV = BindAccelerationStructureMemoryInfoNV
  { -- | @accelerationStructure@ is the acceleration structure to be attached to
    -- memory.
    BindAccelerationStructureMemoryInfoNV -> AccelerationStructureNV
accelerationStructure :: AccelerationStructureNV
  , -- | @memory@ is a 'Vulkan.Core10.Handles.DeviceMemory' object describing the
    -- device memory to attach.
    BindAccelerationStructureMemoryInfoNV -> DeviceMemory
memory :: DeviceMemory
  , -- | @memoryOffset@ is the start offset of the region of memory that is to be
    -- bound to the acceleration structure. The number of bytes returned in the
    -- 'Vulkan.Core10.MemoryManagement.MemoryRequirements'::@size@ member in
    -- @memory@, starting from @memoryOffset@ bytes, will be bound to the
    -- specified acceleration structure.
    BindAccelerationStructureMemoryInfoNV
-> "instanceOffset" ::: DeviceSize
memoryOffset :: DeviceSize
  , -- | @pDeviceIndices@ is a pointer to an array of device indices.
    BindAccelerationStructureMemoryInfoNV
-> Vector ("shader" ::: Word32)
deviceIndices :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindAccelerationStructureMemoryInfoNV)
#endif
deriving instance Show BindAccelerationStructureMemoryInfoNV

instance ToCStruct BindAccelerationStructureMemoryInfoNV where
  withCStruct :: forall b.
BindAccelerationStructureMemoryInfoNV
-> (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
    -> IO b)
-> IO b
withCStruct BindAccelerationStructureMemoryInfoNV
x ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \"pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p BindAccelerationStructureMemoryInfoNV
x (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO b
f "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p)
  pokeCStruct :: forall b.
("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> BindAccelerationStructureMemoryInfoNV -> IO b -> IO b
pokeCStruct "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p BindAccelerationStructureMemoryInfoNV{"instanceOffset" ::: DeviceSize
Vector ("shader" ::: Word32)
DeviceMemory
AccelerationStructureNV
deviceIndices :: Vector ("shader" ::: Word32)
memoryOffset :: "instanceOffset" ::: DeviceSize
memory :: DeviceMemory
accelerationStructure :: AccelerationStructureNV
$sel:deviceIndices:BindAccelerationStructureMemoryInfoNV :: BindAccelerationStructureMemoryInfoNV
-> Vector ("shader" ::: Word32)
$sel:memoryOffset:BindAccelerationStructureMemoryInfoNV :: BindAccelerationStructureMemoryInfoNV
-> "instanceOffset" ::: DeviceSize
$sel:memory:BindAccelerationStructureMemoryInfoNV :: BindAccelerationStructureMemoryInfoNV -> DeviceMemory
$sel:accelerationStructure:BindAccelerationStructureMemoryInfoNV :: BindAccelerationStructureMemoryInfoNV -> AccelerationStructureNV
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureNV)) (AccelerationStructureNV
accelerationStructure)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (DeviceMemory
memory)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) ("instanceOffset" ::: DeviceSize
memoryOffset)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector ("shader" ::: Word32)
deviceIndices)) :: Word32))
    Ptr ("shader" ::: Word32)
pPDeviceIndices' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector ("shader" ::: Word32)
deviceIndices)) forall a. Num a => a -> a -> a
* Int
4)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "shader" ::: Word32
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("shader" ::: Word32)
pPDeviceIndices' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("shader" ::: Word32
e)) (Vector ("shader" ::: Word32)
deviceIndices)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr Word32))) (Ptr ("shader" ::: Word32)
pPDeviceIndices')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO b -> IO b
pokeZeroCStruct "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureNV)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindAccelerationStructureMemoryInfoNV where
  peekCStruct :: ("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV)
-> IO BindAccelerationStructureMemoryInfoNV
peekCStruct "pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p = do
    AccelerationStructureNV
accelerationStructure <- forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureNV (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureNV))
    DeviceMemory
memory <- forall a. Storable a => Ptr a -> IO a
peek @DeviceMemory (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory))
    "instanceOffset" ::: DeviceSize
memoryOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
    "shader" ::: Word32
deviceIndexCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32))
    Ptr ("shader" ::: Word32)
pDeviceIndices <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) (("pBindInfos" ::: Ptr BindAccelerationStructureMemoryInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr Word32)))
    Vector ("shader" ::: Word32)
pDeviceIndices' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "shader" ::: Word32
deviceIndexCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("shader" ::: Word32)
pDeviceIndices forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ AccelerationStructureNV
-> DeviceMemory
-> ("instanceOffset" ::: DeviceSize)
-> Vector ("shader" ::: Word32)
-> BindAccelerationStructureMemoryInfoNV
BindAccelerationStructureMemoryInfoNV
             AccelerationStructureNV
accelerationStructure DeviceMemory
memory "instanceOffset" ::: DeviceSize
memoryOffset Vector ("shader" ::: Word32)
pDeviceIndices'

instance Zero BindAccelerationStructureMemoryInfoNV where
  zero :: BindAccelerationStructureMemoryInfoNV
zero = AccelerationStructureNV
-> DeviceMemory
-> ("instanceOffset" ::: DeviceSize)
-> Vector ("shader" ::: Word32)
-> BindAccelerationStructureMemoryInfoNV
BindAccelerationStructureMemoryInfoNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Monoid a => a
mempty


-- | VkWriteDescriptorSetAccelerationStructureNV - Structure specifying
-- acceleration structure descriptor information
--
-- == Valid Usage
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-accelerationStructureCount-03747#
--     @accelerationStructureCount@ /must/ be equal to @descriptorCount@ in
--     the extended structure
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03748#
--     Each acceleration structure in @pAccelerationStructures@ /must/ have
--     been created with
--     'Vulkan.Extensions.VK_KHR_acceleration_structure.ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR'
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03749#
--     If the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     feature is not enabled, each member of @pAccelerationStructures@
--     /must/ not be 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV'
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-parameter#
--     @pAccelerationStructures@ /must/ be a valid pointer to an array of
--     @accelerationStructureCount@ valid or
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--     'Vulkan.Extensions.Handles.AccelerationStructureNV' handles
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureNV-accelerationStructureCount-arraylength#
--     @accelerationStructureCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data WriteDescriptorSetAccelerationStructureNV = WriteDescriptorSetAccelerationStructureNV
  { -- | @pAccelerationStructures@ is a pointer to an array of
    -- 'Vulkan.Extensions.Handles.AccelerationStructureNV' structures
    -- specifying the acceleration structures to update.
    WriteDescriptorSetAccelerationStructureNV
-> "accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures :: Vector AccelerationStructureNV }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (WriteDescriptorSetAccelerationStructureNV)
#endif
deriving instance Show WriteDescriptorSetAccelerationStructureNV

instance ToCStruct WriteDescriptorSetAccelerationStructureNV where
  withCStruct :: forall b.
WriteDescriptorSetAccelerationStructureNV
-> (Ptr WriteDescriptorSetAccelerationStructureNV -> IO b) -> IO b
withCStruct WriteDescriptorSetAccelerationStructureNV
x Ptr WriteDescriptorSetAccelerationStructureNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr WriteDescriptorSetAccelerationStructureNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr WriteDescriptorSetAccelerationStructureNV
p WriteDescriptorSetAccelerationStructureNV
x (Ptr WriteDescriptorSetAccelerationStructureNV -> IO b
f Ptr WriteDescriptorSetAccelerationStructureNV
p)
  pokeCStruct :: forall b.
Ptr WriteDescriptorSetAccelerationStructureNV
-> WriteDescriptorSetAccelerationStructureNV -> IO b -> IO b
pokeCStruct Ptr WriteDescriptorSetAccelerationStructureNV
p WriteDescriptorSetAccelerationStructureNV{"accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures :: "accelerationStructures" ::: Vector AccelerationStructureNV
$sel:accelerationStructures:WriteDescriptorSetAccelerationStructureNV :: WriteDescriptorSetAccelerationStructureNV
-> "accelerationStructures" ::: Vector AccelerationStructureNV
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)) :: Word32))
    "pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @AccelerationStructureNV ((forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)) forall a. Num a => a -> a -> a
* Int
8)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i AccelerationStructureNV
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureNV) (AccelerationStructureNV
e)) ("accelerationStructures" ::: Vector AccelerationStructureNV
accelerationStructures)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr AccelerationStructureNV))) ("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pPAccelerationStructures')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr WriteDescriptorSetAccelerationStructureNV -> IO b -> IO b
pokeZeroCStruct Ptr WriteDescriptorSetAccelerationStructureNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct WriteDescriptorSetAccelerationStructureNV where
  peekCStruct :: Ptr WriteDescriptorSetAccelerationStructureNV
-> IO WriteDescriptorSetAccelerationStructureNV
peekCStruct Ptr WriteDescriptorSetAccelerationStructureNV
p = do
    "shader" ::: Word32
accelerationStructureCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    "pAccelerationStructure" ::: Ptr AccelerationStructureNV
pAccelerationStructures <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr AccelerationStructureNV) ((Ptr WriteDescriptorSetAccelerationStructureNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr AccelerationStructureNV)))
    "accelerationStructures" ::: Vector AccelerationStructureNV
pAccelerationStructures' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "shader" ::: Word32
accelerationStructureCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureNV (("pAccelerationStructure" ::: Ptr AccelerationStructureNV
pAccelerationStructures forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureNV)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureNV)
-> WriteDescriptorSetAccelerationStructureNV
WriteDescriptorSetAccelerationStructureNV
             "accelerationStructures" ::: Vector AccelerationStructureNV
pAccelerationStructures'

instance Zero WriteDescriptorSetAccelerationStructureNV where
  zero :: WriteDescriptorSetAccelerationStructureNV
zero = ("accelerationStructures" ::: Vector AccelerationStructureNV)
-> WriteDescriptorSetAccelerationStructureNV
WriteDescriptorSetAccelerationStructureNV
           forall a. Monoid a => a
mempty


-- | VkAccelerationStructureMemoryRequirementsInfoNV - Structure specifying
-- acceleration to query for memory requirements
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureMemoryRequirementsTypeNV',
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getAccelerationStructureMemoryRequirementsNV'
data AccelerationStructureMemoryRequirementsInfoNV = AccelerationStructureMemoryRequirementsInfoNV
  { -- | @type@ selects the type of memory requirement being queried.
    -- 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV' returns the
    -- memory requirements for the object itself.
    -- 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV'
    -- returns the memory requirements for the scratch memory when doing a
    -- build.
    -- 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV'
    -- returns the memory requirements for the scratch memory when doing an
    -- update.
    --
    -- #VUID-VkAccelerationStructureMemoryRequirementsInfoNV-type-parameter#
    -- @type@ /must/ be a valid 'AccelerationStructureMemoryRequirementsTypeNV'
    -- value
    AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsTypeNV
type' :: AccelerationStructureMemoryRequirementsTypeNV
  , -- | @accelerationStructure@ is the acceleration structure to be queried for
    -- memory requirements.
    --
    -- #VUID-VkAccelerationStructureMemoryRequirementsInfoNV-accelerationStructure-parameter#
    -- @accelerationStructure@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.AccelerationStructureNV' handle
    AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureNV
accelerationStructure :: AccelerationStructureNV
  }
  deriving (Typeable, AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsInfoNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsInfoNV -> Bool
$c/= :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsInfoNV -> Bool
== :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsInfoNV -> Bool
$c== :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsInfoNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureMemoryRequirementsInfoNV)
#endif
deriving instance Show AccelerationStructureMemoryRequirementsInfoNV

instance ToCStruct AccelerationStructureMemoryRequirementsInfoNV where
  withCStruct :: forall b.
AccelerationStructureMemoryRequirementsInfoNV
-> (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
    -> IO b)
-> IO b
withCStruct AccelerationStructureMemoryRequirementsInfoNV
x ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p AccelerationStructureMemoryRequirementsInfoNV
x (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> IO b
f "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p)
  pokeCStruct :: forall b.
("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> AccelerationStructureMemoryRequirementsInfoNV -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p AccelerationStructureMemoryRequirementsInfoNV{AccelerationStructureNV
AccelerationStructureMemoryRequirementsTypeNV
accelerationStructure :: AccelerationStructureNV
type' :: AccelerationStructureMemoryRequirementsTypeNV
$sel:accelerationStructure:AccelerationStructureMemoryRequirementsInfoNV :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureNV
$sel:type':AccelerationStructureMemoryRequirementsInfoNV :: AccelerationStructureMemoryRequirementsInfoNV
-> AccelerationStructureMemoryRequirementsTypeNV
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureMemoryRequirementsTypeNV)) (AccelerationStructureMemoryRequirementsTypeNV
type')
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureNV)) (AccelerationStructureNV
accelerationStructure)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> IO b -> IO b
pokeZeroCStruct "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureMemoryRequirementsTypeNV)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureNV)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureMemoryRequirementsInfoNV where
  peekCStruct :: ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> IO AccelerationStructureMemoryRequirementsInfoNV
peekCStruct "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p = do
    AccelerationStructureMemoryRequirementsTypeNV
type' <- forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureMemoryRequirementsTypeNV (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AccelerationStructureMemoryRequirementsTypeNV))
    AccelerationStructureNV
accelerationStructure <- forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureNV (("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccelerationStructureNV))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureNV
-> AccelerationStructureMemoryRequirementsInfoNV
AccelerationStructureMemoryRequirementsInfoNV
             AccelerationStructureMemoryRequirementsTypeNV
type' AccelerationStructureNV
accelerationStructure

instance Storable AccelerationStructureMemoryRequirementsInfoNV where
  sizeOf :: AccelerationStructureMemoryRequirementsInfoNV -> Int
sizeOf ~AccelerationStructureMemoryRequirementsInfoNV
_ = Int
32
  alignment :: AccelerationStructureMemoryRequirementsInfoNV -> Int
alignment ~AccelerationStructureMemoryRequirementsInfoNV
_ = Int
8
  peek :: ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> IO AccelerationStructureMemoryRequirementsInfoNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: ("pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV)
-> AccelerationStructureMemoryRequirementsInfoNV -> IO ()
poke "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
ptr AccelerationStructureMemoryRequirementsInfoNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureMemoryRequirementsInfoNV
ptr AccelerationStructureMemoryRequirementsInfoNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero AccelerationStructureMemoryRequirementsInfoNV where
  zero :: AccelerationStructureMemoryRequirementsInfoNV
zero = AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureNV
-> AccelerationStructureMemoryRequirementsInfoNV
AccelerationStructureMemoryRequirementsInfoNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkPhysicalDeviceRayTracingPropertiesNV - Properties of the physical
-- device for ray tracing
--
-- = Description
--
-- Due to the fact that the geometry, instance, and triangle counts are
-- specified at acceleration structure creation as 32-bit values,
-- @maxGeometryCount@, @maxInstanceCount@, and @maxTriangleCount@ /must/
-- not exceed 232-1.
--
-- If the 'PhysicalDeviceRayTracingPropertiesNV' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- Limits specified by this structure /must/ match those specified with the
-- same name in
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.PhysicalDeviceAccelerationStructurePropertiesKHR'
-- and
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.PhysicalDeviceRayTracingPipelinePropertiesKHR'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceRayTracingPropertiesNV = PhysicalDeviceRayTracingPropertiesNV
  { -- | @shaderGroupHandleSize@ is the size in bytes of the shader header.
    PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
shaderGroupHandleSize :: Word32
  , -- | #limits-maxRecursionDepth# @maxRecursionDepth@ is the maximum number of
    -- levels of recursion allowed in a trace command.
    PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
maxRecursionDepth :: Word32
  , -- | @maxShaderGroupStride@ is the maximum stride in bytes allowed between
    -- shader groups in the shader binding table.
    PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
maxShaderGroupStride :: Word32
  , -- | @shaderGroupBaseAlignment@ is the /required/ alignment in bytes for the
    -- base of the shader binding table.
    PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
shaderGroupBaseAlignment :: Word32
  , -- | @maxGeometryCount@ is the maximum number of geometries in the bottom
    -- level acceleration structure.
    PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
maxGeometryCount :: Word64
  , -- | @maxInstanceCount@ is the maximum number of instances in the top level
    -- acceleration structure.
    PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
maxInstanceCount :: Word64
  , -- | @maxTriangleCount@ is the maximum number of triangles in all geometries
    -- in the bottom level acceleration structure.
    PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
maxTriangleCount :: Word64
  , -- | @maxDescriptorSetAccelerationStructures@ is the maximum number of
    -- acceleration structure descriptors that are allowed in a descriptor set.
    PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
maxDescriptorSetAccelerationStructures :: Word32
  }
  deriving (Typeable, PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> Bool
$c/= :: PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> Bool
== :: PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> Bool
$c== :: PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceRayTracingPropertiesNV)
#endif
deriving instance Show PhysicalDeviceRayTracingPropertiesNV

instance ToCStruct PhysicalDeviceRayTracingPropertiesNV where
  withCStruct :: forall b.
PhysicalDeviceRayTracingPropertiesNV
-> (Ptr PhysicalDeviceRayTracingPropertiesNV -> IO b) -> IO b
withCStruct PhysicalDeviceRayTracingPropertiesNV
x Ptr PhysicalDeviceRayTracingPropertiesNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceRayTracingPropertiesNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRayTracingPropertiesNV
p PhysicalDeviceRayTracingPropertiesNV
x (Ptr PhysicalDeviceRayTracingPropertiesNV -> IO b
f Ptr PhysicalDeviceRayTracingPropertiesNV
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRayTracingPropertiesNV
p PhysicalDeviceRayTracingPropertiesNV{"shader" ::: Word32
"instanceOffset" ::: DeviceSize
maxDescriptorSetAccelerationStructures :: "shader" ::: Word32
maxTriangleCount :: "instanceOffset" ::: DeviceSize
maxInstanceCount :: "instanceOffset" ::: DeviceSize
maxGeometryCount :: "instanceOffset" ::: DeviceSize
shaderGroupBaseAlignment :: "shader" ::: Word32
maxShaderGroupStride :: "shader" ::: Word32
maxRecursionDepth :: "shader" ::: Word32
shaderGroupHandleSize :: "shader" ::: Word32
$sel:maxDescriptorSetAccelerationStructures:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
$sel:maxTriangleCount:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
$sel:maxInstanceCount:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
$sel:maxGeometryCount:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV
-> "instanceOffset" ::: DeviceSize
$sel:shaderGroupBaseAlignment:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
$sel:maxShaderGroupStride:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
$sel:maxRecursionDepth:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
$sel:shaderGroupHandleSize:PhysicalDeviceRayTracingPropertiesNV :: PhysicalDeviceRayTracingPropertiesNV -> "shader" ::: Word32
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("shader" ::: Word32
shaderGroupHandleSize)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("shader" ::: Word32
maxRecursionDepth)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("shader" ::: Word32
maxShaderGroupStride)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("shader" ::: Word32
shaderGroupBaseAlignment)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) ("instanceOffset" ::: DeviceSize
maxGeometryCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word64)) ("instanceOffset" ::: DeviceSize
maxInstanceCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word64)) ("instanceOffset" ::: DeviceSize
maxTriangleCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word32)) ("shader" ::: Word32
maxDescriptorSetAccelerationStructures)
    IO b
f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PhysicalDeviceRayTracingPropertiesNV -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceRayTracingPropertiesNV
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceRayTracingPropertiesNV where
  peekCStruct :: Ptr PhysicalDeviceRayTracingPropertiesNV
-> IO PhysicalDeviceRayTracingPropertiesNV
peekCStruct Ptr PhysicalDeviceRayTracingPropertiesNV
p = do
    "shader" ::: Word32
shaderGroupHandleSize <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    "shader" ::: Word32
maxRecursionDepth <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    "shader" ::: Word32
maxShaderGroupStride <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    "shader" ::: Word32
shaderGroupBaseAlignment <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
    "instanceOffset" ::: DeviceSize
maxGeometryCount <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64))
    "instanceOffset" ::: DeviceSize
maxInstanceCount <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word64))
    "instanceOffset" ::: DeviceSize
maxTriangleCount <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word64))
    "shader" ::: Word32
maxDescriptorSetAccelerationStructures <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceRayTracingPropertiesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> PhysicalDeviceRayTracingPropertiesNV
PhysicalDeviceRayTracingPropertiesNV
             "shader" ::: Word32
shaderGroupHandleSize
             "shader" ::: Word32
maxRecursionDepth
             "shader" ::: Word32
maxShaderGroupStride
             "shader" ::: Word32
shaderGroupBaseAlignment
             "instanceOffset" ::: DeviceSize
maxGeometryCount
             "instanceOffset" ::: DeviceSize
maxInstanceCount
             "instanceOffset" ::: DeviceSize
maxTriangleCount
             "shader" ::: Word32
maxDescriptorSetAccelerationStructures

instance Storable PhysicalDeviceRayTracingPropertiesNV where
  sizeOf :: PhysicalDeviceRayTracingPropertiesNV -> Int
sizeOf ~PhysicalDeviceRayTracingPropertiesNV
_ = Int
64
  alignment :: PhysicalDeviceRayTracingPropertiesNV -> Int
alignment ~PhysicalDeviceRayTracingPropertiesNV
_ = Int
8
  peek :: Ptr PhysicalDeviceRayTracingPropertiesNV
-> IO PhysicalDeviceRayTracingPropertiesNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceRayTracingPropertiesNV
-> PhysicalDeviceRayTracingPropertiesNV -> IO ()
poke Ptr PhysicalDeviceRayTracingPropertiesNV
ptr PhysicalDeviceRayTracingPropertiesNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRayTracingPropertiesNV
ptr PhysicalDeviceRayTracingPropertiesNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceRayTracingPropertiesNV where
  zero :: PhysicalDeviceRayTracingPropertiesNV
zero = ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("shader" ::: Word32)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("instanceOffset" ::: DeviceSize)
-> ("shader" ::: Word32)
-> PhysicalDeviceRayTracingPropertiesNV
PhysicalDeviceRayTracingPropertiesNV
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkAccelerationStructureMemoryRequirementsTypeNV - Acceleration structure
-- memory requirement type
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>,
-- 'AccelerationStructureMemoryRequirementsInfoNV'
newtype AccelerationStructureMemoryRequirementsTypeNV = AccelerationStructureMemoryRequirementsTypeNV Int32
  deriving newtype (AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c/= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
== :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c== :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
Eq, Eq AccelerationStructureMemoryRequirementsTypeNV
AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Ordering
AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
$cmin :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
max :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
$cmax :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV
>= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c>= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
> :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c> :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
<= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c<= :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
< :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
$c< :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Bool
compare :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Ordering
$ccompare :: AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> Ordering
Ord, Ptr AccelerationStructureMemoryRequirementsTypeNV
-> IO AccelerationStructureMemoryRequirementsTypeNV
Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
Ptr AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
AccelerationStructureMemoryRequirementsTypeNV -> Int
forall b.
Ptr b -> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
forall b.
Ptr b
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
$cpoke :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
peek :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> IO AccelerationStructureMemoryRequirementsTypeNV
$cpeek :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> IO AccelerationStructureMemoryRequirementsTypeNV
pokeByteOff :: forall b.
Ptr b
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
$cpokeByteOff :: forall b.
Ptr b
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
peekByteOff :: forall b.
Ptr b -> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
$cpeekByteOff :: forall b.
Ptr b -> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
pokeElemOff :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
$cpokeElemOff :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> AccelerationStructureMemoryRequirementsTypeNV -> IO ()
peekElemOff :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
$cpeekElemOff :: Ptr AccelerationStructureMemoryRequirementsTypeNV
-> Int -> IO AccelerationStructureMemoryRequirementsTypeNV
alignment :: AccelerationStructureMemoryRequirementsTypeNV -> Int
$calignment :: AccelerationStructureMemoryRequirementsTypeNV -> Int
sizeOf :: AccelerationStructureMemoryRequirementsTypeNV -> Int
$csizeOf :: AccelerationStructureMemoryRequirementsTypeNV -> Int
Storable, AccelerationStructureMemoryRequirementsTypeNV
forall a. a -> Zero a
zero :: AccelerationStructureMemoryRequirementsTypeNV
$czero :: AccelerationStructureMemoryRequirementsTypeNV
Zero)

-- | 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV' requests the
-- memory requirement for the
-- 'Vulkan.Extensions.Handles.AccelerationStructureNV' backing store.
pattern $bACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV :: AccelerationStructureMemoryRequirementsTypeNV
$mACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV :: forall {r}.
AccelerationStructureMemoryRequirementsTypeNV
-> ((# #) -> r) -> ((# #) -> r) -> r
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV = AccelerationStructureMemoryRequirementsTypeNV 0

-- | 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV'
-- requests the memory requirement for scratch space during the initial
-- build.
pattern $bACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV :: AccelerationStructureMemoryRequirementsTypeNV
$mACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV :: forall {r}.
AccelerationStructureMemoryRequirementsTypeNV
-> ((# #) -> r) -> ((# #) -> r) -> r
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV = AccelerationStructureMemoryRequirementsTypeNV 1

-- | 'ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV'
-- requests the memory requirement for scratch space during an update.
pattern $bACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV :: AccelerationStructureMemoryRequirementsTypeNV
$mACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV :: forall {r}.
AccelerationStructureMemoryRequirementsTypeNV
-> ((# #) -> r) -> ((# #) -> r) -> r
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV = AccelerationStructureMemoryRequirementsTypeNV 2

{-# COMPLETE
  ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
  , ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
  , ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV ::
    AccelerationStructureMemoryRequirementsTypeNV
  #-}

conNameAccelerationStructureMemoryRequirementsTypeNV :: String
conNameAccelerationStructureMemoryRequirementsTypeNV :: String
conNameAccelerationStructureMemoryRequirementsTypeNV = String
"AccelerationStructureMemoryRequirementsTypeNV"

enumPrefixAccelerationStructureMemoryRequirementsTypeNV :: String
enumPrefixAccelerationStructureMemoryRequirementsTypeNV :: String
enumPrefixAccelerationStructureMemoryRequirementsTypeNV = String
"ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_"

showTableAccelerationStructureMemoryRequirementsTypeNV :: [(AccelerationStructureMemoryRequirementsTypeNV, String)]
showTableAccelerationStructureMemoryRequirementsTypeNV :: [(AccelerationStructureMemoryRequirementsTypeNV, String)]
showTableAccelerationStructureMemoryRequirementsTypeNV =
  [
    ( AccelerationStructureMemoryRequirementsTypeNV
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
    , String
"OBJECT_NV"
    )
  ,
    ( AccelerationStructureMemoryRequirementsTypeNV
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
    , String
"BUILD_SCRATCH_NV"
    )
  ,
    ( AccelerationStructureMemoryRequirementsTypeNV
ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
    , String
"UPDATE_SCRATCH_NV"
    )
  ]

instance Show AccelerationStructureMemoryRequirementsTypeNV where
  showsPrec :: Int -> AccelerationStructureMemoryRequirementsTypeNV -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixAccelerationStructureMemoryRequirementsTypeNV
      [(AccelerationStructureMemoryRequirementsTypeNV, String)]
showTableAccelerationStructureMemoryRequirementsTypeNV
      String
conNameAccelerationStructureMemoryRequirementsTypeNV
      (\(AccelerationStructureMemoryRequirementsTypeNV Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read AccelerationStructureMemoryRequirementsTypeNV where
  readPrec :: ReadPrec AccelerationStructureMemoryRequirementsTypeNV
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixAccelerationStructureMemoryRequirementsTypeNV
      [(AccelerationStructureMemoryRequirementsTypeNV, String)]
showTableAccelerationStructureMemoryRequirementsTypeNV
      String
conNameAccelerationStructureMemoryRequirementsTypeNV
      Int32 -> AccelerationStructureMemoryRequirementsTypeNV
AccelerationStructureMemoryRequirementsTypeNV

-- No documentation found for TopLevel "VkGeometryFlagsNV"
type GeometryFlagsNV = GeometryFlagsKHR


-- No documentation found for TopLevel "VkGeometryInstanceFlagsNV"
type GeometryInstanceFlagsNV = GeometryInstanceFlagsKHR


-- No documentation found for TopLevel "VkBuildAccelerationStructureFlagsNV"
type BuildAccelerationStructureFlagsNV = BuildAccelerationStructureFlagsKHR


-- No documentation found for TopLevel "VkGeometryFlagBitsNV"
type GeometryFlagBitsNV = GeometryFlagBitsKHR


-- No documentation found for TopLevel "VkGeometryInstanceFlagBitsNV"
type GeometryInstanceFlagBitsNV = GeometryInstanceFlagBitsKHR


-- No documentation found for TopLevel "VkBuildAccelerationStructureFlagBitsNV"
type BuildAccelerationStructureFlagBitsNV = BuildAccelerationStructureFlagBitsKHR


-- No documentation found for TopLevel "VkCopyAccelerationStructureModeNV"
type CopyAccelerationStructureModeNV = CopyAccelerationStructureModeKHR


-- No documentation found for TopLevel "VkAccelerationStructureTypeNV"
type AccelerationStructureTypeNV = AccelerationStructureTypeKHR


-- No documentation found for TopLevel "VkGeometryTypeNV"
type GeometryTypeNV = GeometryTypeKHR


-- No documentation found for TopLevel "VkRayTracingShaderGroupTypeNV"
type RayTracingShaderGroupTypeNV = RayTracingShaderGroupTypeKHR


-- No documentation found for TopLevel "VkAabbPositionsNV"
type AabbPositionsNV = AabbPositionsKHR


-- No documentation found for TopLevel "VkTransformMatrixNV"
type TransformMatrixNV = TransformMatrixKHR


-- No documentation found for TopLevel "VkAccelerationStructureInstanceNV"
type AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR


type NV_RAY_TRACING_SPEC_VERSION = 3

-- No documentation found for TopLevel "VK_NV_RAY_TRACING_SPEC_VERSION"
pattern NV_RAY_TRACING_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_RAY_TRACING_SPEC_VERSION :: forall a. Integral a => a
$mNV_RAY_TRACING_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_RAY_TRACING_SPEC_VERSION = 3


type NV_RAY_TRACING_EXTENSION_NAME = "VK_NV_ray_tracing"

-- No documentation found for TopLevel "VK_NV_RAY_TRACING_EXTENSION_NAME"
pattern NV_RAY_TRACING_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_RAY_TRACING_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNV_RAY_TRACING_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_RAY_TRACING_EXTENSION_NAME = "VK_NV_ray_tracing"