{-# language CPP #-}
-- | = Name
--
-- VK_KHR_acceleration_structure - device extension
--
-- == VK_KHR_acceleration_structure
--
-- [__Name String__]
--     @VK_KHR_acceleration_structure@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     151
--
-- [__Revision__]
--     11
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.1
--
--     -   Requires @VK_EXT_descriptor_indexing@
--
--     -   Requires @VK_KHR_buffer_device_address@
--
--     -   Requires @VK_KHR_deferred_host_operations@
--
-- [__Contact__]
--
--     -   Daniel Koch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_acceleration_structure:%20&body=@dgkoch%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2020-11-12
--
-- [__Contributors__]
--
--     -   Matthäus Chajdas, AMD
--
--     -   Greg Grebe, AMD
--
--     -   Nicolai Hähnle, AMD
--
--     -   Tobias Hector, AMD
--
--     -   Dave Oldcorn, AMD
--
--     -   Skyler Saleh, AMD
--
--     -   Mathieu Robart, Arm
--
--     -   Marius Bjorge, Arm
--
--     -   Tom Olson, Arm
--
--     -   Sebastian Tafuri, EA
--
--     -   Henrik Rydgard, Embark
--
--     -   Juan Cañada, Epic Games
--
--     -   Patrick Kelly, Epic Games
--
--     -   Yuriy O’Donnell, Epic Games
--
--     -   Michael Doggett, Facebook\/Oculus
--
--     -   Ricardo Garcia, Igalia
--
--     -   Andrew Garrard, Imagination
--
--     -   Don Scorgie, Imagination
--
--     -   Dae Kim, Imagination
--
--     -   Joshua Barczak, Intel
--
--     -   Slawek Grajewski, Intel
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Pascal Gautron, NVIDIA
--
--     -   Daniel Koch, NVIDIA
--
--     -   Christoph Kubisch, NVIDIA
--
--     -   Ashwin Lele, NVIDIA
--
--     -   Robert Stepinski, NVIDIA
--
--     -   Martin Stich, NVIDIA
--
--     -   Nuno Subtil, NVIDIA
--
--     -   Eric Werness, NVIDIA
--
--     -   Jon Leech, Khronos
--
--     -   Jeroen van Schijndel, OTOY
--
--     -   Juul Joosten, OTOY
--
--     -   Alex Bourd, Qualcomm
--
--     -   Roman Larionov, Qualcomm
--
--     -   David McAllister, Qualcomm
--
--     -   Lewis Gordon, Samsung
--
--     -   Ralph Potter, Samsung
--
--     -   Jasper Bekkers, Traverse Research
--
--     -   Jesse Barker, Unity
--
--     -   Baldur Karlsson, Valve
--
-- == Description
--
-- In order to be efficient, rendering techniques such as ray tracing need
-- a quick way to identify which primitives may be intersected by a ray
-- traversing the geometries. Acceleration structures are the most common
-- way to represent the geometry spatially sorted, in order to quickly
-- identify such potential intersections.
--
-- This extension adds new functionalities:
--
-- -   Acceleration structure objects and build commands
--
-- -   Structures to describe geometry inputs to acceleration structure
--     builds
--
-- -   Acceleration structure copy commands
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.AccelerationStructureKHR'
--
-- == New Commands
--
-- -   'buildAccelerationStructuresKHR'
--
-- -   'cmdBuildAccelerationStructuresIndirectKHR'
--
-- -   'cmdBuildAccelerationStructuresKHR'
--
-- -   'cmdCopyAccelerationStructureKHR'
--
-- -   'cmdCopyAccelerationStructureToMemoryKHR'
--
-- -   'cmdCopyMemoryToAccelerationStructureKHR'
--
-- -   'cmdWriteAccelerationStructuresPropertiesKHR'
--
-- -   'copyAccelerationStructureKHR'
--
-- -   'copyAccelerationStructureToMemoryKHR'
--
-- -   'copyMemoryToAccelerationStructureKHR'
--
-- -   'createAccelerationStructureKHR'
--
-- -   'destroyAccelerationStructureKHR'
--
-- -   'getAccelerationStructureBuildSizesKHR'
--
-- -   'getAccelerationStructureDeviceAddressKHR'
--
-- -   'getDeviceAccelerationStructureCompatibilityKHR'
--
-- -   'writeAccelerationStructuresPropertiesKHR'
--
-- == New Structures
--
-- -   'AabbPositionsKHR'
--
-- -   'AccelerationStructureBuildGeometryInfoKHR'
--
-- -   'AccelerationStructureBuildRangeInfoKHR'
--
-- -   'AccelerationStructureBuildSizesInfoKHR'
--
-- -   'AccelerationStructureCreateInfoKHR'
--
-- -   'AccelerationStructureDeviceAddressInfoKHR'
--
-- -   'AccelerationStructureGeometryAabbsDataKHR'
--
-- -   'AccelerationStructureGeometryInstancesDataKHR'
--
-- -   'AccelerationStructureGeometryKHR'
--
-- -   'AccelerationStructureGeometryTrianglesDataKHR'
--
-- -   'AccelerationStructureInstanceKHR'
--
-- -   'AccelerationStructureVersionInfoKHR'
--
-- -   'CopyAccelerationStructureInfoKHR'
--
-- -   'CopyAccelerationStructureToMemoryInfoKHR'
--
-- -   'CopyMemoryToAccelerationStructureInfoKHR'
--
-- -   'TransformMatrixKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceAccelerationStructureFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceAccelerationStructurePropertiesKHR'
--
-- -   Extending 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet':
--
--     -   'WriteDescriptorSetAccelerationStructureKHR'
--
-- == New Unions
--
-- -   'AccelerationStructureGeometryDataKHR'
--
-- -   'DeviceOrHostAddressConstKHR'
--
-- -   'DeviceOrHostAddressKHR'
--
-- == New Enums
--
-- -   'AccelerationStructureBuildTypeKHR'
--
-- -   'AccelerationStructureCompatibilityKHR'
--
-- -   'AccelerationStructureCreateFlagBitsKHR'
--
-- -   'AccelerationStructureTypeKHR'
--
-- -   'BuildAccelerationStructureFlagBitsKHR'
--
-- -   'BuildAccelerationStructureModeKHR'
--
-- -   'CopyAccelerationStructureModeKHR'
--
-- -   'GeometryFlagBitsKHR'
--
-- -   'GeometryInstanceFlagBitsKHR'
--
-- -   'GeometryTypeKHR'
--
-- == New Bitmasks
--
-- -   'AccelerationStructureCreateFlagsKHR'
--
-- -   'BuildAccelerationStructureFlagsKHR'
--
-- -   'GeometryFlagsKHR'
--
-- -   'GeometryInstanceFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME'
--
-- -   'KHR_ACCELERATION_STRUCTURE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits':
--
--     -   'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'
--
--     -   'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR'
--
-- -   Extending
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BufferUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR'
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR'
--
-- -   Extending
--     'Vulkan.Extensions.VK_EXT_debug_report.DebugReportObjectTypeEXT':
--
--     -   'Vulkan.Extensions.VK_EXT_debug_report.DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.DescriptorType.DescriptorType':
--
--     -   'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR'
--
-- -   Extending
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits':
--
--     -   'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.IndexType.IndexType':
--
--     -   'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits':
--
--     -   'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.QueryType.QueryType':
--
--     -   'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR'
--
--     -   'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR'
--
-- == Issues
--
-- (1) How does this extension differ from VK_NV_ray_tracing?
--
-- __DISCUSSION__:
--
-- The following is a summary of the main functional differences between
-- VK_KHR_acceleration_structure and VK_NV_ray_tracing:
--
-- -   added acceleration structure serialization \/ deserialization
--     ('COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR',
--     'COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR',
--     'cmdCopyAccelerationStructureToMemoryKHR',
--     'cmdCopyMemoryToAccelerationStructureKHR')
--
-- -   document
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive primitives and instances>
--
-- -   added 'PhysicalDeviceAccelerationStructureFeaturesKHR' structure
--
-- -   added indirect and batched acceleration structure builds
--     ('cmdBuildAccelerationStructuresIndirectKHR')
--
-- -   added
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#host-acceleration-structure host acceleration structure>
--     commands
--
-- -   reworked geometry structures so they could be better shared between
--     device, host, and indirect builds
--
-- -   explicitly made 'Vulkan.Extensions.Handles.AccelerationStructureKHR'
--     use device addresses
--
-- -   added acceleration structure compatibility check function
--     ('getDeviceAccelerationStructureCompatibilityKHR')
--
-- -   add parameter for requesting memory requirements for host and\/or
--     device build
--
-- -   added format feature for acceleration structure build vertex formats
--     ('Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR')
--
-- (2) Can you give a more detailed comparision of differences and
-- similarities between VK_NV_ray_tracing and
-- VK_KHR_acceleration_structure?
--
-- __DISCUSSION__:
--
-- The following is a more detailed comparision of which commands,
-- structures, and enums are aliased, changed, or removed.
--
-- -   Aliased functionality — enums, structures, and commands that are
--     considered equivalent:
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryTypeNV' ↔
--         'GeometryTypeKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureTypeNV'
--         ↔ 'AccelerationStructureTypeKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.CopyAccelerationStructureModeNV'
--         ↔ 'CopyAccelerationStructureModeKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryFlagsNV' ↔
--         'GeometryFlagsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryFlagBitsNV' ↔
--         'GeometryFlagBitsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryInstanceFlagsNV' ↔
--         'GeometryInstanceFlagsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryInstanceFlagBitsNV'
--         ↔ 'GeometryInstanceFlagBitsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.BuildAccelerationStructureFlagsNV'
--         ↔ 'BuildAccelerationStructureFlagsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.BuildAccelerationStructureFlagBitsNV'
--         ↔ 'BuildAccelerationStructureFlagBitsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.TransformMatrixNV' ↔
--         'TransformMatrixKHR' (added to VK_NV_ray_tracing for descriptive
--         purposes)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AabbPositionsNV' ↔
--         'AabbPositionsKHR' (added to VK_NV_ray_tracing for descriptive
--         purposes)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureInstanceNV'
--         ↔ 'AccelerationStructureInstanceKHR' (added to VK_NV_ray_tracing
--         for descriptive purposes)
--
-- -   Changed enums, structures, and commands:
--
--     -   renamed
--         'Vulkan.Extensions.VK_NV_ray_tracing.GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV'
--         → 'GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR' in
--         'GeometryInstanceFlagBitsKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryTrianglesNV' →
--         'AccelerationStructureGeometryTrianglesDataKHR' (device or host
--         address instead of buffer+offset)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryAABBNV' →
--         'AccelerationStructureGeometryAabbsDataKHR' (device or host
--         address instead of buffer+offset)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryDataNV' →
--         'AccelerationStructureGeometryDataKHR' (union of
--         triangle\/aabbs\/instances)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.GeometryNV' →
--         'AccelerationStructureGeometryKHR' (changed type of geometry)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureCreateInfoNV'
--         → 'AccelerationStructureCreateInfoKHR' (reshuffle geometry
--         layout\/info)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.PhysicalDeviceRayTracingPropertiesNV'
--         → 'PhysicalDeviceAccelerationStructurePropertiesKHR' (for
--         acceleration structure properties, renamed @maxTriangleCount@ to
--         @maxPrimitiveCount@, added per stage and update after bind
--         limits) and
--         'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.PhysicalDeviceRayTracingPipelinePropertiesKHR'
--         (for ray tracing pipeline properties)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureMemoryRequirementsInfoNV'
--         (deleted - replaced by allocating on top of
--         'Vulkan.Core10.Handles.Buffer')
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.WriteDescriptorSetAccelerationStructureNV'
--         → 'WriteDescriptorSetAccelerationStructureKHR' (different
--         acceleration structure type)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.createAccelerationStructureNV'
--         → 'createAccelerationStructureKHR' (device address, different
--         geometry layout\/info)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.getAccelerationStructureMemoryRequirementsNV'
--         (deleted - replaced by allocating on top of
--         'Vulkan.Core10.Handles.Buffer')
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.cmdBuildAccelerationStructureNV'
--         → 'cmdBuildAccelerationStructuresKHR' (params moved to structs,
--         layout differences)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.cmdCopyAccelerationStructureNV'
--         → 'cmdCopyAccelerationStructureKHR' (params to struct,
--         extendable)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.getAccelerationStructureHandleNV'
--         → 'getAccelerationStructureDeviceAddressKHR' (device address
--         instead of handle)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureMemoryRequirementsTypeNV'
--         → size queries for scratch space moved to
--         'getAccelerationStructureBuildSizesKHR'
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.destroyAccelerationStructureNV'
--         → 'destroyAccelerationStructureKHR' (different acceleration
--         structure types)
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.cmdWriteAccelerationStructuresPropertiesNV'
--         → 'cmdWriteAccelerationStructuresPropertiesKHR' (different
--         acceleration structure types)
--
-- -   Added enums, structures and commands:
--
--     -   'GEOMETRY_TYPE_INSTANCES_KHR' to 'GeometryTypeKHR' enum
--
--     -   'COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR',
--         'COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR' to
--         'CopyAccelerationStructureModeKHR' enum
--
--     -   'PhysicalDeviceAccelerationStructureFeaturesKHR' structure
--
--     -   'AccelerationStructureBuildTypeKHR' enum
--
--     -   'BuildAccelerationStructureModeKHR' enum
--
--     -   'DeviceOrHostAddressKHR' and 'DeviceOrHostAddressConstKHR'
--         unions
--
--     -   'AccelerationStructureBuildRangeInfoKHR' struct
--
--     -   'AccelerationStructureGeometryInstancesDataKHR' struct
--
--     -   'AccelerationStructureDeviceAddressInfoKHR' struct
--
--     -   'AccelerationStructureVersionInfoKHR' struct
--
--     -   'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.StridedDeviceAddressRegionKHR'
--         struct
--
--     -   'CopyAccelerationStructureToMemoryInfoKHR' struct
--
--     -   'CopyMemoryToAccelerationStructureInfoKHR' struct
--
--     -   'CopyAccelerationStructureInfoKHR' struct
--
--     -   'buildAccelerationStructuresKHR' command (host build)
--
--     -   'copyAccelerationStructureKHR' command (host copy)
--
--     -   'copyAccelerationStructureToMemoryKHR' (host serialize)
--
--     -   'copyMemoryToAccelerationStructureKHR' (host deserialize)
--
--     -   'writeAccelerationStructuresPropertiesKHR' (host properties)
--
--     -   'cmdCopyAccelerationStructureToMemoryKHR' (device serialize)
--
--     -   'cmdCopyMemoryToAccelerationStructureKHR' (device deserialize)
--
--     -   'getDeviceAccelerationStructureCompatibilityKHR' (serialization)
--
-- (3) What are the changes between the public provisional
-- (VK_KHR_ray_tracing v8) release and the internal provisional
-- (VK_KHR_ray_tracing v9) release?
--
-- -   added @geometryFlags@ to
--     @VkAccelerationStructureCreateGeometryTypeInfoKHR@ (later reworked
--     to obsolete this)
--
-- -   added @minAccelerationStructureScratchOffsetAlignment@ property to
--     VkPhysicalDeviceRayTracingPropertiesKHR
--
-- -   fix naming and return enum from
--     'getDeviceAccelerationStructureCompatibilityKHR'
--
--     -   renamed @VkAccelerationStructureVersionKHR@ to
--         'AccelerationStructureVersionInfoKHR'
--
--     -   renamed @VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_KHR@
--         to
--         'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR'
--
--     -   removed @VK_ERROR_INCOMPATIBLE_VERSION_KHR@
--
--     -   added 'AccelerationStructureCompatibilityKHR' enum
--
--     -   remove return value from
--         'getDeviceAccelerationStructureCompatibilityKHR' and added
--         return enum parameter
--
-- -   Require Vulkan 1.1
--
-- -   added creation time capture and replay flags
--
--     -   added 'AccelerationStructureCreateFlagBitsKHR' and
--         'AccelerationStructureCreateFlagsKHR'
--
--     -   renamed the @flags@ member of
--         'AccelerationStructureCreateInfoKHR' to @buildFlags@ (later
--         removed) and added the @createFlags@ member
--
-- -   change 'cmdBuildAccelerationStructuresIndirectKHR' to use buffer
--     device address for indirect parameter
--
-- -   make
--     <VK_KHR_deferred_host_operations.html VK_KHR_deferred_host_operations>
--     an interaction instead of a required extension (later went back on
--     this)
--
-- -   renamed @VkAccelerationStructureBuildOffsetInfoKHR@ to
--     'AccelerationStructureBuildRangeInfoKHR'
--
--     -   renamed the @ppOffsetInfos@ parameter of
--         'cmdBuildAccelerationStructuresKHR' to @ppBuildRangeInfos@
--
-- -   Re-unify geometry description between build and create
--
--     -   remove @VkAccelerationStructureCreateGeometryTypeInfoKHR@ and
--         @VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_GEOMETRY_TYPE_INFO_KHR@
--
--     -   added @VkAccelerationStructureCreateSizeInfoKHR@ structure
--         (later removed)
--
--     -   change type of the @pGeometryInfos@ member of
--         'AccelerationStructureCreateInfoKHR' from
--         @VkAccelerationStructureCreateGeometryTypeInfoKHR@ to
--         'AccelerationStructureGeometryKHR' (later removed)
--
--     -   added @pCreateSizeInfos@ member to
--         'AccelerationStructureCreateInfoKHR' (later removed)
--
-- -   Fix ppGeometries ambiguity, add pGeometries
--
--     -   remove @geometryArrayOfPointers@ member of
--         VkAccelerationStructureBuildGeometryInfoKHR
--
--     -   disambiguate two meanings of @ppGeometries@ by explicitly adding
--         @pGeometries@ to the 'AccelerationStructureBuildGeometryInfoKHR'
--         structure and require one of them be @NULL@
--
-- -   added
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     support for acceleration structures
--
-- -   changed the @update@ member of
--     'AccelerationStructureBuildGeometryInfoKHR' from a bool to the
--     @mode@ 'BuildAccelerationStructureModeKHR' enum which allows future
--     extensibility in update types
--
-- -   Clarify deferred host ops for pipeline creation
--
--     -   'Vulkan.Extensions.Handles.DeferredOperationKHR' is now a
--         top-level parameter for 'buildAccelerationStructuresKHR',
--         'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.createRayTracingPipelinesKHR',
--         'copyAccelerationStructureToMemoryKHR',
--         'copyAccelerationStructureKHR', and
--         'copyMemoryToAccelerationStructureKHR'
--
--     -   removed @VkDeferredOperationInfoKHR@ structure
--
--     -   change deferred host creation\/return parameter behavior such
--         that the implementation can modify such parameters until the
--         deferred host operation completes
--
--     -   <VK_KHR_deferred_host_operations.html VK_KHR_deferred_host_operations>
--         is required again
--
-- -   Change acceleration structure build to always be sized
--
--     -   de-alias
--         'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureMemoryRequirementsTypeNV'
--         and @VkAccelerationStructureMemoryRequirementsTypeKHR@ and
--         remove @VkAccelerationStructureMemoryRequirementsTypeKHR@
--
--     -   add 'getAccelerationStructureBuildSizesKHR' command and
--         'AccelerationStructureBuildSizesInfoKHR' structure and
--         'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR'
--         enum to query sizes for acceleration structures and scratch
--         storage
--
--     -   move size queries for scratch space to
--         'getAccelerationStructureBuildSizesKHR'
--
--     -   remove @compactedSize@, @buildFlags@, @maxGeometryCount@,
--         @pGeometryInfos@, @pCreateSizeInfos@ members of
--         'AccelerationStructureCreateInfoKHR' and add the @size@ member
--
--     -   add @maxVertex@ member to
--         'AccelerationStructureGeometryTrianglesDataKHR' structure
--
--     -   remove @VkAccelerationStructureCreateSizeInfoKHR@ structure
--
-- (4) What are the changes between the internal provisional
-- (VK_KHR_ray_tracing v9) release and the final
-- (VK_KHR_acceleration_structure v11) release?
--
-- -   refactor VK_KHR_ray_tracing into 3 extensions, enabling
--     implementation flexibility and decoupling ray query support from ray
--     pipelines:
--
--     -   <VK_KHR_acceleration_structure.html VK_KHR_acceleration_structure>
--         (for acceleration structure operations)
--
--     -   <VK_KHR_ray_tracing_pipeline.html VK_KHR_ray_tracing_pipeline>
--         (for ray tracing pipeline and shader stages)
--
--     -   <VK_KHR_ray_query.html VK_KHR_ray_query> (for ray queries in
--         existing shader stages)
--
-- -   clarify buffer usage flags for ray tracing
--
--     -   'Vulkan.Extensions.VK_NV_ray_tracing.BUFFER_USAGE_RAY_TRACING_BIT_NV'
--         is left alone in <VK_NV_ray_tracing.html VK_NV_ray_tracing>
--         (required on @scratch@ and @instanceData@)
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR'
--         is added as an alias of
--         'Vulkan.Extensions.VK_NV_ray_tracing.BUFFER_USAGE_RAY_TRACING_BIT_NV'
--         in
--         <VK_KHR_ray_tracing_pipeline.html VK_KHR_ray_tracing_pipeline>
--         and is required on shader binding table buffers
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR'
--         is added in
--         <VK_KHR_acceleration_structure.html VK_KHR_acceleration_structure>
--         for all vertex, index, transform, aabb, and instance buffer data
--         referenced by device build commands
--
--     -   'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_STORAGE_BUFFER_BIT'
--         is used for @scratchData@
--
-- -   add max primitive counts (@ppMaxPrimitiveCounts@) to
--     'cmdBuildAccelerationStructuresIndirectKHR'
--
-- -   Allocate acceleration structures from @VkBuffers@ and add a mode to
--     constrain the device address
--
--     -   de-alias
--         'Vulkan.Extensions.VK_NV_ray_tracing.BindAccelerationStructureMemoryInfoNV',
--         'Vulkan.Extensions.VK_NV_ray_tracing.bindAccelerationStructureMemoryNV',
--         and remove @VkBindAccelerationStructureMemoryInfoKHR@,
--         @VkAccelerationStructureMemoryRequirementsInfoKHR@, and
--         @vkGetAccelerationStructureMemoryRequirementsKHR@
--
--     -   acceleration structures now take a
--         'Vulkan.Core10.Handles.Buffer' and offset at creation time for
--         memory placement
--
--     -   add a new
--         'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR'
--         buffer usage such buffers
--
--     -   add a new 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' acceleration
--         structure type for layering
--
-- -   move 'GEOMETRY_TYPE_INSTANCES_KHR' to main enum instead of being
--     added via extension
--
-- -   make build commands more consistent - all now build multiple
--     acceleration structures and are named plurally
--     ('cmdBuildAccelerationStructuresIndirectKHR',
--     'cmdBuildAccelerationStructuresKHR',
--     'buildAccelerationStructuresKHR')
--
-- -   add interactions with
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
--     for acceleration structures, including a new feature
--     (@descriptorBindingAccelerationStructureUpdateAfterBind@) and 3 new
--     properties (@maxPerStageDescriptorAccelerationStructures@,
--     @maxPerStageDescriptorUpdateAfterBindAccelerationStructures@,
--     @maxDescriptorSetUpdateAfterBindAccelerationStructures@)
--
-- -   extension is no longer provisional
--
-- -   define synchronization requirements for builds, traces, and copies
--
-- -   define synchronization requirements for AS build inputs and indirect
--     build buffer
--
-- (5) What is 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' for?
--
-- RESOLVED: It is primarily intended for API layering. In DXR, the
-- acceleration structure is basically just a buffer in a special layout,
-- and you don’t know at creation time whether it will be used as a top or
-- bottom level acceleration structure. We thus added a generic
-- acceleration structure type whose type is unknown at creation time, but
-- is specified at build type instead. Applications which are written
-- directly for Vulkan should not use it.
--
-- == Version History
--
-- -   Revision 1, 2019-12-05 (Members of the Vulkan Ray Tracing TSG)
--
--     -   Internal revisions (forked from VK_NV_ray_tracing)
--
-- -   Revision 2, 2019-12-20 (Daniel Koch, Eric Werness)
--
--     -   Add const version of DeviceOrHostAddress (!3515)
--
--     -   Add VU to clarify that only handles in the current pipeline are
--         valid (!3518)
--
--     -   Restore some missing VUs and add in-place update language
--         (#1902, !3522)
--
--     -   rename VkAccelerationStructureInstanceKHR member from
--         accelerationStructure to accelerationStructureReference to
--         better match its type (!3523)
--
--     -   Allow VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS for pipeline
--         creation if shader group handles cannot be re-used. (!3523)
--
--     -   update documentation for the
--         VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS error code and add
--         missing documentation for new return codes from
--         VK_KHR_deferred_host_operations (!3523)
--
--     -   list new query types for VK_KHR_ray_tracing (!3523)
--
--     -   Fix VU statements for VkAccelerationStructureGeometryKHR
--         referring to correct union members and update to use more
--         current wording (!3523)
--
-- -   Revision 3, 2020-01-10 (Daniel Koch, Jon Leech, Christoph Kubisch)
--
--     -   Fix \'instance of\' and \'that\/which contains\/defines\' markup
--         issues (!3528)
--
--     -   factor out VK_KHR_pipeline_library as stand-alone extension
--         (!3540)
--
--     -   Resolve Vulkan-hpp issues (!3543)
--
--     -   add missing require for VkGeometryInstanceFlagsKHR
--
--     -   de-alias VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV
--         since the KHR structure is no longer equivalent
--
--     -   add len to pDataSize attribute for
--         vkWriteAccelerationStructuresPropertiesKHR
--
-- -   Revision 4, 2020-01-23 (Daniel Koch, Eric Werness)
--
--     -   Improve vkWriteAccelerationStructuresPropertiesKHR, add return
--         value and VUs (#1947)
--
--     -   Clarify language to allow multiple raygen shaders (#1959)
--
--     -   Various editorial feedback (!3556)
--
--     -   Add language to help deal with looped self-intersecting fans
--         (#1901)
--
--     -   Change vkCmdTraceRays{Indirect}KHR args to pointers (!3559)
--
--     -   Add scratch address validation language (#1941, !3551)
--
--     -   Fix definition and add hierarchy information for shader call
--         scope (#1977, !3571)
--
-- -   Revision 5, 2020-02-04 (Eric Werness, Jeff Bolz, Daniel Koch)
--
--     -   remove vestigial accelerationStructureUUID (!3582)
--
--     -   update definition of repack instructions and improve memory
--         model interactions (#1910, #1913, !3584)
--
--     -   Fix wrong sType for VkPhysicalDeviceRayTracingFeaturesKHR
--         (#1988)
--
--     -   Use provisional SPIR-V capabilities (#1987)
--
--     -   require rayTraversalPrimitiveCulling if rayQuery is supported
--         (#1927)
--
--     -   Miss shaders do not have object parameters (!3592)
--
--     -   Fix missing required types in XML (!3592)
--
--     -   clarify matching conditions for update (!3592)
--
--     -   add goal that host and device builds be similar (!3592)
--
--     -   clarify that @maxPrimitiveCount@ limit should apply to triangles
--         and AABBs (!3592)
--
--     -   Require alignment for instance arrayOfPointers (!3592)
--
--     -   Zero is a valid value for instance flags (!3592)
--
--     -   Add some alignment VUs that got lost in refactoring (!3592)
--
--     -   Recommend TMin epsilon rather than culling (!3592)
--
--     -   Get angle from dot product not cross product (!3592)
--
--     -   Clarify that AH can access the payload and attributes (!3592)
--
--     -   Match DXR behavior for inactive primitive definition (!3592)
--
--     -   Use a more generic term than degenerate for inactive to avoid
--         confusion (!3592)
--
-- -   Revision 6, 2020-02-20 (Daniel Koch)
--
--     -   fix some dangling NV references (#1996)
--
--     -   rename VkCmdTraceRaysIndirectCommandKHR to
--         VkTraceRaysIndirectCommandKHR (!3607)
--
--     -   update contributor list (!3611)
--
--     -   use uint64_t instead of VkAccelerationStructureReferenceKHR in
--         VkAccelerationStructureInstanceKHR (#2004)
--
-- -   Revision 7, 2020-02-28 (Tobias Hector)
--
--     -   remove HitTKHR SPIR-V builtin (spirv\/spirv-extensions#7)
--
-- -   Revision 8, 2020-03-06 (Tobias Hector, Dae Kim, Daniel Koch, Jeff
--     Bolz, Eric Werness)
--
--     -   explicitly state that Tmax is updated when new closest
--         intersection is accepted (#2020,!3536)
--
--     -   Made references to min and max t values consistent (!3644)
--
--     -   finish enumerating differences relative to VK_NV_ray_tracing in
--         issues (1) and (2) (#1974,!3642)
--
--     -   fix formatting in some math equations (!3642)
--
--     -   Restrict the Hit Kind operand of @OpReportIntersectionKHR@ to
--         7-bits (spirv\/spirv-extensions#8,!3646)
--
--     -   Say ray tracing \'/should/\' be watertight (#2008,!3631)
--
--     -   Clarify memory requirements for ray tracing buffers
--         (#2005,!3649)
--
--     -   Add callable size limits (#1997,!3652)
--
-- -   Revision 9, 2020-04-15 (Eric Werness, Daniel Koch, Tobias Hector,
--     Joshua Barczak)
--
--     -   Add geometry flags to acceleration structure creation (!3672)
--
--     -   add build scratch memory alignment
--         (minAccelerationStructureScratchOffsetAlignment) (#2065,!3725)
--
--     -   fix naming and return enum from
--         vkGetDeviceAccelerationStructureCompatibilityKHR (#2051,!3726)
--
--     -   require SPIR-V 1.4 (#2096,!3777)
--
--     -   added creation time capture\/replay flags (#2104,!3774)
--
--     -   require Vulkan 1.1 (#2133,!3806)
--
--     -   use device addresses instead of VkBuffers for ray tracing
--         commands (#2074,!3815)
--
--     -   add interactions with Vulkan 1.2 and VK_KHR_vulkan_memory_model
--         (#2133,!3830)
--
--     -   make VK_KHR_pipeline_library an interaction instead of required
--         (#2045,#2108,!3830)
--
--     -   make VK_KHR_deferred_host_operations an interaction instead of
--         required (#2045,!3830)
--
--     -   removed maxCallableSize and added explicit stack size management
--         for ray pipelines (#1997,!3817,!3772,!3844)
--
--     -   improved documentation for VkAccelerationStructureVersionInfoKHR
--         (#2135,3835)
--
--     -   rename VkAccelerationStructureBuildOffsetInfoKHR to
--         VkAccelerationStructureBuildRangeInfoKHR (#2058,!3754)
--
--     -   Re-unify geometry description between build and create (!3754)
--
--     -   Fix ppGeometries ambiguity, add pGeometries (#2032,!3811)
--
--     -   add interactions with VK_EXT_robustness2 and allow
--         nullDescriptor support for acceleration structures (#1920,!3848)
--
--     -   added future extensibility for AS updates (#2114,!3849)
--
--     -   Fix VU for dispatchrays and add a limit on the size of the full
--         grid (#2160,!3851)
--
--     -   Add shaderGroupHandleAlignment property (#2180,!3875)
--
--     -   Clarify deferred host ops for pipeline creation (#2067,!3813)
--
--     -   Change acceleration structure build to always be sized
--         (#2131,#2197,#2198,!3854,!3883,!3880)
--
-- -   Revision 10, 2020-07-03 (Mathieu Robart, Daniel Koch, Eric Werness,
--     Tobias Hector)
--
--     -   Decomposition of the specification, from VK_KHR_ray_tracing to
--         VK_KHR_acceleration_structure (#1918,!3912)
--
--     -   clarify buffer usage flags for ray tracing (#2181,!3939)
--
--     -   add max primitive counts to build indirect command (#2233,!3944)
--
--     -   Allocate acceleration structures from VkBuffers and add a mode
--         to constrain the device address (#2131,!3936)
--
--     -   Move VK_GEOMETRY_TYPE_INSTANCES_KHR to main enum (#2243,!3952)
--
--     -   make build commands more consistent (#2247,!3958)
--
--     -   add interactions with UPDATE_AFTER_BIND (#2128,!3986)
--
--     -   correct and expand build command VUs (!4020)
--
--     -   fix copy command VUs (!4018)
--
--     -   added various alignment requirements (#2229,!3943)
--
--     -   fix valid usage for arrays of geometryCount items (#2198,!4010)
--
--     -   define what is allowed to change on RTAS updates and relevant
--         VUs (#2177,!3961)
--
-- -   Revision 11, 2020-11-12 (Eric Werness, Josh Barczak, Daniel Koch,
--     Tobias Hector)
--
--     -   de-alias NV and KHR acceleration structure types and associated
--         commands (#2271,!4035)
--
--     -   specify alignment for host copy commands (#2273,!4037)
--
--     -   document
--         'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR'
--
--     -   specify that acceleration structures are non-linear
--         (#2289,!4068)
--
--     -   add several missing VUs for strides, vertexFormat, and indexType
--         (#2315,!4069)
--
--     -   restore VUs for VkAccelerationStructureBuildGeometryInfoKHR
--         (#2337,!4098)
--
--     -   ban multi-instance memory for host operations (#2324,!4102)
--
--     -   allow dstAccelerationStructure to be null for
--         vkGetAccelerationStructureBuildSizesKHR (#2330,!4111)
--
--     -   more build VU cleanup (#2138,#4130)
--
--     -   specify host endianness for AS serialization (#2261,!4136)
--
--     -   add invertible transform matrix VU (#1710,!4140)
--
--     -   require geometryCount to be 1 for TLAS builds (!4145)
--
--     -   improved validity conditions for build addresses (#4142)
--
--     -   add single statement SPIR-V VUs, build limit VUs (!4158)
--
--     -   document limits for vertex and aabb strides (#2390,!4184)
--
--     -   specify that
--         'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
--         applies to AS copies (#2382,#4173)
--
--     -   define sync for AS build inputs and indirect buffer
--         (#2407,!4208)
--
-- = See Also
--
-- 'AabbPositionsKHR', 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureBuildRangeInfoKHR',
-- 'AccelerationStructureBuildSizesInfoKHR',
-- 'AccelerationStructureBuildTypeKHR',
-- 'AccelerationStructureCompatibilityKHR',
-- 'AccelerationStructureCreateFlagBitsKHR',
-- 'AccelerationStructureCreateFlagsKHR',
-- 'AccelerationStructureCreateInfoKHR',
-- 'AccelerationStructureDeviceAddressInfoKHR',
-- 'AccelerationStructureGeometryAabbsDataKHR',
-- 'AccelerationStructureGeometryDataKHR',
-- 'AccelerationStructureGeometryInstancesDataKHR',
-- 'AccelerationStructureGeometryKHR',
-- 'AccelerationStructureGeometryTrianglesDataKHR',
-- 'AccelerationStructureInstanceKHR',
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'AccelerationStructureTypeKHR', 'AccelerationStructureVersionInfoKHR',
-- 'BuildAccelerationStructureFlagBitsKHR',
-- 'BuildAccelerationStructureFlagsKHR',
-- 'BuildAccelerationStructureModeKHR', 'CopyAccelerationStructureInfoKHR',
-- 'CopyAccelerationStructureModeKHR',
-- 'CopyAccelerationStructureToMemoryInfoKHR',
-- 'CopyMemoryToAccelerationStructureInfoKHR',
-- 'DeviceOrHostAddressConstKHR', 'DeviceOrHostAddressKHR',
-- 'GeometryFlagBitsKHR', 'GeometryFlagsKHR',
-- 'GeometryInstanceFlagBitsKHR', 'GeometryInstanceFlagsKHR',
-- 'GeometryTypeKHR', 'PhysicalDeviceAccelerationStructureFeaturesKHR',
-- 'PhysicalDeviceAccelerationStructurePropertiesKHR',
-- 'TransformMatrixKHR', 'WriteDescriptorSetAccelerationStructureKHR',
-- 'buildAccelerationStructuresKHR',
-- 'cmdBuildAccelerationStructuresIndirectKHR',
-- 'cmdBuildAccelerationStructuresKHR', 'cmdCopyAccelerationStructureKHR',
-- 'cmdCopyAccelerationStructureToMemoryKHR',
-- 'cmdCopyMemoryToAccelerationStructureKHR',
-- 'cmdWriteAccelerationStructuresPropertiesKHR',
-- 'copyAccelerationStructureKHR', 'copyAccelerationStructureToMemoryKHR',
-- 'copyMemoryToAccelerationStructureKHR',
-- 'createAccelerationStructureKHR', 'destroyAccelerationStructureKHR',
-- 'getAccelerationStructureBuildSizesKHR',
-- 'getAccelerationStructureDeviceAddressKHR',
-- 'getDeviceAccelerationStructureCompatibilityKHR',
-- 'writeAccelerationStructuresPropertiesKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_acceleration_structure Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_acceleration_structure  ( destroyAccelerationStructureKHR
                                                        , cmdCopyAccelerationStructureKHR
                                                        , copyAccelerationStructureKHR
                                                        , cmdCopyAccelerationStructureToMemoryKHR
                                                        , copyAccelerationStructureToMemoryKHR
                                                        , cmdCopyMemoryToAccelerationStructureKHR
                                                        , copyMemoryToAccelerationStructureKHR
                                                        , cmdWriteAccelerationStructuresPropertiesKHR
                                                        , writeAccelerationStructuresPropertiesKHR
                                                        , getDeviceAccelerationStructureCompatibilityKHR
                                                        , createAccelerationStructureKHR
                                                        , withAccelerationStructureKHR
                                                        , cmdBuildAccelerationStructuresKHR
                                                        , cmdBuildAccelerationStructuresIndirectKHR
                                                        , buildAccelerationStructuresKHR
                                                        , getAccelerationStructureDeviceAddressKHR
                                                        , getAccelerationStructureBuildSizesKHR
                                                        , WriteDescriptorSetAccelerationStructureKHR(..)
                                                        , PhysicalDeviceAccelerationStructureFeaturesKHR(..)
                                                        , PhysicalDeviceAccelerationStructurePropertiesKHR(..)
                                                        , AccelerationStructureGeometryTrianglesDataKHR(..)
                                                        , AccelerationStructureGeometryAabbsDataKHR(..)
                                                        , AccelerationStructureGeometryInstancesDataKHR(..)
                                                        , AccelerationStructureGeometryKHR(..)
                                                        , AccelerationStructureBuildGeometryInfoKHR(..)
                                                        , AccelerationStructureBuildRangeInfoKHR(..)
                                                        , AccelerationStructureCreateInfoKHR(..)
                                                        , AabbPositionsKHR(..)
                                                        , TransformMatrixKHR(..)
                                                        , AccelerationStructureInstanceKHR(..)
                                                        , AccelerationStructureDeviceAddressInfoKHR(..)
                                                        , AccelerationStructureVersionInfoKHR(..)
                                                        , CopyAccelerationStructureInfoKHR(..)
                                                        , CopyAccelerationStructureToMemoryInfoKHR(..)
                                                        , CopyMemoryToAccelerationStructureInfoKHR(..)
                                                        , AccelerationStructureBuildSizesInfoKHR(..)
                                                        , DeviceOrHostAddressKHR(..)
                                                        , DeviceOrHostAddressConstKHR(..)
                                                        , AccelerationStructureGeometryDataKHR(..)
                                                        , GeometryInstanceFlagsKHR
                                                        , GeometryInstanceFlagBitsKHR( GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR
                                                                                     , GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR
                                                                                     , GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR
                                                                                     , GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR
                                                                                     , ..
                                                                                     )
                                                        , GeometryFlagsKHR
                                                        , GeometryFlagBitsKHR( GEOMETRY_OPAQUE_BIT_KHR
                                                                             , GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR
                                                                             , ..
                                                                             )
                                                        , BuildAccelerationStructureFlagsKHR
                                                        , BuildAccelerationStructureFlagBitsKHR( BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR
                                                                                               , BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR
                                                                                               , BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR
                                                                                               , BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR
                                                                                               , BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR
                                                                                               , ..
                                                                                               )
                                                        , AccelerationStructureCreateFlagsKHR
                                                        , AccelerationStructureCreateFlagBitsKHR( ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR
                                                                                                , ..
                                                                                                )
                                                        , CopyAccelerationStructureModeKHR( COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR
                                                                                          , COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR
                                                                                          , COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR
                                                                                          , COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR
                                                                                          , ..
                                                                                          )
                                                        , BuildAccelerationStructureModeKHR( BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR
                                                                                           , BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
                                                                                           , ..
                                                                                           )
                                                        , AccelerationStructureTypeKHR( ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR
                                                                                      , ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR
                                                                                      , ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
                                                                                      , ..
                                                                                      )
                                                        , GeometryTypeKHR( GEOMETRY_TYPE_TRIANGLES_KHR
                                                                         , GEOMETRY_TYPE_AABBS_KHR
                                                                         , GEOMETRY_TYPE_INSTANCES_KHR
                                                                         , ..
                                                                         )
                                                        , AccelerationStructureBuildTypeKHR( ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR
                                                                                           , ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR
                                                                                           , ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR
                                                                                           , ..
                                                                                           )
                                                        , AccelerationStructureCompatibilityKHR( ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR
                                                                                               , ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR
                                                                                               , ..
                                                                                               )
                                                        , KHR_ACCELERATION_STRUCTURE_SPEC_VERSION
                                                        , pattern KHR_ACCELERATION_STRUCTURE_SPEC_VERSION
                                                        , KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME
                                                        , pattern KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME
                                                        , AccelerationStructureKHR(..)
                                                        , DeferredOperationKHR(..)
                                                        , DebugReportObjectTypeEXT(..)
                                                        ) where

import Vulkan.CStruct.Utils (FixedArray)
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.Bits ((.&.))
import Data.Bits ((.|.))
import Data.Bits (shiftL)
import Data.Bits (shiftR)
import Foreign.Marshal.Alloc (allocaBytesAligned)
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 (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
import qualified Data.ByteString (length)
import Data.ByteString (packCStringLen)
import Data.ByteString.Unsafe (unsafeUseAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.Trans.Cont (runContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Foreign.C.Types (CSize(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(CFloat))
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(CSize))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Word (Word8)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.NamedType ((:::))
import Vulkan.Extensions.Handles (AccelerationStructureKHR)
import Vulkan.Extensions.Handles (AccelerationStructureKHR(..))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Extensions.Handles (DeferredOperationKHR)
import Vulkan.Extensions.Handles (DeferredOperationKHR(..))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkBuildAccelerationStructuresKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBuildAccelerationStructuresIndirectKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBuildAccelerationStructuresKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyAccelerationStructureToMemoryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyMemoryToAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdWriteAccelerationStructuresPropertiesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyAccelerationStructureToMemoryKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCopyMemoryToAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCreateAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyAccelerationStructureKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureBuildSizesKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetAccelerationStructureDeviceAddressKHR))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceAccelerationStructureCompatibilityKHR))
import Vulkan.Dynamic (DeviceCmds(pVkWriteAccelerationStructuresPropertiesKHR))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.IndexType (IndexType)
import Vulkan.Core10.Handles (QueryPool)
import Vulkan.Core10.Handles (QueryPool(..))
import Vulkan.Core10.Enums.QueryType (QueryType)
import Vulkan.Core10.Enums.QueryType (QueryType(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.APIConstants (pattern UUID_SIZE)
import Vulkan.Extensions.Handles (AccelerationStructureKHR(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
import Vulkan.Extensions.Handles (DeferredOperationKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyAccelerationStructureKHR
  :: FunPtr (Ptr Device_T -> AccelerationStructureKHR -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> AccelerationStructureKHR -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyAccelerationStructureKHR - Destroy an acceleration structure
-- object
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02442#
--     All submitted commands that refer to @accelerationStructure@ /must/
--     have completed execution
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02443#
--     If 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @accelerationStructure@ was created, a compatible set
--     of callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02444#
--     If no 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @accelerationStructure@ was created, @pAllocator@
--     /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-parameter#
--     If @accelerationStructure@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @accelerationStructure@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyAccelerationStructureKHR-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
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device'
destroyAccelerationStructureKHR :: forall io
                                 . (MonadIO io)
                                => -- | @device@ is the logical device that destroys the buffer.
                                   Device
                                -> -- | @accelerationStructure@ is the acceleration structure to destroy.
                                   AccelerationStructureKHR
                                -> -- | @pAllocator@ controls host memory allocation as described in the
                                   -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                   -- chapter.
                                   ("allocator" ::: Maybe AllocationCallbacks)
                                -> io ()
destroyAccelerationStructureKHR :: Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureKHR device :: Device
device accelerationStructure :: AccelerationStructureKHR
accelerationStructure allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyAccelerationStructureKHRPtr :: FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureKHR
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureKHRPtr FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureKHR
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkDestroyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyAccelerationStructureKHR' :: Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureKHR' = FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyAccelerationStructureKHR FunPtr
  (Ptr Device_T
   -> AccelerationStructureKHR
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyAccelerationStructureKHRPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
 -> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkDestroyAccelerationStructureKHR" (Ptr Device_T
-> AccelerationStructureKHR
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (AccelerationStructureKHR
accelerationStructure) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCopyAccelerationStructureKHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyAccelerationStructureInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyAccelerationStructureInfoKHR -> IO ()

-- | vkCmdCopyAccelerationStructureKHR - Copy an acceleration structure
--
-- = Description
--
-- Accesses to @pInfo@->@src@ and @pInfo@->@dst@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-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-vkCmdCopyAccelerationStructureKHR-buffer-03737# The @buffer@
--     used to create @pInfo@->@src@ /must/ be bound to device memory
--
-- -   #VUID-vkCmdCopyAccelerationStructureKHR-buffer-03738# The @buffer@
--     used to create @pInfo@->@dst@ /must/ be bound to device memory
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyAccelerationStructureKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyAccelerationStructureKHR-pInfo-parameter# @pInfo@
--     /must/ be a valid pointer to a valid
--     'CopyAccelerationStructureInfoKHR' structure
--
-- -   #VUID-vkCmdCopyAccelerationStructureKHR-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-vkCmdCopyAccelerationStructureKHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdCopyAccelerationStructureKHR-renderpass# This command
--     /must/ only be called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'CopyAccelerationStructureInfoKHR'
cmdCopyAccelerationStructureKHR :: forall io
                                 . (MonadIO io)
                                => -- | @commandBuffer@ is the command buffer into which the command will be
                                   -- recorded.
                                   CommandBuffer
                                -> -- | @pInfo@ is a pointer to a 'CopyAccelerationStructureInfoKHR' structure
                                   -- defining the copy operation.
                                   CopyAccelerationStructureInfoKHR
                                -> io ()
cmdCopyAccelerationStructureKHR :: CommandBuffer -> CopyAccelerationStructureInfoKHR -> io ()
cmdCopyAccelerationStructureKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyAccelerationStructureInfoKHR
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyAccelerationStructureKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
vkCmdCopyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
pVkCmdCopyAccelerationStructureKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
vkCmdCopyAccelerationStructureKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyAccelerationStructureKHR' :: Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ()
vkCmdCopyAccelerationStructureKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> IO ()
mkVkCmdCopyAccelerationStructureKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
vkCmdCopyAccelerationStructureKHRPtr
  "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
 -> IO ())
-> ContT () IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
  -> IO ())
 -> ContT () IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR))
-> ((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
    -> IO ())
-> ContT () IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureInfoKHR
info)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdCopyAccelerationStructureKHR" (Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO ()
vkCmdCopyAccelerationStructureKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
pInfo)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCopyAccelerationStructureKHR
  :: FunPtr (Ptr Device_T -> DeferredOperationKHR -> Ptr CopyAccelerationStructureInfoKHR -> IO Result) -> Ptr Device_T -> DeferredOperationKHR -> Ptr CopyAccelerationStructureInfoKHR -> IO Result

-- | vkCopyAccelerationStructureKHR - Copy an acceleration structure on the
-- host
--
-- = Description
--
-- This command fulfills the same task as 'cmdCopyAccelerationStructureKHR'
-- but is executed by the host.
--
-- == Valid Usage
--
-- -   #VUID-vkCopyAccelerationStructureKHR-deferredOperation-03677# If
--     @deferredOperation@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     it /must/ be a valid
--     'Vulkan.Extensions.Handles.DeferredOperationKHR' object
--
-- -   #VUID-vkCopyAccelerationStructureKHR-deferredOperation-03678# Any
--     previous deferred operation that was associated with
--     @deferredOperation@ /must/ be complete
--
-- -   #VUID-vkCopyAccelerationStructureKHR-buffer-03727# The @buffer@ used
--     to create @pInfo@->@src@ /must/ be bound to host-visible device
--     memory
--
-- -   #VUID-vkCopyAccelerationStructureKHR-buffer-03728# The @buffer@ used
--     to create @pInfo@->@dst@ /must/ be bound to host-visible device
--     memory
--
-- -   #VUID-vkCopyAccelerationStructureKHR-accelerationStructureHostCommands-03582#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureHostCommands ::accelerationStructureHostCommands>
--     feature /must/ be enabled
--
-- -   #VUID-vkCopyAccelerationStructureKHR-buffer-03780# The @buffer@ used
--     to create @pInfo@->@src@ /must/ be bound to memory that was not
--     allocated with multiple instances
--
-- -   #VUID-vkCopyAccelerationStructureKHR-buffer-03781# The @buffer@ used
--     to create @pInfo@->@dst@ /must/ be bound to memory that was not
--     allocated with multiple instances
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCopyAccelerationStructureKHR-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCopyAccelerationStructureKHR-deferredOperation-parameter# If
--     @deferredOperation@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @deferredOperation@ /must/ be a valid
--     'Vulkan.Extensions.Handles.DeferredOperationKHR' handle
--
-- -   #VUID-vkCopyAccelerationStructureKHR-pInfo-parameter# @pInfo@ /must/
--     be a valid pointer to a valid 'CopyAccelerationStructureInfoKHR'
--     structure
--
-- -   #VUID-vkCopyAccelerationStructureKHR-deferredOperation-parent# If
--     @deferredOperation@ 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.Core10.Enums.Result.OPERATION_DEFERRED_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.OPERATION_NOT_DEFERRED_KHR'
--
-- [<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
--
-- 'CopyAccelerationStructureInfoKHR',
-- 'Vulkan.Extensions.Handles.DeferredOperationKHR',
-- 'Vulkan.Core10.Handles.Device'
copyAccelerationStructureKHR :: forall io
                              . (MonadIO io)
                             => -- | @device@ is the device which owns the acceleration structures.
                                Device
                             -> -- | @deferredOperation@ is an optional
                                -- 'Vulkan.Extensions.Handles.DeferredOperationKHR' to
                                -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#deferred-host-operations-requesting request deferral>
                                -- for this command.
                                DeferredOperationKHR
                             -> -- | @pInfo@ is a pointer to a 'CopyAccelerationStructureInfoKHR' structure
                                -- defining the copy operation.
                                CopyAccelerationStructureInfoKHR
                             -> io (Result)
copyAccelerationStructureKHR :: Device
-> DeferredOperationKHR
-> CopyAccelerationStructureInfoKHR
-> io Result
copyAccelerationStructureKHR device :: Device
device deferredOperation :: DeferredOperationKHR
deferredOperation info :: CopyAccelerationStructureInfoKHR
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
  let vkCopyAccelerationStructureKHRPtr :: FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
      -> IO Result)
pVkCopyAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureKHRPtr FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCopyAccelerationStructureKHR' :: Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> IO Result
vkCopyAccelerationStructureKHR' = FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
-> Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> IO Result
mkVkCopyAccelerationStructureKHR FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureKHRPtr
  "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO Result)
 -> IO Result)
-> ContT
     Result IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO Result)
  -> IO Result)
 -> ContT
      Result IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR))
-> ((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
     -> IO Result)
    -> IO Result)
-> ContT
     Result IO ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
    -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureInfoKHR
info)
  Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCopyAccelerationStructureKHR" (Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> IO Result
vkCopyAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DeferredOperationKHR
deferredOperation) "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
pInfo)
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCopyAccelerationStructureToMemoryKHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyAccelerationStructureToMemoryInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyAccelerationStructureToMemoryInfoKHR -> IO ()

-- | vkCmdCopyAccelerationStructureToMemoryKHR - Copy an acceleration
-- structure to device memory
--
-- = Description
--
-- Accesses to @pInfo@->@src@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'.
-- Accesses to the buffer indicated by @pInfo@->@dst.deviceAddress@ /must/
-- be synchronized with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- pipeline stage and an access type of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_TRANSFER_WRITE_BIT'.
--
-- This command produces the same results as
-- 'copyAccelerationStructureToMemoryKHR', but writes its result to a
-- device address, and is executed on the device rather than the host. The
-- output /may/ not necessarily be bit-for-bit identical, but it can be
-- equally used by either 'cmdCopyMemoryToAccelerationStructureKHR' or
-- 'copyMemoryToAccelerationStructureKHR'.
--
-- The defined header structure for the serialized data consists of:
--
-- -   'Vulkan.Core10.APIConstants.UUID_SIZE' bytes of data matching
--     'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.PhysicalDeviceIDProperties'::@driverUUID@
--
-- -   'Vulkan.Core10.APIConstants.UUID_SIZE' bytes of data identifying the
--     compatibility for comparison using
--     'getDeviceAccelerationStructureCompatibilityKHR'
--
-- -   A 64-bit integer of the total size matching the value queried using
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR'
--
-- -   A 64-bit integer of the deserialized size to be passed in to
--     'AccelerationStructureCreateInfoKHR'::@size@
--
-- -   A 64-bit integer of the count of the number of acceleration
--     structure handles following. This will be zero for a bottom-level
--     acceleration structure.
--
-- The corresponding handles matching the values returned by
-- 'getAccelerationStructureDeviceAddressKHR' or
-- 'Vulkan.Extensions.VK_NV_ray_tracing.getAccelerationStructureHandleNV'
-- are tightly packed in the buffer following the count. The application is
-- expected to store a mapping between those handles and the original
-- application-generated bottom-level acceleration structures to provide
-- when deserializing. The serialized data is written to the buffer (or
-- read from the buffer) according to the host endianness.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03739#
--     @pInfo@->@dst.deviceAddress@ /must/ be a valid device address for a
--     buffer bound to device memory.
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03740#
--     @pInfo@->@dst.deviceAddress@ /must/ be aligned to @256@ bytes
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03741# If the
--     buffer pointed to by @pInfo@->@dst.deviceAddress@ is non-sparse then
--     it /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-None-03559# The
--     @buffer@ used to create @pInfo@->@src@ /must/ be bound to device
--     memory
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'CopyAccelerationStructureToMemoryInfoKHR' structure
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-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-vkCmdCopyAccelerationStructureToMemoryKHR-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdCopyAccelerationStructureToMemoryKHR-renderpass# This
--     command /must/ only be called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'CopyAccelerationStructureToMemoryInfoKHR'
cmdCopyAccelerationStructureToMemoryKHR :: forall io
                                         . (MonadIO io)
                                        => -- | @commandBuffer@ is the command buffer into which the command will be
                                           -- recorded.
                                           CommandBuffer
                                        -> -- | @pInfo@ is an a pointer to a 'CopyAccelerationStructureToMemoryInfoKHR'
                                           -- structure defining the copy operation.
                                           CopyAccelerationStructureToMemoryInfoKHR
                                        -> io ()
cmdCopyAccelerationStructureToMemoryKHR :: CommandBuffer -> CopyAccelerationStructureToMemoryInfoKHR -> io ()
cmdCopyAccelerationStructureToMemoryKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyAccelerationStructureToMemoryInfoKHR
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyAccelerationStructureToMemoryKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
      -> IO ())
pVkCmdCopyAccelerationStructureToMemoryKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyAccelerationStructureToMemoryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyAccelerationStructureToMemoryKHR' :: Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO ()
vkCmdCopyAccelerationStructureToMemoryKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO ()
mkVkCmdCopyAccelerationStructureToMemoryKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
vkCmdCopyAccelerationStructureToMemoryKHRPtr
  "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR))
-> ((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureToMemoryInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureToMemoryInfoKHR
info)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdCopyAccelerationStructureToMemoryKHR" (Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO ()
vkCmdCopyAccelerationStructureToMemoryKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
pInfo)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCopyAccelerationStructureToMemoryKHR
  :: FunPtr (Ptr Device_T -> DeferredOperationKHR -> Ptr CopyAccelerationStructureToMemoryInfoKHR -> IO Result) -> Ptr Device_T -> DeferredOperationKHR -> Ptr CopyAccelerationStructureToMemoryInfoKHR -> IO Result

-- | vkCopyAccelerationStructureToMemoryKHR - Serialize an acceleration
-- structure on the host
--
-- = Description
--
-- This command fulfills the same task as
-- 'cmdCopyAccelerationStructureToMemoryKHR' but is executed by the host.
--
-- This command produces the same results as
-- 'cmdCopyAccelerationStructureToMemoryKHR', but writes its result
-- directly to a host pointer, and is executed on the host rather than the
-- device. The output /may/ not necessarily be bit-for-bit identical, but
-- it can be equally used by either
-- 'cmdCopyMemoryToAccelerationStructureKHR' or
-- 'copyMemoryToAccelerationStructureKHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-03677#
--     If @deferredOperation@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', it /must/ be a valid
--     'Vulkan.Extensions.Handles.DeferredOperationKHR' object
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-03678#
--     Any previous deferred operation that was associated with
--     @deferredOperation@ /must/ be complete
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03731# The
--     @buffer@ used to create @pInfo@->@src@ /must/ be bound to
--     host-visible device memory
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03732#
--     @pInfo@->@dst.hostAddress@ /must/ be a valid host pointer
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03751#
--     @pInfo@->@dst.hostAddress@ /must/ be aligned to 16 bytes
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-accelerationStructureHostCommands-03584#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureHostCommands ::accelerationStructureHostCommands>
--     feature /must/ be enabled
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03783# The
--     @buffer@ used to create @pInfo@->@src@ /must/ be bound to memory
--     that was not allocated with multiple instances
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-parameter#
--     If @deferredOperation@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @deferredOperation@ /must/
--     be a valid 'Vulkan.Extensions.Handles.DeferredOperationKHR' handle
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'CopyAccelerationStructureToMemoryInfoKHR' structure
--
-- -   #VUID-vkCopyAccelerationStructureToMemoryKHR-deferredOperation-parent#
--     If @deferredOperation@ 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.Core10.Enums.Result.OPERATION_DEFERRED_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.OPERATION_NOT_DEFERRED_KHR'
--
-- [<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
--
-- 'CopyAccelerationStructureToMemoryInfoKHR',
-- 'Vulkan.Extensions.Handles.DeferredOperationKHR',
-- 'Vulkan.Core10.Handles.Device'
copyAccelerationStructureToMemoryKHR :: forall io
                                      . (MonadIO io)
                                     => -- | @device@ is the device which owns @pInfo@->@src@.
                                        Device
                                     -> -- | @deferredOperation@ is an optional
                                        -- 'Vulkan.Extensions.Handles.DeferredOperationKHR' to
                                        -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#deferred-host-operations-requesting request deferral>
                                        -- for this command.
                                        DeferredOperationKHR
                                     -> -- | @pInfo@ is a pointer to a 'CopyAccelerationStructureToMemoryInfoKHR'
                                        -- structure defining the copy operation.
                                        CopyAccelerationStructureToMemoryInfoKHR
                                     -> io (Result)
copyAccelerationStructureToMemoryKHR :: Device
-> DeferredOperationKHR
-> CopyAccelerationStructureToMemoryInfoKHR
-> io Result
copyAccelerationStructureToMemoryKHR device :: Device
device deferredOperation :: DeferredOperationKHR
deferredOperation info :: CopyAccelerationStructureToMemoryInfoKHR
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
  let vkCopyAccelerationStructureToMemoryKHRPtr :: FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
      -> IO Result)
pVkCopyAccelerationStructureToMemoryKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyAccelerationStructureToMemoryKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCopyAccelerationStructureToMemoryKHR' :: Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO Result
vkCopyAccelerationStructureToMemoryKHR' = FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
-> Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO Result
mkVkCopyAccelerationStructureToMemoryKHR FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
vkCopyAccelerationStructureToMemoryKHRPtr
  "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
  -> IO Result)
 -> IO Result)
-> ContT
     Result
     IO
     ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
   -> IO Result)
  -> IO Result)
 -> ContT
      Result
      IO
      ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR))
-> ((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
     -> IO Result)
    -> IO Result)
-> ContT
     Result
     IO
     ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyAccelerationStructureToMemoryInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
    -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyAccelerationStructureToMemoryInfoKHR
info)
  Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCopyAccelerationStructureToMemoryKHR" (Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO Result
vkCopyAccelerationStructureToMemoryKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DeferredOperationKHR
deferredOperation) "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
pInfo)
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCopyMemoryToAccelerationStructureKHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyMemoryToAccelerationStructureInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyMemoryToAccelerationStructureInfoKHR -> IO ()

-- | vkCmdCopyMemoryToAccelerationStructureKHR - Copy device memory to an
-- acceleration structure
--
-- = Description
--
-- Accesses to @pInfo@->@dst@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR'.
-- Accesses to the buffer indicated by @pInfo@->@src.deviceAddress@ /must/
-- be synchronized with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- pipeline stage and an access type of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_TRANSFER_READ_BIT'.
--
-- This command can accept acceleration structures produced by either
-- 'cmdCopyAccelerationStructureToMemoryKHR' or
-- 'copyAccelerationStructureToMemoryKHR'.
--
-- The structure provided as input to deserialize is as described in
-- 'cmdCopyAccelerationStructureToMemoryKHR', with any acceleration
-- structure handles filled in with the newly-queried handles to bottom
-- level acceleration structures created before deserialization. These do
-- not need to be built at deserialize time, but /must/ be created.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03742#
--     @pInfo@->@src.deviceAddress@ /must/ be a valid device address for a
--     buffer bound to device memory.
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03743#
--     @pInfo@->@src.deviceAddress@ /must/ be aligned to @256@ bytes
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03744# If the
--     buffer pointed to by @pInfo@->@src.deviceAddress@ is non-sparse then
--     it /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-buffer-03745# The
--     @buffer@ used to create @pInfo@->@dst@ /must/ be bound to device
--     memory
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'CopyMemoryToAccelerationStructureInfoKHR' structure
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-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-vkCmdCopyMemoryToAccelerationStructureKHR-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdCopyMemoryToAccelerationStructureKHR-renderpass# This
--     command /must/ only be called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'CopyMemoryToAccelerationStructureInfoKHR'
cmdCopyMemoryToAccelerationStructureKHR :: forall io
                                         . (MonadIO io)
                                        => -- | @commandBuffer@ is the command buffer into which the command will be
                                           -- recorded.
                                           CommandBuffer
                                        -> -- | @pInfo@ is a pointer to a 'CopyMemoryToAccelerationStructureInfoKHR'
                                           -- structure defining the copy operation.
                                           CopyMemoryToAccelerationStructureInfoKHR
                                        -> io ()
cmdCopyMemoryToAccelerationStructureKHR :: CommandBuffer -> CopyMemoryToAccelerationStructureInfoKHR -> io ()
cmdCopyMemoryToAccelerationStructureKHR commandBuffer :: CommandBuffer
commandBuffer info :: CopyMemoryToAccelerationStructureInfoKHR
info = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyMemoryToAccelerationStructureKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
      -> IO ())
pVkCmdCopyMemoryToAccelerationStructureKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdCopyMemoryToAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyMemoryToAccelerationStructureKHR' :: Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO ()
vkCmdCopyMemoryToAccelerationStructureKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO ()
mkVkCmdCopyMemoryToAccelerationStructureKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
vkCmdCopyMemoryToAccelerationStructureKHRPtr
  "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR))
-> ((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyMemoryToAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyMemoryToAccelerationStructureInfoKHR
info)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdCopyMemoryToAccelerationStructureKHR" (Ptr CommandBuffer_T
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO ()
vkCmdCopyMemoryToAccelerationStructureKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
pInfo)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCopyMemoryToAccelerationStructureKHR
  :: FunPtr (Ptr Device_T -> DeferredOperationKHR -> Ptr CopyMemoryToAccelerationStructureInfoKHR -> IO Result) -> Ptr Device_T -> DeferredOperationKHR -> Ptr CopyMemoryToAccelerationStructureInfoKHR -> IO Result

-- | vkCopyMemoryToAccelerationStructureKHR - Deserialize an acceleration
-- structure on the host
--
-- = Description
--
-- This command fulfills the same task as
-- 'cmdCopyMemoryToAccelerationStructureKHR' but is executed by the host.
--
-- This command can accept acceleration structures produced by either
-- 'cmdCopyAccelerationStructureToMemoryKHR' or
-- 'copyAccelerationStructureToMemoryKHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-deferredOperation-03677#
--     If @deferredOperation@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', it /must/ be a valid
--     'Vulkan.Extensions.Handles.DeferredOperationKHR' object
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-deferredOperation-03678#
--     Any previous deferred operation that was associated with
--     @deferredOperation@ /must/ be complete
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03729#
--     @pInfo@->@src.hostAddress@ /must/ be a valid host pointer
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03750#
--     @pInfo@->@src.hostAddress@ /must/ be aligned to 16 bytes
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-buffer-03730# The
--     @buffer@ used to create @pInfo@->@dst@ /must/ be bound to
--     host-visible device memory
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-accelerationStructureHostCommands-03583#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureHostCommands ::accelerationStructureHostCommands>
--     feature /must/ be enabled
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-buffer-03782# The
--     @buffer@ used to create @pInfo@->@dst@ /must/ be bound to memory
--     that was not allocated with multiple instances
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-deferredOperation-parameter#
--     If @deferredOperation@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @deferredOperation@ /must/
--     be a valid 'Vulkan.Extensions.Handles.DeferredOperationKHR' handle
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'CopyMemoryToAccelerationStructureInfoKHR' structure
--
-- -   #VUID-vkCopyMemoryToAccelerationStructureKHR-deferredOperation-parent#
--     If @deferredOperation@ 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.Core10.Enums.Result.OPERATION_DEFERRED_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.OPERATION_NOT_DEFERRED_KHR'
--
-- [<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
--
-- 'CopyMemoryToAccelerationStructureInfoKHR',
-- 'Vulkan.Extensions.Handles.DeferredOperationKHR',
-- 'Vulkan.Core10.Handles.Device'
copyMemoryToAccelerationStructureKHR :: forall io
                                      . (MonadIO io)
                                     => -- | @device@ is the device which owns @pInfo->dst@.
                                        Device
                                     -> -- | @deferredOperation@ is an optional
                                        -- 'Vulkan.Extensions.Handles.DeferredOperationKHR' to
                                        -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#deferred-host-operations-requesting request deferral>
                                        -- for this command.
                                        DeferredOperationKHR
                                     -> -- | @pInfo@ is a pointer to a 'CopyMemoryToAccelerationStructureInfoKHR'
                                        -- structure defining the copy operation.
                                        CopyMemoryToAccelerationStructureInfoKHR
                                     -> io (Result)
copyMemoryToAccelerationStructureKHR :: Device
-> DeferredOperationKHR
-> CopyMemoryToAccelerationStructureInfoKHR
-> io Result
copyMemoryToAccelerationStructureKHR device :: Device
device deferredOperation :: DeferredOperationKHR
deferredOperation info :: CopyMemoryToAccelerationStructureInfoKHR
info = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
  let vkCopyMemoryToAccelerationStructureKHRPtr :: FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
      -> IO Result)
pVkCopyMemoryToAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCopyMemoryToAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCopyMemoryToAccelerationStructureKHR' :: Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO Result
vkCopyMemoryToAccelerationStructureKHR' = FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
-> Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO Result
mkVkCopyMemoryToAccelerationStructureKHR FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
vkCopyMemoryToAccelerationStructureKHRPtr
  "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
pInfo <- ((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
  -> IO Result)
 -> IO Result)
-> ContT
     Result
     IO
     ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
   -> IO Result)
  -> IO Result)
 -> ContT
      Result
      IO
      ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR))
-> ((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
     -> IO Result)
    -> IO Result)
-> ContT
     Result
     IO
     ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyMemoryToAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
    -> IO Result)
-> IO Result
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyMemoryToAccelerationStructureInfoKHR
info)
  Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCopyMemoryToAccelerationStructureKHR" (Ptr Device_T
-> DeferredOperationKHR
-> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO Result
vkCopyMemoryToAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DeferredOperationKHR
deferredOperation) "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
pInfo)
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)


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

-- | vkCmdWriteAccelerationStructuresPropertiesKHR - Write acceleration
-- structure result parameters to query results.
--
-- = Description
--
-- Accesses to any of the acceleration structures listed in
-- @pAccelerationStructures@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryPool-02493#
--     @queryPool@ /must/ have been created with a @queryType@ matching
--     @queryType@
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryPool-02494#
--     The queries identified by @queryPool@ and @firstQuery@ /must/ be
--     /unavailable/
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-buffer-03736#
--     The @buffer@ used to create each acceleration structure in
--     @pAccelerationStructures@ /must/ be bound to device memory
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructures-03431#
--     All acceleration structures in @pAccelerationStructures@ /must/ have
--     been built with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR' if
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR'
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryType-03432#
--     @queryType@ /must/ be
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR'
--     or
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-pAccelerationStructures-parameter#
--     @pAccelerationStructures@ /must/ be a valid pointer to an array of
--     @accelerationStructureCount@ valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handles
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryType-parameter#
--     @queryType@ /must/ be a valid
--     'Vulkan.Core10.Enums.QueryType.QueryType' value
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryPool-parameter#
--     @queryPool@ /must/ be a valid 'Vulkan.Core10.Handles.QueryPool'
--     handle
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-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-vkCmdWriteAccelerationStructuresPropertiesKHR-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-renderpass# This
--     command /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength#
--     @accelerationStructureCount@ /must/ be greater than @0@
--
-- -   #VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.Handles.QueryPool',
-- 'Vulkan.Core10.Enums.QueryType.QueryType'
cmdWriteAccelerationStructuresPropertiesKHR :: 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 AccelerationStructureKHR)
                                            -> -- | @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 ()
cmdWriteAccelerationStructuresPropertiesKHR :: CommandBuffer
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("firstQuery" ::: Word32)
-> io ()
cmdWriteAccelerationStructuresPropertiesKHR commandBuffer :: CommandBuffer
commandBuffer accelerationStructures :: "accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures queryType :: QueryType
queryType queryPool :: QueryPool
queryPool firstQuery :: "firstQuery" ::: Word32
firstQuery = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdWriteAccelerationStructuresPropertiesKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> QueryType
      -> QueryPool
      -> ("firstQuery" ::: Word32)
      -> IO ())
pVkCmdWriteAccelerationStructuresPropertiesKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> QueryType
      -> QueryPool
      -> ("firstQuery" ::: Word32)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdWriteAccelerationStructuresPropertiesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdWriteAccelerationStructuresPropertiesKHR' :: Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("firstQuery" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("firstQuery" ::: Word32)
-> IO ()
mkVkCmdWriteAccelerationStructuresPropertiesKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> QueryPool
   -> ("firstQuery" ::: Word32)
   -> IO ())
vkCmdWriteAccelerationStructuresPropertiesKHRPtr
  "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdWriteAccelerationStructuresPropertiesKHR" (Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> QueryPool
-> ("firstQuery" ::: Word32)
-> IO ()
vkCmdWriteAccelerationStructuresPropertiesKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("accelerationStructures" ::: Vector AccelerationStructureKHR)
 -> Int)
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) :: Word32)) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures) (QueryType
queryType) (QueryPool
queryPool) ("firstQuery" ::: Word32
firstQuery))
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkWriteAccelerationStructuresPropertiesKHR
  :: FunPtr (Ptr Device_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> CSize -> Ptr () -> CSize -> IO Result) -> Ptr Device_T -> Word32 -> Ptr AccelerationStructureKHR -> QueryType -> CSize -> Ptr () -> CSize -> IO Result

-- | vkWriteAccelerationStructuresPropertiesKHR - Query acceleration
-- structure meta-data on the host
--
-- = Description
--
-- This command fulfills the same task as
-- 'cmdWriteAccelerationStructuresPropertiesKHR' but is executed by the
-- host.
--
-- == Valid Usage
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructures-03431#
--     All acceleration structures in @pAccelerationStructures@ /must/ have
--     been built with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR' if
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03432#
--     @queryType@ /must/ be
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR'
--     or
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03448# If
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR',
--     then @stride@ /must/ be a multiple of the size of
--     'Vulkan.Core10.FundamentalTypes.DeviceSize'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03449# If
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR',
--     then @data@ /must/ point to a
--     'Vulkan.Core10.FundamentalTypes.DeviceSize'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03450# If
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR',
--     then @stride@ /must/ be a multiple of the size of
--     'Vulkan.Core10.FundamentalTypes.DeviceSize'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03451# If
--     @queryType@ is
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR',
--     then @data@ /must/ point to a
--     'Vulkan.Core10.FundamentalTypes.DeviceSize'
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-dataSize-03452#
--     @dataSize@ /must/ be greater than or equal to
--     @accelerationStructureCount@*@stride@
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-buffer-03733# The
--     @buffer@ used to create each acceleration structure in
--     @pAccelerationStructures@ /must/ be bound to host-visible device
--     memory
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureHostCommands-03585#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureHostCommands ::accelerationStructureHostCommands>
--     feature /must/ be enabled
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-buffer-03784# The
--     @buffer@ used to create each acceleration structure in
--     @pAccelerationStructures@ /must/ be bound to memory that was not
--     allocated with multiple instances
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-pAccelerationStructures-parameter#
--     @pAccelerationStructures@ /must/ be a valid pointer to an array of
--     @accelerationStructureCount@ valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handles
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-parameter#
--     @queryType@ /must/ be a valid
--     'Vulkan.Core10.Enums.QueryType.QueryType' value
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-pData-parameter#
--     @pData@ /must/ be a valid pointer to an array of @dataSize@ bytes
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength#
--     @accelerationStructureCount@ /must/ be greater than @0@
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-dataSize-arraylength#
--     @dataSize@ /must/ be greater than @0@
--
-- -   #VUID-vkWriteAccelerationStructuresPropertiesKHR-pAccelerationStructures-parent#
--     Each element of @pAccelerationStructures@ /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'
--
-- [<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
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Core10.Enums.QueryType.QueryType'
writeAccelerationStructuresPropertiesKHR :: forall io
                                          . (MonadIO io)
                                         => -- | @device@ is the device which owns the acceleration structures in
                                            -- @pAccelerationStructures@.
                                            Device
                                         -> -- | @pAccelerationStructures@ points to an array of existing previously
                                            -- built acceleration structures.
                                            ("accelerationStructures" ::: Vector AccelerationStructureKHR)
                                         -> -- | @queryType@ is a 'Vulkan.Core10.Enums.QueryType.QueryType' value
                                            -- specifying the property to be queried.
                                            QueryType
                                         -> -- | @dataSize@ is the size in bytes of the buffer pointed to by @pData@.
                                            ("dataSize" ::: Word64)
                                         -> -- | @pData@ is a pointer to a user-allocated buffer where the results will
                                            -- be written.
                                            ("data" ::: Ptr ())
                                         -> -- | @stride@ is the stride in bytes between results for individual queries
                                            -- within @pData@.
                                            ("stride" ::: Word64)
                                         -> io ()
writeAccelerationStructuresPropertiesKHR :: Device
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: Word64)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: Word64)
-> io ()
writeAccelerationStructuresPropertiesKHR device :: Device
device accelerationStructures :: "accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures queryType :: QueryType
queryType dataSize :: "dataSize" ::: Word64
dataSize data' :: "data" ::: Ptr ()
data' stride :: "dataSize" ::: Word64
stride = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkWriteAccelerationStructuresPropertiesKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("firstQuery" ::: Word32)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> QueryType
      -> ("dataSize" ::: CSize)
      -> ("data" ::: Ptr ())
      -> ("dataSize" ::: CSize)
      -> IO Result)
pVkWriteAccelerationStructuresPropertiesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("firstQuery" ::: Word32)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> QueryType
      -> ("dataSize" ::: CSize)
      -> ("data" ::: Ptr ())
      -> ("dataSize" ::: CSize)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkWriteAccelerationStructuresPropertiesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkWriteAccelerationStructuresPropertiesKHR' :: Ptr Device_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
vkWriteAccelerationStructuresPropertiesKHR' = FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
-> Ptr Device_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
mkVkWriteAccelerationStructuresPropertiesKHR FunPtr
  (Ptr Device_T
   -> ("firstQuery" ::: Word32)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> QueryType
   -> ("dataSize" ::: CSize)
   -> ("data" ::: Ptr ())
   -> ("dataSize" ::: CSize)
   -> IO Result)
vkWriteAccelerationStructuresPropertiesKHRPtr
  "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)
  Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkWriteAccelerationStructuresPropertiesKHR" (Ptr Device_T
-> ("firstQuery" ::: Word32)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> QueryType
-> ("dataSize" ::: CSize)
-> ("data" ::: Ptr ())
-> ("dataSize" ::: CSize)
-> IO Result
vkWriteAccelerationStructuresPropertiesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("accelerationStructures" ::: Vector AccelerationStructureKHR)
 -> Int)
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) :: Word32)) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures) (QueryType
queryType) (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
dataSize)) ("data" ::: Ptr ()
data') (("dataSize" ::: Word64) -> "dataSize" ::: CSize
CSize ("dataSize" ::: Word64
stride)))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceAccelerationStructureCompatibilityKHR
  :: FunPtr (Ptr Device_T -> Ptr AccelerationStructureVersionInfoKHR -> Ptr AccelerationStructureCompatibilityKHR -> IO ()) -> Ptr Device_T -> Ptr AccelerationStructureVersionInfoKHR -> Ptr AccelerationStructureCompatibilityKHR -> IO ()

-- | vkGetDeviceAccelerationStructureCompatibilityKHR - Check if a serialized
-- acceleration structure is compatible with the current device
--
-- == Valid Usage
--
-- -   #VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-rayTracingPipeline-03661#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayTracingPipeline rayTracingPipeline>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayQuery rayQuery>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pVersionInfo-parameter#
--     @pVersionInfo@ /must/ be a valid pointer to a valid
--     'AccelerationStructureVersionInfoKHR' structure
--
-- -   #VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pCompatibility-parameter#
--     @pCompatibility@ /must/ be a valid pointer to a
--     'AccelerationStructureCompatibilityKHR' value
--
-- = See Also
--
-- 'AccelerationStructureCompatibilityKHR',
-- 'AccelerationStructureVersionInfoKHR', 'Vulkan.Core10.Handles.Device'
getDeviceAccelerationStructureCompatibilityKHR :: forall io
                                                . (MonadIO io)
                                               => -- | @device@ is the device to check the version against.
                                                  Device
                                               -> -- | @pVersionInfo@ points to the 'AccelerationStructureVersionInfoKHR'
                                                  -- version information to check against the device.
                                                  AccelerationStructureVersionInfoKHR
                                               -> io (AccelerationStructureCompatibilityKHR)
getDeviceAccelerationStructureCompatibilityKHR :: Device
-> AccelerationStructureVersionInfoKHR
-> io AccelerationStructureCompatibilityKHR
getDeviceAccelerationStructureCompatibilityKHR device :: Device
device versionInfo :: AccelerationStructureVersionInfoKHR
versionInfo = IO AccelerationStructureCompatibilityKHR
-> io AccelerationStructureCompatibilityKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AccelerationStructureCompatibilityKHR
 -> io AccelerationStructureCompatibilityKHR)
-> (ContT
      AccelerationStructureCompatibilityKHR
      IO
      AccelerationStructureCompatibilityKHR
    -> IO AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
-> io AccelerationStructureCompatibilityKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  AccelerationStructureCompatibilityKHR
  IO
  AccelerationStructureCompatibilityKHR
-> IO AccelerationStructureCompatibilityKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   AccelerationStructureCompatibilityKHR
   IO
   AccelerationStructureCompatibilityKHR
 -> io AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
-> io AccelerationStructureCompatibilityKHR
forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceAccelerationStructureCompatibilityKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
vkGetDeviceAccelerationStructureCompatibilityKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
      -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
      -> IO ())
pVkGetDeviceAccelerationStructureCompatibilityKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT AccelerationStructureCompatibilityKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureCompatibilityKHR IO ())
-> IO () -> ContT AccelerationStructureCompatibilityKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
vkGetDeviceAccelerationStructureCompatibilityKHRPtr FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
      -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetDeviceAccelerationStructureCompatibilityKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetDeviceAccelerationStructureCompatibilityKHR' :: Ptr Device_T
-> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO ()
vkGetDeviceAccelerationStructureCompatibilityKHR' = FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
-> Ptr Device_T
-> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO ()
mkVkGetDeviceAccelerationStructureCompatibilityKHR FunPtr
  (Ptr Device_T
   -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO ())
vkGetDeviceAccelerationStructureCompatibilityKHRPtr
  "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
pVersionInfo <- ((("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
  -> IO AccelerationStructureCompatibilityKHR)
 -> IO AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
   -> IO AccelerationStructureCompatibilityKHR)
  -> IO AccelerationStructureCompatibilityKHR)
 -> ContT
      AccelerationStructureCompatibilityKHR
      IO
      ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR))
-> ((("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
     -> IO AccelerationStructureCompatibilityKHR)
    -> IO AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureVersionInfoKHR
-> (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
    -> IO AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureVersionInfoKHR
versionInfo)
  "pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR
pPCompatibility <- ((("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
  -> IO AccelerationStructureCompatibilityKHR)
 -> IO AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
   -> IO AccelerationStructureCompatibilityKHR)
  -> IO AccelerationStructureCompatibilityKHR)
 -> ContT
      AccelerationStructureCompatibilityKHR
      IO
      ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR))
-> ((("pCompatibility"
      ::: Ptr AccelerationStructureCompatibilityKHR)
     -> IO AccelerationStructureCompatibilityKHR)
    -> IO AccelerationStructureCompatibilityKHR)
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
forall a b. (a -> b) -> a -> b
$ IO ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> IO ())
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> IO AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
     ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
forall a. Int -> IO (Ptr a)
callocBytes @AccelerationStructureCompatibilityKHR 4) ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO ()
forall a. Ptr a -> IO ()
free
  IO () -> ContT AccelerationStructureCompatibilityKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureCompatibilityKHR IO ())
-> IO () -> ContT AccelerationStructureCompatibilityKHR IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetDeviceAccelerationStructureCompatibilityKHR" (Ptr Device_T
-> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO ()
vkGetDeviceAccelerationStructureCompatibilityKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
pVersionInfo ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR
pPCompatibility))
  AccelerationStructureCompatibilityKHR
pCompatibility <- IO AccelerationStructureCompatibilityKHR
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO AccelerationStructureCompatibilityKHR
 -> ContT
      AccelerationStructureCompatibilityKHR
      IO
      AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
forall a b. (a -> b) -> a -> b
$ ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureCompatibilityKHR "pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR
pPCompatibility
  AccelerationStructureCompatibilityKHR
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureCompatibilityKHR
 -> ContT
      AccelerationStructureCompatibilityKHR
      IO
      AccelerationStructureCompatibilityKHR)
-> AccelerationStructureCompatibilityKHR
-> ContT
     AccelerationStructureCompatibilityKHR
     IO
     AccelerationStructureCompatibilityKHR
forall a b. (a -> b) -> a -> b
$ (AccelerationStructureCompatibilityKHR
pCompatibility)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateAccelerationStructureKHR
  :: FunPtr (Ptr Device_T -> Ptr AccelerationStructureCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr AccelerationStructureKHR -> IO Result) -> Ptr Device_T -> Ptr AccelerationStructureCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr AccelerationStructureKHR -> IO Result

-- | vkCreateAccelerationStructureKHR - Create a new acceleration structure
-- object
--
-- = Description
--
-- Similar to other objects in Vulkan, the acceleration structure creation
-- merely creates an object with a specific “shape”. The type and quantity
-- of geometry that can be built into an acceleration structure is
-- determined by the parameters of 'AccelerationStructureCreateInfoKHR'.
--
-- Populating the data in the object after allocating and binding memory is
-- done with commands such as 'cmdBuildAccelerationStructuresKHR',
-- 'buildAccelerationStructuresKHR', 'cmdCopyAccelerationStructureKHR', and
-- 'copyAccelerationStructureKHR'.
--
-- The input buffers passed to acceleration structure build commands will
-- be referenced by the implementation for the duration of the command.
-- After the command completes, the acceleration structure /may/ hold a
-- reference to any acceleration structure specified by an active instance
-- contained therein. Apart from this referencing, acceleration structures
-- /must/ be fully self-contained. The application /may/ re-use or free any
-- memory which was used by the command as an input or as scratch without
-- affecting the results of ray traversal.
--
-- == Valid Usage
--
-- -   #VUID-vkCreateAccelerationStructureKHR-accelerationStructure-03611#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructure accelerationStructure>
--     feature /must/ be enabled
--
-- -   #VUID-vkCreateAccelerationStructureKHR-deviceAddress-03488# If
--     'AccelerationStructureCreateInfoKHR'::@deviceAddress@ is not zero,
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureCaptureReplay accelerationStructureCaptureReplay>
--     feature /must/ be enabled
--
-- -   #VUID-vkCreateAccelerationStructureKHR-device-03489# If @device@ was
--     created with multiple physical devices, then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateAccelerationStructureKHR-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateAccelerationStructureKHR-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'AccelerationStructureCreateInfoKHR' structure
--
-- -   #VUID-vkCreateAccelerationStructureKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateAccelerationStructureKHR-pAccelerationStructure-parameter#
--     @pAccelerationStructure@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' 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.Extensions.VK_KHR_buffer_device_address.ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR'
--
-- = See Also
--
-- 'AccelerationStructureCreateInfoKHR',
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device'
createAccelerationStructureKHR :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the logical device that creates the acceleration structure
                                  -- object.
                                  Device
                               -> -- | @pCreateInfo@ is a pointer to a 'AccelerationStructureCreateInfoKHR'
                                  -- structure containing parameters affecting creation of the acceleration
                                  -- structure.
                                  AccelerationStructureCreateInfoKHR
                               -> -- | @pAllocator@ controls host memory allocation as described in the
                                  -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                  -- chapter.
                                  ("allocator" ::: Maybe AllocationCallbacks)
                               -> io (AccelerationStructureKHR)
createAccelerationStructureKHR :: Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
createAccelerationStructureKHR device :: Device
device createInfo :: AccelerationStructureCreateInfoKHR
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO AccelerationStructureKHR -> io AccelerationStructureKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AccelerationStructureKHR -> io AccelerationStructureKHR)
-> (ContT AccelerationStructureKHR IO AccelerationStructureKHR
    -> IO AccelerationStructureKHR)
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> io AccelerationStructureKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> IO AccelerationStructureKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT AccelerationStructureKHR IO AccelerationStructureKHR
 -> io AccelerationStructureKHR)
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
-> io AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateAccelerationStructureKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
vkCreateAccelerationStructureKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> IO Result)
pVkCreateAccelerationStructureKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT AccelerationStructureKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureKHR IO ())
-> IO () -> ContT AccelerationStructureKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
vkCreateAccelerationStructureKHRPtr FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateAccelerationStructureKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateAccelerationStructureKHR' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
vkCreateAccelerationStructureKHR' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
mkVkCreateAccelerationStructureKHR FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO Result)
vkCreateAccelerationStructureKHRPtr
  "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
pCreateInfo <- ((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
  -> IO AccelerationStructureKHR)
 -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
   -> IO AccelerationStructureKHR)
  -> IO AccelerationStructureKHR)
 -> ContT
      AccelerationStructureKHR
      IO
      ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR))
-> ((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
     -> IO AccelerationStructureKHR)
    -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureCreateInfoKHR
-> (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
    -> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureCreateInfoKHR
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
     AccelerationStructureKHR
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
  -> IO AccelerationStructureKHR)
 -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO AccelerationStructureKHR)
  -> IO AccelerationStructureKHR)
 -> ContT
      AccelerationStructureKHR
      IO
      ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
     -> IO AccelerationStructureKHR)
    -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
    -> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
  -> IO AccelerationStructureKHR)
 -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO AccelerationStructureKHR)
  -> IO AccelerationStructureKHR)
 -> ContT
      AccelerationStructureKHR
      IO
      ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
     -> IO AccelerationStructureKHR)
    -> IO AccelerationStructureKHR)
-> ContT
     AccelerationStructureKHR
     IO
     ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO ())
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a. Int -> IO (Ptr a)
callocBytes @AccelerationStructureKHR 8) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT AccelerationStructureKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT AccelerationStructureKHR IO Result)
-> IO Result -> ContT AccelerationStructureKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateAccelerationStructureKHR" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO Result
vkCreateAccelerationStructureKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure))
  IO () -> ContT AccelerationStructureKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT AccelerationStructureKHR IO ())
-> IO () -> ContT AccelerationStructureKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  AccelerationStructureKHR
pAccelerationStructure <- IO AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO AccelerationStructureKHR
 -> ContT AccelerationStructureKHR IO AccelerationStructureKHR)
-> IO AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureKHR "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructure
  AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureKHR
 -> ContT AccelerationStructureKHR IO AccelerationStructureKHR)
-> AccelerationStructureKHR
-> ContT AccelerationStructureKHR IO AccelerationStructureKHR
forall a b. (a -> b) -> a -> b
$ (AccelerationStructureKHR
pAccelerationStructure)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createAccelerationStructureKHR' and 'destroyAccelerationStructureKHR'
--
-- To ensure that 'destroyAccelerationStructureKHR' 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.
--
withAccelerationStructureKHR :: forall io r . MonadIO io => Device -> AccelerationStructureCreateInfoKHR -> Maybe AllocationCallbacks -> (io AccelerationStructureKHR -> (AccelerationStructureKHR -> io ()) -> r) -> r
withAccelerationStructureKHR :: Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io AccelerationStructureKHR
    -> (AccelerationStructureKHR -> io ()) -> r)
-> r
withAccelerationStructureKHR device :: Device
device pCreateInfo :: AccelerationStructureCreateInfoKHR
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io AccelerationStructureKHR
-> (AccelerationStructureKHR -> io ()) -> r
b =
  io AccelerationStructureKHR
-> (AccelerationStructureKHR -> io ()) -> r
b (Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io AccelerationStructureKHR
createAccelerationStructureKHR Device
device AccelerationStructureCreateInfoKHR
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(AccelerationStructureKHR
o0) -> Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> AccelerationStructureKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyAccelerationStructureKHR Device
device AccelerationStructureKHR
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBuildAccelerationStructuresKHR
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr (Ptr AccelerationStructureBuildRangeInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr (Ptr AccelerationStructureBuildRangeInfoKHR) -> IO ()

-- | vkCmdBuildAccelerationStructuresKHR - Build an acceleration structure
--
-- = Description
--
-- The 'cmdBuildAccelerationStructuresKHR' command provides the ability to
-- initiate multiple acceleration structures builds, however there is no
-- ordering or synchronization implied between any of the individual
-- acceleration structure builds.
--
-- Note
--
-- This means that an application /cannot/ build a top-level acceleration
-- structure in the same 'cmdBuildAccelerationStructuresKHR' call as the
-- associated bottom-level or instance acceleration structures are being
-- built. There also /cannot/ be any memory aliasing between any
-- acceleration structure memories or scratch memories being used by any of
-- the builds.
--
-- Accesses to the acceleration structure scratch buffers as identified by
-- the 'AccelerationStructureBuildGeometryInfoKHR'→@scratchData@ buffer
-- device addresses /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-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'.
-- Similarly for accesses to each
-- 'AccelerationStructureBuildGeometryInfoKHR'→@srcAccelerationStructure@
-- and
-- 'AccelerationStructureBuildGeometryInfoKHR'→@dstAccelerationStructure@.
--
-- Accesses to other input buffers as identified by any used values of
-- 'AccelerationStructureGeometryTrianglesDataKHR'→@vertexData@,
-- 'AccelerationStructureGeometryTrianglesDataKHR'→@indexData@,
-- 'AccelerationStructureGeometryTrianglesDataKHR'→@transformData@,
-- 'AccelerationStructureGeometryAabbsDataKHR'→@data@, and
-- 'AccelerationStructureGeometryInstancesDataKHR'→@data@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-access-types access type>
-- of 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_SHADER_READ_BIT'.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03403# The
--     @srcAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03698#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03800#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03699# For each
--     element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03700# For each
--     element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03663# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR',
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive primitives>
--     in its @srcAccelerationStructure@ member /must/ not be made active
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03664# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', active primitives in
--     its @srcAccelerationStructure@ member /must/ not be made
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive>
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-None-03407# The
--     @dstAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03701#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @srcAccelerationStructure@ member of
--     any other element of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', which is accessed by
--     this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03702#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @dstAccelerationStructure@ member of
--     any other element of @pInfos@, which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03703#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @scratchData@ member of any element
--     of @pInfos@ (including the same element), which is accessed by this
--     command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-scratchData-03704# The
--     range of memory backing the @scratchData@ member of any element of
--     @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @scratchData@ member of any other element of
--     @pInfos@, which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-scratchData-03705# The
--     range of memory backing the @scratchData@ member of any element of
--     @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @srcAccelerationStructure@ member of any element
--     of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' (including the same
--     element), which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-dstAccelerationStructure-03706#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing any acceleration structure referenced by
--     the @geometry.instances.data@ member of any element of @pGeometries@
--     or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@,
--     which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03666# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03667# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ have been built before with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR' set in
--     'AccelerationStructureBuildGeometryInfoKHR'::@flags@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03668# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ and @dstAccelerationStructure@ members
--     /must/ either be the same
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR', or not have
--     any
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-memory-aliasing memory aliasing>
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03758# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @geometryCount@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03759# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @flags@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03760# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @type@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03761# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @geometryType@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03762# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @flags@ member /must/
--     have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03763# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.vertexFormat@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03764# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.maxVertex@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03765# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.indexType@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03766# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was NULL when
--     @srcAccelerationStructure@ was last built, then it must be NULL.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03767# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was not NULL when
--     @srcAccelerationStructure@ was last built, then it may not be NULL.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03768# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', and @geometry.triangles.indexType@ is
--     not 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR', then the
--     value of each index referenced index must be the same as the
--     corresponding index value when @srcAccelerationStructure@ was last
--     built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-primitiveCount-03769# For
--     each 'AccelerationStructureBuildRangeInfoKHR' referenced by this
--     command, its @primitiveCount@ member /must/ have the same value
--     which was specified when @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-firstVertex-03770# For
--     each 'AccelerationStructureBuildRangeInfoKHR' referenced by this
--     command, if the corresponding geometry uses indices, its
--     @firstVertex@ member /must/ have the same value which was specified
--     when @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03801# For each
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', the
--     corresponding @ppBuildRangeInfos@[i][j].@primitiveCount@ /must/ be
--     less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxInstanceCount@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03707# For each
--     element of @pInfos@, the @buffer@ used to create its
--     @dstAccelerationStructure@ member /must/ be bound to device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03708# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' the @buffer@ used to
--     create its @srcAccelerationStructure@ member /must/ be bound to
--     device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03709# For each
--     element of @pInfos@, the @buffer@ used to create each acceleration
--     structure referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' /must/ be bound to device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03671# If
--     @pInfos@[i].@mode@ is 'BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR',
--     all addresses between @pInfos@[i].@scratchData.deviceAddress@ and
--     @pInfos@[i].@scratchData.deviceAddress@ + N - 1 /must/ be in the
--     buffer device address range of the same buffer, where N is given by
--     the @buildScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03672# If
--     @pInfos@[i].@mode@ is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', all addresses
--     between @pInfos@[i].@scratchData.deviceAddress@ and
--     @pInfos@[i].@scratchData.deviceAddress@ + N - 1 /must/ be in the
--     buffer device address range of the same buffer, where N is given by
--     the @updateScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-geometry-03673# The
--     buffers from which the buffer device addresses for all of the
--     @geometry.triangles.vertexData@, @geometry.triangles.indexData@,
--     @geometry.triangles.transformData@, @geometry.aabbs.data@, and
--     @geometry.instances.data@ members of all @pInfos@[i].@pGeometries@
--     and @pInfos@[i].@ppGeometries@ /must/ have been created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR'
--     usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03674# The buffer
--     from which the buffer device address
--     @pInfos@[i].@scratchData.deviceAddress@ is queried /must/ have been
--     created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_STORAGE_BUFFER_BIT'
--     usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03802# For each
--     element of @pInfos@, its @scratchData.deviceAddress@ member /must/
--     be a valid device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03803# For each
--     element of @pInfos@, if @scratchData.deviceAddress@ is the address
--     of a non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03710# For each
--     element of @pInfos@, its @scratchData.deviceAddress@ member /must/
--     be a multiple of
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@minAccelerationStructureScratchOffsetAlignment@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03804# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @geometry.triangles.vertexData.deviceAddress@ /must/ be a valid
--     device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03805# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.vertexData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @geometry.triangles.vertexData.deviceAddress@ /must/ be aligned to
--     the size in bytes of the smallest component of the format in
--     @vertexFormat@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.indexType@ is not
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR',
--     @geometry.triangles.indexData.deviceAddress@ /must/ be a valid
--     device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03807# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.indexType@ is not
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR', if
--     @geometry.triangles.indexData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03712# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', and with
--     @geometry.triangles.indexType@ not equal to
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR',
--     @geometry.triangles.indexData.deviceAddress@ /must/ be aligned to
--     the size in bytes of the type in @indexType@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03808# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is not @0@, it
--     /must/ be a valid device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03809# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03810# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is not @0@, it
--     /must/ be aligned to @16@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03811# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_AABBS_KHR',
--     @geometry.aabbs.data.deviceAddress@ /must/ be a valid device address
--     obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03812# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_AABBS_KHR', if
--     @geometry.aabbs.data.deviceAddress@ is the address of a non-sparse
--     buffer then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03714# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_AABBS_KHR',
--     @geometry.aabbs.data.deviceAddress@ /must/ be aligned to @8@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03715# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', if
--     @geometry.arrayOfPointers@ is
--     'Vulkan.Core10.FundamentalTypes.FALSE',
--     @geometry.instances.data.deviceAddress@ /must/ be aligned to @16@
--     bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03716# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', if
--     @geometry.arrayOfPointers@ is 'Vulkan.Core10.FundamentalTypes.TRUE',
--     @geometry.instances.data.deviceAddress@ /must/ be aligned to @8@
--     bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03717# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', if
--     @geometry.arrayOfPointers@ is 'Vulkan.Core10.FundamentalTypes.TRUE',
--     each element of @geometry.instances.data.deviceAddress@ in device
--     memory /must/ be aligned to @16@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03813# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR',
--     @geometry.instances.data.deviceAddress@ /must/ be a valid device
--     address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03814# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', if
--     @geometry.instances.data.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03815# For any
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', each
--     'AccelerationStructureInstanceKHR'::@accelerationStructureReference@
--     value in @geometry.instances.data.deviceAddress@ /must/ be a valid
--     device address containing a value obtained from
--     'getAccelerationStructureDeviceAddressKHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03675# For each
--     @pInfos@[i], @dstAccelerationStructure@ /must/ have been created
--     with a value of 'AccelerationStructureCreateInfoKHR'::@size@ greater
--     than or equal to the memory size required by the build operation, as
--     returned by 'getAccelerationStructureBuildSizesKHR' with
--     @pBuildInfo@ = @pInfos@[i] and with each element of the
--     @pMaxPrimitiveCounts@ array greater than or equal to the equivalent
--     @ppBuildRangeInfos@[i][j].@primitiveCount@ values for @j@ in
--     [0,@pInfos@[i].@geometryCount@)
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676#
--     Each element of @ppBuildRangeInfos@[i] /must/ be a valid pointer to
--     an array of @pInfos@[i].@geometryCount@
--     'AccelerationStructureBuildRangeInfoKHR' structures
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-parameter# @pInfos@
--     /must/ be a valid pointer to an array of @infoCount@ valid
--     'AccelerationStructureBuildGeometryInfoKHR' structures
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter#
--     @ppBuildRangeInfos@ /must/ be a valid pointer to an array of
--     @infoCount@ 'AccelerationStructureBuildRangeInfoKHR' structures
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-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-vkCmdBuildAccelerationStructuresKHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-renderpass# This command
--     /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength#
--     @infoCount@ /must/ be greater than @0@
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureBuildRangeInfoKHR',
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdBuildAccelerationStructuresKHR :: forall io
                                   . (MonadIO io)
                                  => -- | @commandBuffer@ is the command buffer into which the command will be
                                     -- recorded.
                                     CommandBuffer
                                  -> -- | @pInfos@ is an array of @infoCount@
                                     -- 'AccelerationStructureBuildGeometryInfoKHR' structures defining the
                                     -- geometry used to build each acceleration structure.
                                     ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
                                  -> -- | @ppBuildRangeInfos@ is an array of @infoCount@ pointers to arrays of
                                     -- 'AccelerationStructureBuildRangeInfoKHR' structures. Each
                                     -- @ppBuildRangeInfos@[i] is an array of @pInfos@[i].@geometryCount@
                                     -- 'AccelerationStructureBuildRangeInfoKHR' structures defining dynamic
                                     -- offsets to the addresses where geometry data is stored, as defined by
                                     -- @pInfos@[i].
                                     ("buildRangeInfos" ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
                                  -> io ()
cmdBuildAccelerationStructuresKHR :: CommandBuffer
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> io ()
cmdBuildAccelerationStructuresKHR commandBuffer :: CommandBuffer
commandBuffer infos :: "infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos buildRangeInfos :: "buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBuildAccelerationStructuresKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
vkCmdBuildAccelerationStructuresKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("ppBuildRangeInfos"
          ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
      -> IO ())
pVkCmdBuildAccelerationStructuresKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
vkCmdBuildAccelerationStructuresKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("ppBuildRangeInfos"
          ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBuildAccelerationStructuresKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBuildAccelerationStructuresKHR' :: Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO ()
vkCmdBuildAccelerationStructuresKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
-> Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO ()
mkVkCmdBuildAccelerationStructuresKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
vkCmdBuildAccelerationStructuresKHRPtr
  let pInfosLength :: Int
pInfosLength = ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
 -> Int)
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("buildRangeInfos"
 ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("buildRangeInfos"
  ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
 -> Int)
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "ppBuildRangeInfos and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos <- ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR))
-> ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureBuildGeometryInfoKHR ((("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 80) 8
  (Int
 -> AccelerationStructureBuildGeometryInfoKHR -> ContT () IO ())
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureBuildGeometryInfoKHR
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> AccelerationStructureBuildGeometryInfoKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int
-> "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (80 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureBuildGeometryInfoKHR) (AccelerationStructureBuildGeometryInfoKHR
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  "ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos <- ((("ppBuildRangeInfos"
   ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
  -> IO ())
 -> IO ())
-> ContT
     ()
     IO
     ("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO ())
  -> IO ())
 -> ContT
      ()
      IO
      ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)))
-> ((("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
     -> IO ())
    -> IO ())
-> ContT
     ()
     IO
     ("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("ppBuildRangeInfos"
     ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(Ptr AccelerationStructureBuildRangeInfoKHR) ((("buildRangeInfos"
 ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  (Int
 -> Vector AccelerationStructureBuildRangeInfoKHR -> ContT () IO ())
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Vector AccelerationStructureBuildRangeInfoKHR
e -> do
    Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos' <- ((Ptr AccelerationStructureBuildRangeInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureBuildRangeInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureBuildRangeInfoKHR -> IO ()) -> IO ())
 -> ContT () IO (Ptr AccelerationStructureBuildRangeInfoKHR))
-> ((Ptr AccelerationStructureBuildRangeInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr AccelerationStructureBuildRangeInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr AccelerationStructureBuildRangeInfoKHR -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureBuildRangeInfoKHR ((Vector AccelerationStructureBuildRangeInfoKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AccelerationStructureBuildRangeInfoKHR
e)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 4
    IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureBuildRangeInfoKHR -> IO ())
-> Vector AccelerationStructureBuildRangeInfoKHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i' :: Int
i' e' :: AccelerationStructureBuildRangeInfoKHR
e' -> Ptr AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos' Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> Ptr AccelerationStructureBuildRangeInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i')) :: Ptr AccelerationStructureBuildRangeInfoKHR) (AccelerationStructureBuildRangeInfoKHR
e')) (Vector AccelerationStructureBuildRangeInfoKHR
e)
    IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("ppBuildRangeInfos"
 ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> Ptr AccelerationStructureBuildRangeInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos ("ppBuildRangeInfos"
 ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> Int
-> "ppBuildRangeInfos"
   ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)) (Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos')) ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdBuildAccelerationStructuresKHR" (Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO ()
vkCmdBuildAccelerationStructuresKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pInfosLength :: Word32)) ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos) ("ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos))
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBuildAccelerationStructuresIndirectKHR
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr DeviceAddress -> Ptr Word32 -> Ptr (Ptr Word32) -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr DeviceAddress -> Ptr Word32 -> Ptr (Ptr Word32) -> IO ()

-- | vkCmdBuildAccelerationStructuresIndirectKHR - Build an acceleration
-- structure with some parameters provided on the device
--
-- = Description
--
-- Accesses to acceleration structures, scratch buffers, vertex buffers,
-- index buffers, and instance buffers must be synchronized as with
-- 'cmdBuildAccelerationStructuresKHR'.
--
-- Accesses to any element of @pIndirectDeviceAddresses@ /must/ be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-dependencies synchronized>
-- with the
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages pipeline stage>
-- and an
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-access-types access type>
-- of
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_INDIRECT_COMMAND_READ_BIT'.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03403# The
--     @srcAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03698#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03800#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03699# For
--     each element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03700# For
--     each element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03663# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR',
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive primitives>
--     in its @srcAccelerationStructure@ member /must/ not be made active
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03664# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', active primitives in
--     its @srcAccelerationStructure@ member /must/ not be made
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive>
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-None-03407# The
--     @dstAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03701#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @srcAccelerationStructure@ member of
--     any other element of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', which is accessed by
--     this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03702#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @dstAccelerationStructure@ member of
--     any other element of @pInfos@, which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03703#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @scratchData@ member of any element
--     of @pInfos@ (including the same element), which is accessed by this
--     command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03704#
--     The range of memory backing the @scratchData@ member of any element
--     of @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @scratchData@ member of any other element of
--     @pInfos@, which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03705#
--     The range of memory backing the @scratchData@ member of any element
--     of @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @srcAccelerationStructure@ member of any element
--     of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' (including the same
--     element), which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-dstAccelerationStructure-03706#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing any acceleration structure referenced by
--     the @geometry.instances.data@ member of any element of @pGeometries@
--     or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@,
--     which is accessed by this command
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03666# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03667# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ have been built before with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR' set in
--     'AccelerationStructureBuildGeometryInfoKHR'::@flags@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03668# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ and @dstAccelerationStructure@ members
--     /must/ either be the same
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR', or not have
--     any
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-memory-aliasing memory aliasing>
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03758# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @geometryCount@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03759# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @flags@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03760# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @type@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03761# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @geometryType@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03762# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @flags@ member /must/
--     have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03763# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.vertexFormat@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03764# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.maxVertex@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03765# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.indexType@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03766# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was NULL when
--     @srcAccelerationStructure@ was last built, then it must be NULL.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03767# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was not NULL when
--     @srcAccelerationStructure@ was last built, then it may not be NULL.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03768# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', and @geometry.triangles.indexType@ is
--     not 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR', then the
--     value of each index referenced index must be the same as the
--     corresponding index value when @srcAccelerationStructure@ was last
--     built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-primitiveCount-03769#
--     For each 'AccelerationStructureBuildRangeInfoKHR' referenced by this
--     command, its @primitiveCount@ member /must/ have the same value
--     which was specified when @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-firstVertex-03770#
--     For each 'AccelerationStructureBuildRangeInfoKHR' referenced by this
--     command, if the corresponding geometry uses indices, its
--     @firstVertex@ member /must/ have the same value which was specified
--     when @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03801# For
--     each element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', the corresponding
--     @ppMaxPrimitiveCounts@[i][j] /must/ be less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxInstanceCount@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03707# For
--     each element of @pInfos@, the @buffer@ used to create its
--     @dstAccelerationStructure@ member /must/ be bound to device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03708# For
--     each element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' the @buffer@ used to
--     create its @srcAccelerationStructure@ member /must/ be bound to
--     device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03709# For
--     each element of @pInfos@, the @buffer@ used to create each
--     acceleration structure referenced by the @geometry.instances.data@
--     member of any element of @pGeometries@ or @ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR' /must/ be bound to
--     device memory
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03671# If
--     @pInfos@[i].@mode@ is 'BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR',
--     all addresses between @pInfos@[i].@scratchData.deviceAddress@ and
--     @pInfos@[i].@scratchData.deviceAddress@ + N - 1 /must/ be in the
--     buffer device address range of the same buffer, where N is given by
--     the @buildScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03672# If
--     @pInfos@[i].@mode@ is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', all addresses
--     between @pInfos@[i].@scratchData.deviceAddress@ and
--     @pInfos@[i].@scratchData.deviceAddress@ + N - 1 /must/ be in the
--     buffer device address range of the same buffer, where N is given by
--     the @updateScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-geometry-03673#
--     The buffers from which the buffer device addresses for all of the
--     @geometry.triangles.vertexData@, @geometry.triangles.indexData@,
--     @geometry.triangles.transformData@, @geometry.aabbs.data@, and
--     @geometry.instances.data@ members of all @pInfos@[i].@pGeometries@
--     and @pInfos@[i].@ppGeometries@ /must/ have been created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR'
--     usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03674# The
--     buffer from which the buffer device address
--     @pInfos@[i].@scratchData.deviceAddress@ is queried /must/ have been
--     created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_STORAGE_BUFFER_BIT'
--     usage flag
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03802# For
--     each element of @pInfos@, its @scratchData.deviceAddress@ member
--     /must/ be a valid device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03803# For
--     each element of @pInfos@, if @scratchData.deviceAddress@ is the
--     address of a non-sparse buffer then it /must/ be bound completely
--     and contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory'
--     object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03710# For
--     each element of @pInfos@, its @scratchData.deviceAddress@ member
--     /must/ be a multiple of
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@minAccelerationStructureScratchOffsetAlignment@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03804# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @geometry.triangles.vertexData.deviceAddress@ /must/ be a valid
--     device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03805# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.vertexData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03711# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @geometry.triangles.vertexData.deviceAddress@ /must/ be aligned to
--     the size in bytes of the smallest component of the format in
--     @vertexFormat@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03806# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if @geometry.triangles.indexType@ is
--     not 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR',
--     @geometry.triangles.indexData.deviceAddress@ /must/ be a valid
--     device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03807# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if @geometry.triangles.indexType@ is
--     not 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR', if
--     @geometry.triangles.indexData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03712# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', and with
--     @geometry.triangles.indexType@ not equal to
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR',
--     @geometry.triangles.indexData.deviceAddress@ /must/ be aligned to
--     the size in bytes of the type in @indexType@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03808# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is not @0@, it
--     /must/ be a valid device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03809# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03810# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.deviceAddress@ is not @0@, it
--     /must/ be aligned to @16@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03811# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_AABBS_KHR', @geometry.aabbs.data.deviceAddress@
--     /must/ be a valid device address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03812# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_AABBS_KHR', if @geometry.aabbs.data.deviceAddress@ is
--     the address of a non-sparse buffer then it /must/ be bound
--     completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03714# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_AABBS_KHR', @geometry.aabbs.data.deviceAddress@
--     /must/ be aligned to @8@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03715# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', if @geometry.arrayOfPointers@ is
--     'Vulkan.Core10.FundamentalTypes.FALSE',
--     @geometry.instances.data.deviceAddress@ /must/ be aligned to @16@
--     bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03716# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', if @geometry.arrayOfPointers@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE',
--     @geometry.instances.data.deviceAddress@ /must/ be aligned to @8@
--     bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03717# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', if @geometry.arrayOfPointers@ is
--     'Vulkan.Core10.FundamentalTypes.TRUE', each element of
--     @geometry.instances.data.deviceAddress@ in device memory /must/ be
--     aligned to @16@ bytes
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03813# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR',
--     @geometry.instances.data.deviceAddress@ /must/ be a valid device
--     address obtained from
--     'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.getBufferDeviceAddress'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03814# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', if
--     @geometry.instances.data.deviceAddress@ is the address of a
--     non-sparse buffer then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03815# For
--     any element of @pInfos@[i].@pGeometries@ or
--     @pInfos@[i].@ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR', each
--     'AccelerationStructureInstanceKHR'::@accelerationStructureReference@
--     value in @geometry.instances.data.deviceAddress@ /must/ be a valid
--     device address containing a value obtained from
--     'getAccelerationStructureDeviceAddressKHR'
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03645#
--     For any element of @pIndirectDeviceAddresses@, if the buffer from
--     which it was queried is non-sparse then it /must/ be bound
--     completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03646#
--     For any element of @pIndirectDeviceAddresses@[i], all device
--     addresses between @pIndirectDeviceAddresses@[i] and
--     @pIndirectDeviceAddresses@[i] + (@pInfos@[i]→geometryCount ×
--     @pIndirectStrides@[i]) - 1 /must/ be in the buffer device address
--     range of the same buffer
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03647#
--     For any element of @pIndirectDeviceAddresses@, the buffer from which
--     it was queried /must/ have been created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     bit set
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03648#
--     Each element of @pIndirectDeviceAddresses@ /must/ be a multiple of
--     @4@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-03787#
--     Each element of @pIndirectStrides@ /must/ be a multiple of @4@
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-03649#
--     @commandBuffer@ /must/ not be a protected command buffer
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-accelerationStructureIndirectBuild-03650#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureIndirectBuild ::accelerationStructureIndirectBuild>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03651#
--     Each 'AccelerationStructureBuildRangeInfoKHR' structure referenced
--     by any element of @pIndirectDeviceAddresses@ /must/ be a valid
--     'AccelerationStructureBuildRangeInfoKHR' structure
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03652#
--     @pInfos@[i].@dstAccelerationStructure@ /must/ have been created with
--     a value of 'AccelerationStructureCreateInfoKHR'::@size@ greater than
--     or equal to the memory size required by the build operation, as
--     returned by 'getAccelerationStructureBuildSizesKHR' with
--     @pBuildInfo@ = @pInfos@[i] and @pMaxPrimitiveCounts@ =
--     @ppMaxPrimitiveCounts@[i]
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-03653#
--     Each @ppMaxPrimitiveCounts@[i][j] /must/ be greater than or equal to
--     the the @primitiveCount@ value specified by the
--     'AccelerationStructureBuildRangeInfoKHR' structure located at
--     @pIndirectDeviceAddresses@[i] + (@j@ × @pIndirectStrides@[i])
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-parameter#
--     @pInfos@ /must/ be a valid pointer to an array of @infoCount@ valid
--     'AccelerationStructureBuildGeometryInfoKHR' structures
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter#
--     @pIndirectDeviceAddresses@ /must/ be a valid pointer to an array of
--     @infoCount@ 'Vulkan.Core10.FundamentalTypes.DeviceAddress' values
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter#
--     @pIndirectStrides@ /must/ be a valid pointer to an array of
--     @infoCount@ @uint32_t@ values
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-parameter#
--     @ppMaxPrimitiveCounts@ /must/ be a valid pointer to an array of
--     @infoCount@ @uint32_t@ values
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-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-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support compute operations
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-renderpass# This
--     command /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength#
--     @infoCount@ /must/ be greater than @0@
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Compute                                                                                                               |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress'
cmdBuildAccelerationStructuresIndirectKHR :: forall io
                                           . (MonadIO io)
                                          => -- | @commandBuffer@ is the command buffer into which the command will be
                                             -- recorded.
                                             CommandBuffer
                                          -> -- | @pInfos@ is an array of @infoCount@
                                             -- 'AccelerationStructureBuildGeometryInfoKHR' structures defining the
                                             -- geometry used to build each acceleration structure.
                                             ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
                                          -> -- | @pIndirectDeviceAddresses@ is an array of @infoCount@ buffer device
                                             -- addresses which point to @pInfos@[i]→@geometryCount@
                                             -- 'AccelerationStructureBuildRangeInfoKHR' structures defining dynamic
                                             -- offsets to the addresses where geometry data is stored, as defined by
                                             -- @pInfos@[i].
                                             ("indirectDeviceAddresses" ::: Vector DeviceAddress)
                                          -> -- | @pIndirectStrides@ is an array of @infoCount@ byte strides between
                                             -- elements of @pIndirectDeviceAddresses@.
                                             ("indirectStrides" ::: Vector Word32)
                                          -> -- | @ppMaxPrimitiveCounts@ is an array of @infoCount@ arrays of
                                             -- @pInfo@[i]→@geometryCount@ values indicating the maximum number of
                                             -- primitives that will be built by this command for each geometry.
                                             ("maxPrimitiveCounts" ::: Vector (Vector Word32))
                                          -> io ()
cmdBuildAccelerationStructuresIndirectKHR :: CommandBuffer
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
-> ("maxPrimitiveCounts"
    ::: Vector
          ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
-> io ()
cmdBuildAccelerationStructuresIndirectKHR commandBuffer :: CommandBuffer
commandBuffer infos :: "infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos indirectDeviceAddresses :: "indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64)
indirectDeviceAddresses indirectStrides :: "indirectStrides" ::: Vector ("firstQuery" ::: Word32)
indirectStrides maxPrimitiveCounts :: "maxPrimitiveCounts"
::: Vector ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
maxPrimitiveCounts = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBuildAccelerationStructuresIndirectKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
vkCmdBuildAccelerationStructuresIndirectKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
      -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
      -> ("ppMaxPrimitiveCounts"
          ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
      -> IO ())
pVkCmdBuildAccelerationStructuresIndirectKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
vkCmdBuildAccelerationStructuresIndirectKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
      -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
      -> ("ppMaxPrimitiveCounts"
          ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBuildAccelerationStructuresIndirectKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBuildAccelerationStructuresIndirectKHR' :: Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("ppMaxPrimitiveCounts"
    ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> IO ()
vkCmdBuildAccelerationStructuresIndirectKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
-> Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("ppMaxPrimitiveCounts"
    ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> IO ()
mkVkCmdBuildAccelerationStructuresIndirectKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
vkCmdBuildAccelerationStructuresIndirectKHRPtr
  let pInfosLength :: Int
pInfosLength = ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
 -> Int)
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
 -> Int)
-> ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
-> Int
forall a b. (a -> b) -> a -> b
$ ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64)
indirectDeviceAddresses)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "pIndirectDeviceAddresses and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int
forall a. Vector a -> Int
Data.Vector.length (("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int)
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int
forall a b. (a -> b) -> a -> b
$ ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
indirectStrides)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "pIndirectStrides and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("maxPrimitiveCounts"
 ::: Vector
       ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("maxPrimitiveCounts"
  ::: Vector
        ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
 -> Int)
-> ("maxPrimitiveCounts"
    ::: Vector
          ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
-> Int
forall a b. (a -> b) -> a -> b
$ ("maxPrimitiveCounts"
::: Vector ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
maxPrimitiveCounts)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "ppMaxPrimitiveCounts and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos <- ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR))
-> ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureBuildGeometryInfoKHR ((("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 80) 8
  (Int
 -> AccelerationStructureBuildGeometryInfoKHR -> ContT () IO ())
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureBuildGeometryInfoKHR
e -> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ()) -> IO ()) -> ContT () IO ())
-> ((() -> IO ()) -> IO ()) -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> AccelerationStructureBuildGeometryInfoKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int
-> "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (80 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureBuildGeometryInfoKHR) (AccelerationStructureBuildGeometryInfoKHR
e) (IO () -> IO ())
-> ((() -> IO ()) -> IO ()) -> (() -> IO ()) -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ())) ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
pPIndirectDeviceAddresses <- ((("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)))
-> ((("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @DeviceAddress ((("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64)
indirectDeviceAddresses)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("dataSize" ::: Word64) -> IO ())
-> ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64))
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "dataSize" ::: Word64
e -> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
pPIndirectDeviceAddresses ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceAddress) ("dataSize" ::: Word64
e)) ("indirectDeviceAddresses" ::: Vector ("dataSize" ::: Word64)
indirectDeviceAddresses)
  "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPIndirectStrides <- ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)) -> IO ())
 -> IO ())
-> ContT
     () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)) -> IO ())
  -> IO ())
 -> ContT
      () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int
forall a. Vector a -> Int
Data.Vector.length ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
indirectStrides)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("firstQuery" ::: Word32) -> IO ())
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "firstQuery" ::: Word32
e -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPIndirectStrides ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("firstQuery" ::: Word32
e)) ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
indirectStrides)
  "ppMaxPrimitiveCounts"
::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
pPpMaxPrimitiveCounts <- ((("ppMaxPrimitiveCounts"
   ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
  -> IO ())
 -> IO ())
-> ContT
     ()
     IO
     ("ppMaxPrimitiveCounts"
      ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("ppMaxPrimitiveCounts"
    ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
   -> IO ())
  -> IO ())
 -> ContT
      ()
      IO
      ("ppMaxPrimitiveCounts"
       ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))))
-> ((("ppMaxPrimitiveCounts"
      ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
     -> IO ())
    -> IO ())
-> ContT
     ()
     IO
     ("ppMaxPrimitiveCounts"
      ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("ppMaxPrimitiveCounts"
     ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(Ptr Word32) ((("maxPrimitiveCounts"
 ::: Vector
       ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("maxPrimitiveCounts"
::: Vector ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
maxPrimitiveCounts)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  (Int
 -> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
 -> ContT () IO ())
-> ("maxPrimitiveCounts"
    ::: Vector
          ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)))
-> ContT () IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "indirectStrides" ::: Vector ("firstQuery" ::: Word32)
e -> do
    "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPpMaxPrimitiveCounts' <- ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)) -> IO ())
 -> IO ())
-> ContT
     () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)) -> IO ())
  -> IO ())
 -> ContT
      () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int
forall a. Vector a -> Int
Data.Vector.length ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
e)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("firstQuery" ::: Word32) -> IO ())
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i' :: Int
i' e' :: "firstQuery" ::: Word32
e' -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPpMaxPrimitiveCounts' ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i')) :: Ptr Word32) ("firstQuery" ::: Word32
e')) ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
e)
    IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("ppMaxPrimitiveCounts"
 ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("ppMaxPrimitiveCounts"
::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
pPpMaxPrimitiveCounts ("ppMaxPrimitiveCounts"
 ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> Int
-> "ppMaxPrimitiveCounts"
   ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr Word32)) ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPpMaxPrimitiveCounts')) ("maxPrimitiveCounts"
::: Vector ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
maxPrimitiveCounts)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkCmdBuildAccelerationStructuresIndirectKHR" (Ptr CommandBuffer_T
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("ppMaxPrimitiveCounts"
    ::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> IO ()
vkCmdBuildAccelerationStructuresIndirectKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pInfosLength :: Word32)) ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos) ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
pPIndirectDeviceAddresses) ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPIndirectStrides) ("ppMaxPrimitiveCounts"
::: Ptr ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
pPpMaxPrimitiveCounts))
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkBuildAccelerationStructuresKHR
  :: FunPtr (Ptr Device_T -> DeferredOperationKHR -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr (Ptr AccelerationStructureBuildRangeInfoKHR) -> IO Result) -> Ptr Device_T -> DeferredOperationKHR -> Word32 -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr (Ptr AccelerationStructureBuildRangeInfoKHR) -> IO Result

-- | vkBuildAccelerationStructuresKHR - Build an acceleration structure on
-- the host
--
-- = Description
--
-- This command fulfills the same task as
-- 'cmdBuildAccelerationStructuresKHR' but is executed by the host.
--
-- The 'buildAccelerationStructuresKHR' command provides the ability to
-- initiate multiple acceleration structures builds, however there is no
-- ordering or synchronization implied between any of the individual
-- acceleration structure builds.
--
-- Note
--
-- This means that an application /cannot/ build a top-level acceleration
-- structure in the same 'buildAccelerationStructuresKHR' call as the
-- associated bottom-level or instance acceleration structures are being
-- built. There also /cannot/ be any memory aliasing between any
-- acceleration structure memories or scratch memories being used by any of
-- the builds.
--
-- == Valid Usage
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03403# The
--     @srcAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03698#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ not be the same acceleration structure as the
--     @dstAccelerationStructure@ member of any other element of @pInfos@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03800#
--     The @dstAccelerationStructure@ member of any element of @pInfos@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03699# For each
--     element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03700# For each
--     element of @pInfos@, if its @type@ member is
--     'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR', its
--     @dstAccelerationStructure@ member /must/ have been created with a
--     value of 'AccelerationStructureCreateInfoKHR'::@type@ equal to
--     either 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03663# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR',
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive primitives>
--     in its @srcAccelerationStructure@ member /must/ not be made active
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03664# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', active primitives in
--     its @srcAccelerationStructure@ member /must/ not be made
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure-inactive-prims inactive>
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-None-03407# The
--     @dstAccelerationStructure@ member of any element of @pInfos@ /must/
--     not be referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03701#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @srcAccelerationStructure@ member of
--     any other element of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', which is accessed by
--     this command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03702#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @dstAccelerationStructure@ member of
--     any other element of @pInfos@, which is accessed by this command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03703#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing the @scratchData@ member of any element
--     of @pInfos@ (including the same element), which is accessed by this
--     command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-scratchData-03704# The range
--     of memory backing the @scratchData@ member of any element of
--     @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @scratchData@ member of any other element of
--     @pInfos@, which is accessed by this command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-scratchData-03705# The range
--     of memory backing the @scratchData@ member of any element of
--     @pInfos@ that is accessed by this command /must/ not overlap the
--     memory backing the @srcAccelerationStructure@ member of any element
--     of @pInfos@ with a @mode@ equal to
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' (including the same
--     element), which is accessed by this command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-dstAccelerationStructure-03706#
--     The range of memory backing the @dstAccelerationStructure@ member of
--     any element of @pInfos@ that is accessed by this command /must/ not
--     overlap the memory backing any acceleration structure referenced by
--     the @geometry.instances.data@ member of any element of @pGeometries@
--     or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' in any other element of @pInfos@,
--     which is accessed by this command
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03666# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03667# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ member /must/ have been built before with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR' set in
--     'AccelerationStructureBuildGeometryInfoKHR'::@flags@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03668# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its
--     @srcAccelerationStructure@ and @dstAccelerationStructure@ members
--     /must/ either be the same
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR', or not have
--     any
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-memory-aliasing memory aliasing>
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03758# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @geometryCount@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03759# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @flags@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03760# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', its @type@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03761# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @geometryType@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03762# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, its @flags@ member /must/
--     have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03763# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.vertexFormat@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03764# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.maxVertex@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03765# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', its @geometry.triangles.indexType@
--     member /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03766# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was NULL when
--     @srcAccelerationStructure@ was last built, then it must be NULL.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03767# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', if its
--     @geometry.triangles.transformData@ member was not NULL when
--     @srcAccelerationStructure@ was last built, then it may not be NULL.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03768# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', then for each
--     'AccelerationStructureGeometryKHR' structure referred to by its
--     @pGeometries@ or @ppGeometries@ members, if @geometryType@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', and @geometry.triangles.indexType@ is
--     not 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR', then the
--     value of each index referenced index must be the same as the
--     corresponding index value when @srcAccelerationStructure@ was last
--     built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-primitiveCount-03769# For
--     each 'AccelerationStructureBuildRangeInfoKHR' referenced by this
--     command, its @primitiveCount@ member /must/ have the same value
--     which was specified when @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-firstVertex-03770# For each
--     'AccelerationStructureBuildRangeInfoKHR' referenced by this command,
--     if the corresponding geometry uses indices, its @firstVertex@ member
--     /must/ have the same value which was specified when
--     @srcAccelerationStructure@ was last built.
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03801# For each
--     element of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@
--     with a @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', the
--     corresponding @ppBuildRangeInfos@[i][j].@primitiveCount@ /must/ be
--     less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxInstanceCount@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03675# For each
--     @pInfos@[i], @dstAccelerationStructure@ /must/ have been created
--     with a value of 'AccelerationStructureCreateInfoKHR'::@size@ greater
--     than or equal to the memory size required by the build operation, as
--     returned by 'getAccelerationStructureBuildSizesKHR' with
--     @pBuildInfo@ = @pInfos@[i] and with each element of the
--     @pMaxPrimitiveCounts@ array greater than or equal to the equivalent
--     @ppBuildRangeInfos@[i][j].@primitiveCount@ values for @j@ in
--     [0,@pInfos@[i].@geometryCount@)
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676# Each
--     element of @ppBuildRangeInfos@[i] /must/ be a valid pointer to an
--     array of @pInfos@[i].@geometryCount@
--     'AccelerationStructureBuildRangeInfoKHR' structures
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-deferredOperation-03677# If
--     @deferredOperation@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     it /must/ be a valid
--     'Vulkan.Extensions.Handles.DeferredOperationKHR' object
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-deferredOperation-03678# Any
--     previous deferred operation that was associated with
--     @deferredOperation@ /must/ be complete
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03722# For each
--     element of @pInfos@, the @buffer@ used to create its
--     @dstAccelerationStructure@ member /must/ be bound to host-visible
--     device memory
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03723# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' the @buffer@ used to
--     create its @srcAccelerationStructure@ member /must/ be bound to
--     host-visible device memory
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03724# For each
--     element of @pInfos@, the @buffer@ used to create each acceleration
--     structure referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' /must/ be bound to host-visible device
--     memory
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-accelerationStructureHostCommands-03581#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureHostCommands ::accelerationStructureHostCommands>
--     feature /must/ be enabled
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03725# If
--     @pInfos@[i].@mode@ is 'BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR',
--     all addresses between @pInfos@[i].@scratchData.hostAddress@ and
--     @pInfos@[i].@scratchData.hostAddress@ + N - 1 /must/ be valid host
--     memory, where N is given by the @buildScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03726# If
--     @pInfos@[i].@mode@ is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR', all addresses
--     between @pInfos@[i].@scratchData.hostAddress@ and
--     @pInfos@[i].@scratchData.hostAddress@ + N - 1 /must/ be valid host
--     memory, where N is given by the @updateScratchSize@ member of the
--     'AccelerationStructureBuildSizesInfoKHR' structure returned from a
--     call to 'getAccelerationStructureBuildSizesKHR' with an identical
--     'AccelerationStructureBuildGeometryInfoKHR' structure and primitive
--     count
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03771# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @geometry.triangles.vertexData.hostAddress@ /must/ be a valid host
--     address
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03772# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.indexType@ is not
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR',
--     @geometry.triangles.indexData.hostAddress@ /must/ be a valid host
--     address
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03773# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_TRIANGLES_KHR', if
--     @geometry.triangles.transformData.hostAddress@ is not @0@, it /must/
--     be a valid host address
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03774# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_AABBS_KHR',
--     @geometry.aabbs.data.hostAddress@ /must/ be a valid host address
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03775# For each
--     element of @pInfos@, the @buffer@ used to create its
--     @dstAccelerationStructure@ member /must/ be bound to memory that was
--     not allocated with multiple instances
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03776# For each
--     element of @pInfos@, if its @mode@ member is
--     'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' the @buffer@ used to
--     create its @srcAccelerationStructure@ member /must/ be bound to
--     memory that was not allocated with multiple instances
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03777# For each
--     element of @pInfos@, the @buffer@ used to create each acceleration
--     structure referenced by the @geometry.instances.data@ member of any
--     element of @pGeometries@ or @ppGeometries@ with a @geometryType@ of
--     'GEOMETRY_TYPE_INSTANCES_KHR' /must/ be bound to memory that was not
--     allocated with multiple instances
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03778# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR',
--     @geometry.instances.data.hostAddress@ /must/ be a valid host address
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-03779# For any element
--     of @pInfos@[i].@pGeometries@ or @pInfos@[i].@ppGeometries@ with a
--     @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', each
--     'AccelerationStructureInstanceKHR'::@accelerationStructureReference@
--     value in @geometry.instances.data.hostAddress@ must be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-deferredOperation-parameter#
--     If @deferredOperation@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @deferredOperation@ /must/
--     be a valid 'Vulkan.Extensions.Handles.DeferredOperationKHR' handle
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-pInfos-parameter# @pInfos@
--     /must/ be a valid pointer to an array of @infoCount@ valid
--     'AccelerationStructureBuildGeometryInfoKHR' structures
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter#
--     @ppBuildRangeInfos@ /must/ be a valid pointer to an array of
--     @infoCount@ 'AccelerationStructureBuildRangeInfoKHR' structures
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-infoCount-arraylength#
--     @infoCount@ /must/ be greater than @0@
--
-- -   #VUID-vkBuildAccelerationStructuresKHR-deferredOperation-parent# If
--     @deferredOperation@ 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.Core10.Enums.Result.OPERATION_DEFERRED_KHR'
--
--     -   'Vulkan.Core10.Enums.Result.OPERATION_NOT_DEFERRED_KHR'
--
-- [<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
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureBuildRangeInfoKHR',
-- 'Vulkan.Extensions.Handles.DeferredOperationKHR',
-- 'Vulkan.Core10.Handles.Device'
buildAccelerationStructuresKHR :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the 'Vulkan.Core10.Handles.Device' for which the
                                  -- acceleration structures are being built.
                                  Device
                               -> -- | @deferredOperation@ is an optional
                                  -- 'Vulkan.Extensions.Handles.DeferredOperationKHR' to
                                  -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#deferred-host-operations-requesting request deferral>
                                  -- for this command.
                                  DeferredOperationKHR
                               -> -- | @pInfos@ is a pointer to an array of @infoCount@
                                  -- 'AccelerationStructureBuildGeometryInfoKHR' structures defining the
                                  -- geometry used to build each acceleration structure.
                                  ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
                               -> -- | @ppBuildRangeInfos@ is an array of @infoCount@ pointers to arrays of
                                  -- 'AccelerationStructureBuildRangeInfoKHR' structures. Each
                                  -- @ppBuildRangeInfos@[i] is an array of @pInfos@[i].@geometryCount@
                                  -- 'AccelerationStructureBuildRangeInfoKHR' structures defining dynamic
                                  -- offsets to the addresses where geometry data is stored, as defined by
                                  -- @pInfos@[i].
                                  ("buildRangeInfos" ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
                               -> io (Result)
buildAccelerationStructuresKHR :: Device
-> DeferredOperationKHR
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> io Result
buildAccelerationStructuresKHR device :: Device
device deferredOperation :: DeferredOperationKHR
deferredOperation infos :: "infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos buildRangeInfos :: "buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos = IO Result -> io Result
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Result -> io Result)
-> (ContT Result IO Result -> IO Result)
-> ContT Result IO Result
-> io Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Result IO Result -> IO Result
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Result IO Result -> io Result)
-> ContT Result IO Result -> io Result
forall a b. (a -> b) -> a -> b
$ do
  let vkBuildAccelerationStructuresKHRPtr :: FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
vkBuildAccelerationStructuresKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("ppBuildRangeInfos"
          ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
      -> IO Result)
pVkBuildAccelerationStructuresKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
vkBuildAccelerationStructuresKHRPtr FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> DeferredOperationKHR
      -> ("firstQuery" ::: Word32)
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("ppBuildRangeInfos"
          ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkBuildAccelerationStructuresKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkBuildAccelerationStructuresKHR' :: Ptr Device_T
-> DeferredOperationKHR
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO Result
vkBuildAccelerationStructuresKHR' = FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
-> Ptr Device_T
-> DeferredOperationKHR
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO Result
mkVkBuildAccelerationStructuresKHR FunPtr
  (Ptr Device_T
   -> DeferredOperationKHR
   -> ("firstQuery" ::: Word32)
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
vkBuildAccelerationStructuresKHRPtr
  let pInfosLength :: Int
pInfosLength = ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
 -> Int)
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((("buildRangeInfos"
 ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("buildRangeInfos"
  ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
 -> Int)
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a b. (a -> b) -> a -> b
$ ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pInfosLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "ppBuildRangeInfos and pInfos must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos <- ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
  -> IO Result)
 -> IO Result)
-> ContT
     Result
     IO
     ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> IO Result)
  -> IO Result)
 -> ContT
      Result
      IO
      ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR))
-> ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
     -> IO Result)
    -> IO Result)
-> ContT
     Result
     IO
     ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO Result)
-> IO Result
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureBuildGeometryInfoKHR ((("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 80) 8
  (Int
 -> AccelerationStructureBuildGeometryInfoKHR -> ContT Result IO ())
-> ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR)
-> ContT Result IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureBuildGeometryInfoKHR
e -> ((() -> IO Result) -> IO Result) -> ContT Result IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO Result) -> IO Result) -> ContT Result IO ())
-> ((() -> IO Result) -> IO Result) -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> AccelerationStructureBuildGeometryInfoKHR
-> IO Result
-> IO Result
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int
-> "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (80 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureBuildGeometryInfoKHR) (AccelerationStructureBuildGeometryInfoKHR
e) (IO Result -> IO Result)
-> ((() -> IO Result) -> IO Result)
-> (() -> IO Result)
-> IO Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO Result) -> () -> IO Result
forall a b. (a -> b) -> a -> b
$ ())) ("infos" ::: Vector AccelerationStructureBuildGeometryInfoKHR
infos)
  "ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos <- ((("ppBuildRangeInfos"
   ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
  -> IO Result)
 -> IO Result)
-> ContT
     Result
     IO
     ("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
   -> IO Result)
  -> IO Result)
 -> ContT
      Result
      IO
      ("ppBuildRangeInfos"
       ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)))
-> ((("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
     -> IO Result)
    -> IO Result)
-> ContT
     Result
     IO
     ("ppBuildRangeInfos"
      ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("ppBuildRangeInfos"
     ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
    -> IO Result)
-> IO Result
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(Ptr AccelerationStructureBuildRangeInfoKHR) ((("buildRangeInfos"
 ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
  (Int
 -> Vector AccelerationStructureBuildRangeInfoKHR
 -> ContT Result IO ())
-> ("buildRangeInfos"
    ::: Vector (Vector AccelerationStructureBuildRangeInfoKHR))
-> ContT Result IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Vector AccelerationStructureBuildRangeInfoKHR
e -> do
    Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos' <- ((Ptr AccelerationStructureBuildRangeInfoKHR -> IO Result)
 -> IO Result)
-> ContT Result IO (Ptr AccelerationStructureBuildRangeInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureBuildRangeInfoKHR -> IO Result)
  -> IO Result)
 -> ContT Result IO (Ptr AccelerationStructureBuildRangeInfoKHR))
-> ((Ptr AccelerationStructureBuildRangeInfoKHR -> IO Result)
    -> IO Result)
-> ContT Result IO (Ptr AccelerationStructureBuildRangeInfoKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (Ptr AccelerationStructureBuildRangeInfoKHR -> IO Result)
-> IO Result
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureBuildRangeInfoKHR ((Vector AccelerationStructureBuildRangeInfoKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AccelerationStructureBuildRangeInfoKHR
e)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 4
    IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureBuildRangeInfoKHR -> IO ())
-> Vector AccelerationStructureBuildRangeInfoKHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i' :: Int
i' e' :: AccelerationStructureBuildRangeInfoKHR
e' -> Ptr AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos' Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> Ptr AccelerationStructureBuildRangeInfoKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i')) :: Ptr AccelerationStructureBuildRangeInfoKHR) (AccelerationStructureBuildRangeInfoKHR
e')) (Vector AccelerationStructureBuildRangeInfoKHR
e)
    IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ ("ppBuildRangeInfos"
 ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> Ptr AccelerationStructureBuildRangeInfoKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos ("ppBuildRangeInfos"
 ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> Int
-> "ppBuildRangeInfos"
   ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)) (Ptr AccelerationStructureBuildRangeInfoKHR
pPpBuildRangeInfos')) ("buildRangeInfos"
::: Vector (Vector AccelerationStructureBuildRangeInfoKHR)
buildRangeInfos)
  Result
r <- IO Result -> ContT Result IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT Result IO Result)
-> IO Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkBuildAccelerationStructuresKHR" (Ptr Device_T
-> DeferredOperationKHR
-> ("firstQuery" ::: Word32)
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("ppBuildRangeInfos"
    ::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR))
-> IO Result
vkBuildAccelerationStructuresKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DeferredOperationKHR
deferredOperation) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pInfosLength :: Word32)) ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pPInfos) ("ppBuildRangeInfos"
::: Ptr (Ptr AccelerationStructureBuildRangeInfoKHR)
pPpBuildRangeInfos))
  IO () -> ContT Result IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Result IO ()) -> IO () -> ContT Result IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Result -> ContT Result IO Result
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Result -> ContT Result IO Result)
-> Result -> ContT Result IO Result
forall a b. (a -> b) -> a -> b
$ (Result
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetAccelerationStructureDeviceAddressKHR
  :: FunPtr (Ptr Device_T -> Ptr AccelerationStructureDeviceAddressInfoKHR -> IO DeviceAddress) -> Ptr Device_T -> Ptr AccelerationStructureDeviceAddressInfoKHR -> IO DeviceAddress

-- | vkGetAccelerationStructureDeviceAddressKHR - Query an address of a
-- acceleration structure
--
-- = Description
--
-- The 64-bit return value is an address of the acceleration structure,
-- which can be used for device and shader operations that involve
-- acceleration structures, such as ray traversal and acceleration
-- structure building.
--
-- If the acceleration structure was created with a non-zero value of
-- 'AccelerationStructureCreateInfoKHR'::@deviceAddress@ the return value
-- will be the same address.
--
-- If the acceleration structure was created with a @type@ of
-- 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' the returned address /must/ be
-- consistent with the relative offset to other acceleration structures of
-- @type@ of 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' allocated with the
-- same 'Vulkan.Core10.Handles.Buffer'. That is, the difference in returned
-- addresses between the two /must/ be the same as the difference in
-- offsets provided at acceleration structure creation.
--
-- Note
--
-- The acceleration structure device address /may/ be different from the
-- buffer device address corresponding to the acceleration structure’s
-- start offset in its storage buffer for acceleration structure types
-- other than 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'.
--
-- == Valid Usage
--
-- -   #VUID-vkGetAccelerationStructureDeviceAddressKHR-device-03504# If
--     @device@ was created with multiple physical devices, then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetAccelerationStructureDeviceAddressKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetAccelerationStructureDeviceAddressKHR-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'AccelerationStructureDeviceAddressInfoKHR' structure
--
-- = See Also
--
-- 'AccelerationStructureDeviceAddressInfoKHR',
-- 'Vulkan.Core10.Handles.Device'
getAccelerationStructureDeviceAddressKHR :: forall io
                                          . (MonadIO io)
                                         => -- | @device@ is the logical device that the accelerationStructure was
                                            -- created on.
                                            Device
                                         -> -- | @pInfo@ is a pointer to a 'AccelerationStructureDeviceAddressInfoKHR'
                                            -- structure specifying the acceleration structure to retrieve an address
                                            -- for.
                                            AccelerationStructureDeviceAddressInfoKHR
                                         -> io (DeviceAddress)
getAccelerationStructureDeviceAddressKHR :: Device
-> AccelerationStructureDeviceAddressInfoKHR
-> io ("dataSize" ::: Word64)
getAccelerationStructureDeviceAddressKHR device :: Device
device info :: AccelerationStructureDeviceAddressInfoKHR
info = IO ("dataSize" ::: Word64) -> io ("dataSize" ::: Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("dataSize" ::: Word64) -> io ("dataSize" ::: Word64))
-> (ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
    -> IO ("dataSize" ::: Word64))
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
-> io ("dataSize" ::: Word64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
-> IO ("dataSize" ::: Word64)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
 -> io ("dataSize" ::: Word64))
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
-> io ("dataSize" ::: Word64)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetAccelerationStructureDeviceAddressKHRPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
vkGetAccelerationStructureDeviceAddressKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
      -> IO ("dataSize" ::: Word64))
pVkGetAccelerationStructureDeviceAddressKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT ("dataSize" ::: Word64) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("dataSize" ::: Word64) IO ())
-> IO () -> ContT ("dataSize" ::: Word64) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
vkGetAccelerationStructureDeviceAddressKHRPtr FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
      -> IO ("dataSize" ::: Word64))
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetAccelerationStructureDeviceAddressKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetAccelerationStructureDeviceAddressKHR' :: Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> IO ("dataSize" ::: Word64)
vkGetAccelerationStructureDeviceAddressKHR' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
-> Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> IO ("dataSize" ::: Word64)
mkVkGetAccelerationStructureDeviceAddressKHR FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
vkGetAccelerationStructureDeviceAddressKHRPtr
  "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
pInfo <- ((("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
  -> IO ("dataSize" ::: Word64))
 -> IO ("dataSize" ::: Word64))
-> ContT
     ("dataSize" ::: Word64)
     IO
     ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
   -> IO ("dataSize" ::: Word64))
  -> IO ("dataSize" ::: Word64))
 -> ContT
      ("dataSize" ::: Word64)
      IO
      ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR))
-> ((("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
     -> IO ("dataSize" ::: Word64))
    -> IO ("dataSize" ::: Word64))
-> ContT
     ("dataSize" ::: Word64)
     IO
     ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureDeviceAddressInfoKHR
-> (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
    -> IO ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureDeviceAddressInfoKHR
info)
  "dataSize" ::: Word64
r <- IO ("dataSize" ::: Word64)
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("dataSize" ::: Word64)
 -> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
forall a b. (a -> b) -> a -> b
$ String -> IO ("dataSize" ::: Word64) -> IO ("dataSize" ::: Word64)
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetAccelerationStructureDeviceAddressKHR" (Ptr Device_T
-> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> IO ("dataSize" ::: Word64)
vkGetAccelerationStructureDeviceAddressKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
pInfo)
  ("dataSize" ::: Word64)
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("dataSize" ::: Word64)
 -> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64)
-> ContT ("dataSize" ::: Word64) IO ("dataSize" ::: Word64)
forall a b. (a -> b) -> a -> b
$ ("dataSize" ::: Word64
r)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetAccelerationStructureBuildSizesKHR
  :: FunPtr (Ptr Device_T -> AccelerationStructureBuildTypeKHR -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr Word32 -> Ptr AccelerationStructureBuildSizesInfoKHR -> IO ()) -> Ptr Device_T -> AccelerationStructureBuildTypeKHR -> Ptr AccelerationStructureBuildGeometryInfoKHR -> Ptr Word32 -> Ptr AccelerationStructureBuildSizesInfoKHR -> IO ()

-- | vkGetAccelerationStructureBuildSizesKHR - Retrieve the required size for
-- an acceleration structure
--
-- = Description
--
-- The @srcAccelerationStructure@, @dstAccelerationStructure@, and @mode@
-- members of @pBuildInfo@ are ignored. Any 'DeviceOrHostAddressKHR'
-- members of @pBuildInfo@ are ignored by this command, except that the
-- @hostAddress@ member of
-- 'AccelerationStructureGeometryTrianglesDataKHR'::@transformData@ will be
-- examined to check if it is @NULL@.
--
-- An acceleration structure created with the @accelerationStructureSize@
-- returned by this command supports any build or update with a
-- 'AccelerationStructureBuildGeometryInfoKHR' structure and array of
-- 'AccelerationStructureBuildRangeInfoKHR' structures subject to the
-- following properties:
--
-- -   The build command is a host build command, and @buildType@ is
--     'ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR' or
--     'ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR'
--
-- -   The build command is a device build command, and @buildType@ is
--     'ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR' or
--     'ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR'
--
-- -   For 'AccelerationStructureBuildGeometryInfoKHR':
--
--     -   Its @type@, and @flags@ members are equal to those specified in
--         @pBuildInfo@.
--
--     -   @geometryCount@ is less than or equal to that specified in
--         @pBuildInfo@.
--
--     -   For each element of either @pGeometries@ or @ppGeometries@ at a
--         given index, its @geometryType@ member is equal to that
--         specified in @pBuildInfo@.
--
--     -   For each element of either @pGeometries@ or @ppGeometries@ at a
--         given index, with a @geometryType@ member equal to
--         'GEOMETRY_TYPE_TRIANGLES_KHR', the @vertexFormat@ and
--         @indexType@ members of @geometry.triangles@ are equal to those
--         specified in the same element in @pBuildInfo@.
--
--     -   For each element of either @pGeometries@ or @ppGeometries@ at a
--         given index, with a @geometryType@ member equal to
--         'GEOMETRY_TYPE_TRIANGLES_KHR', the @maxVertex@ member of
--         @geometry.triangles@ is less than or equal to that specified in
--         the same element in @pBuildInfo@.
--
--     -   For each element of either @pGeometries@ or @ppGeometries@ at a
--         given index, with a @geometryType@ member equal to
--         'GEOMETRY_TYPE_TRIANGLES_KHR', if the applicable address in the
--         @transformData@ member of @geometry.triangles@ is not @NULL@,
--         the corresponding @transformData.pname@:hostAddress parameter in
--         @pBuildInfo@ is not @NULL@.
--
-- -   For each 'AccelerationStructureBuildRangeInfoKHR' corresponding to
--     the 'AccelerationStructureBuildGeometryInfoKHR':
--
--     -   Its @primitiveCount@ member is less than or equal to the
--         corresponding element of @pMaxPrimitiveCounts@.
--
-- Similarly, the @updateScratchSize@ value will support any build command
-- specifying the 'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' @mode@
-- under the above conditions, and the @buildScratchSize@ value will
-- support any build command specifying the
-- 'BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR' @mode@ under the above
-- conditions.
--
-- == Valid Usage
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-rayTracingPipeline-03617#
--     The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayTracingPipeline rayTracingPipeline>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayQuery rayQuery>
--     feature /must/ be enabled
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-device-03618# If
--     @device@ was created with multiple physical devices, then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-03619# If
--     @pBuildInfo->geometryCount@ is not @0@, @pMaxPrimitiveCounts@ /must/
--     be a valid pointer to an array of @pBuildInfo->geometryCount@
--     @uint32_t@ values
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-03785# If
--     @pBuildInfo->pGeometries@ or @pBuildInfo->ppGeometries@ has a
--     @geometryType@ of 'GEOMETRY_TYPE_INSTANCES_KHR', each
--     @pMaxPrimitiveCounts@[i] /must/ be less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxInstanceCount@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-buildType-parameter#
--     @buildType@ /must/ be a valid 'AccelerationStructureBuildTypeKHR'
--     value
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-parameter#
--     @pBuildInfo@ /must/ be a valid pointer to a valid
--     'AccelerationStructureBuildGeometryInfoKHR' structure
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-pMaxPrimitiveCounts-parameter#
--     @pMaxPrimitiveCounts@ /must/ be a valid pointer to an array of
--     @pBuildInfo->geometryCount@ @uint32_t@ values
--
-- -   #VUID-vkGetAccelerationStructureBuildSizesKHR-pSizeInfo-parameter#
--     @pSizeInfo@ /must/ be a valid pointer to a
--     'AccelerationStructureBuildSizesInfoKHR' structure
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureBuildSizesInfoKHR',
-- 'AccelerationStructureBuildTypeKHR', 'Vulkan.Core10.Handles.Device'
getAccelerationStructureBuildSizesKHR :: forall io
                                       . (MonadIO io)
                                      => -- | @device@ is the logical device that will be used for creating the
                                         -- acceleration structure.
                                         Device
                                      -> -- | @buildType@ defines whether host or device operations (or both) are
                                         -- being queried for.
                                         AccelerationStructureBuildTypeKHR
                                      -> -- | @pBuildInfo@ is a pointer to a
                                         -- 'AccelerationStructureBuildGeometryInfoKHR' structure describing
                                         -- parameters of a build operation.
                                         ("buildInfo" ::: AccelerationStructureBuildGeometryInfoKHR)
                                      -> -- | @pMaxPrimitiveCounts@ is a pointer to an array of
                                         -- @pBuildInfo->geometryCount@ @uint32_t@ values defining the number of
                                         -- primitives built into each geometry.
                                         ("maxPrimitiveCounts" ::: Vector Word32)
                                      -> io (("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
getAccelerationStructureBuildSizesKHR :: Device
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildGeometryInfoKHR
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
-> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
getAccelerationStructureBuildSizesKHR device :: Device
device buildType :: AccelerationStructureBuildTypeKHR
buildType buildInfo :: AccelerationStructureBuildGeometryInfoKHR
buildInfo maxPrimitiveCounts :: "indirectStrides" ::: Vector ("firstQuery" ::: Word32)
maxPrimitiveCounts = IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> (ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
      IO
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
    -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
  IO
  ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
   IO
   ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> io ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetAccelerationStructureBuildSizesKHRPtr :: FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
vkGetAccelerationStructureBuildSizesKHRPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureBuildTypeKHR
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
      -> ("pSizeInfo"
          ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
      -> IO ())
pVkGetAccelerationStructureBuildSizesKHR (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ())
-> IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
vkGetAccelerationStructureBuildSizesKHRPtr FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> AccelerationStructureBuildTypeKHR
      -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
      -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
      -> ("pSizeInfo"
          ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetAccelerationStructureBuildSizesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetAccelerationStructureBuildSizesKHR' :: Ptr Device_T
-> AccelerationStructureBuildTypeKHR
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("pSizeInfo"
    ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ()
vkGetAccelerationStructureBuildSizesKHR' = FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
-> Ptr Device_T
-> AccelerationStructureBuildTypeKHR
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("pSizeInfo"
    ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ()
mkVkGetAccelerationStructureBuildSizesKHR FunPtr
  (Ptr Device_T
   -> AccelerationStructureBuildTypeKHR
   -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> ("pSizeInfo"
       ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
   -> IO ())
vkGetAccelerationStructureBuildSizesKHRPtr
  "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pBuildInfo <- ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
  -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
   -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
  -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
      IO
      ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR))
-> ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
     -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
    -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
forall a b. (a -> b) -> a -> b
$ AccelerationStructureBuildGeometryInfoKHR
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AccelerationStructureBuildGeometryInfoKHR
buildInfo)
  "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPMaxPrimitiveCounts <- ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
  -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
   -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
  -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
      IO
      ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)))
-> ((("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
     -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
    -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
    -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((("indirectStrides" ::: Vector ("firstQuery" ::: Word32)) -> Int
forall a. Vector a -> Int
Data.Vector.length ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
maxPrimitiveCounts)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
  IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ())
-> IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("firstQuery" ::: Word32) -> IO ())
-> ("indirectStrides" ::: Vector ("firstQuery" ::: Word32))
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "firstQuery" ::: Word32
e -> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPMaxPrimitiveCounts ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("firstQuery" ::: Word32
e)) ("indirectStrides" ::: Vector ("firstQuery" ::: Word32)
maxPrimitiveCounts)
  "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
pPSizeInfo <- ((("pSizeInfo"
   ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
  -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("pSizeInfo"
      ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct
  ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) =>
(("pSizeInfo"
  ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
 -> IO b)
-> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @AccelerationStructureBuildSizesInfoKHR)
  IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ())
-> IO ()
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetAccelerationStructureBuildSizesKHR" (Ptr Device_T
-> AccelerationStructureBuildTypeKHR
-> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("pSizeInfo"
    ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ()
vkGetAccelerationStructureBuildSizesKHR' (Device -> Ptr Device_T
deviceHandle (Device
device)) (AccelerationStructureBuildTypeKHR
buildType) "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
pBuildInfo ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
pPMaxPrimitiveCounts) ("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
pPSizeInfo))
  "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
pSizeInfo <- IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
      IO
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. (a -> b) -> a -> b
$ ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AccelerationStructureBuildSizesInfoKHR "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
pPSizeInfo
  ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> ContT
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
      IO
      ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ContT
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
     IO
     ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. (a -> b) -> a -> b
$ ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
pSizeInfo)


-- | VkWriteDescriptorSetAccelerationStructureKHR - Structure specifying
-- acceleration structure descriptor info
--
-- == Valid Usage
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureKHR-accelerationStructureCount-02236#
--     @accelerationStructureCount@ /must/ be equal to @descriptorCount@ in
--     the extended structure
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03579#
--     Each acceleration structure in @pAccelerationStructures@ /must/ have
--     been created with 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR' or
--     'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' and built with
--     'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR'
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03580#
--     If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-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-VkWriteDescriptorSetAccelerationStructureKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR'
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-parameter#
--     @pAccelerationStructures@ /must/ be a valid pointer to an array of
--     @accelerationStructureCount@ valid or
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handles
--
-- -   #VUID-VkWriteDescriptorSetAccelerationStructureKHR-accelerationStructureCount-arraylength#
--     @accelerationStructureCount@ /must/ be greater than @0@
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data WriteDescriptorSetAccelerationStructureKHR = WriteDescriptorSetAccelerationStructureKHR
  { -- | @pAccelerationStructures@ are the acceleration structures to update.
    WriteDescriptorSetAccelerationStructureKHR
-> "accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures :: Vector AccelerationStructureKHR }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (WriteDescriptorSetAccelerationStructureKHR)
#endif
deriving instance Show WriteDescriptorSetAccelerationStructureKHR

instance ToCStruct WriteDescriptorSetAccelerationStructureKHR where
  withCStruct :: WriteDescriptorSetAccelerationStructureKHR
-> (Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b) -> IO b
withCStruct x :: WriteDescriptorSetAccelerationStructureKHR
x f :: Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b
f = Int
-> Int
-> (Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b) -> IO b)
-> (Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr WriteDescriptorSetAccelerationStructureKHR
p -> Ptr WriteDescriptorSetAccelerationStructureKHR
-> WriteDescriptorSetAccelerationStructureKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr WriteDescriptorSetAccelerationStructureKHR
p WriteDescriptorSetAccelerationStructureKHR
x (Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b
f Ptr WriteDescriptorSetAccelerationStructureKHR
p)
  pokeCStruct :: Ptr WriteDescriptorSetAccelerationStructureKHR
-> WriteDescriptorSetAccelerationStructureKHR -> IO b -> IO b
pokeCStruct p :: Ptr WriteDescriptorSetAccelerationStructureKHR
p WriteDescriptorSetAccelerationStructureKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ((Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length (("accelerationStructures" ::: Vector AccelerationStructureKHR)
 -> Int)
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a b. (a -> b) -> a -> b
$ ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) :: Word32))
    "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures' <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
  -> IO b)
 -> IO b)
-> ContT
     b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO b)
  -> IO b)
 -> ContT
      b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
     -> IO b)
    -> IO b)
-> ContT
     b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures' ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
accelerationStructures)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int
-> Ptr ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr AccelerationStructureKHR))) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr WriteDescriptorSetAccelerationStructureKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr WriteDescriptorSetAccelerationStructureKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures' <- ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
  -> IO b)
 -> IO b)
-> ContT
     b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
   -> IO b)
  -> IO b)
 -> ContT
      b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR))
-> ((("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
     -> IO b)
    -> IO b)
-> ContT
     b IO ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureKHR ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> AccelerationStructureKHR -> IO ())
-> ("accelerationStructures" ::: Vector AccelerationStructureKHR)
-> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureKHR
e -> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures' ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureKHR) (AccelerationStructureKHR
e)) ("accelerationStructures" ::: Vector AccelerationStructureKHR
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetAccelerationStructureKHR
p Ptr WriteDescriptorSetAccelerationStructureKHR
-> Int
-> Ptr ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr AccelerationStructureKHR))) ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR
pPAccelerationStructures')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

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

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


-- | VkPhysicalDeviceAccelerationStructureFeaturesKHR - Structure describing
-- the acceleration structure features that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceAccelerationStructureFeaturesKHR'
-- structure describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceAccelerationStructureFeaturesKHR' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether the feature is supported.
-- 'PhysicalDeviceAccelerationStructureFeaturesKHR' /can/ also be used in
-- the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable
-- the features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceAccelerationStructureFeaturesKHR = PhysicalDeviceAccelerationStructureFeaturesKHR
  { -- | #features-accelerationStructure# @accelerationStructure@ indicates
    -- whether the implementation supports the acceleration structure
    -- functionality. See
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#acceleration-structure Acceleration Structures>.
    PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
accelerationStructure :: Bool
  , -- | #features-accelerationStructureCaptureReplay#
    -- @accelerationStructureCaptureReplay@ indicates whether the
    -- implementation supports saving and reusing acceleration structure device
    -- addresses, e.g. for trace capture and replay.
    PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
accelerationStructureCaptureReplay :: Bool
  , -- | #features-accelerationStructureIndirectBuild#
    -- @accelerationStructureIndirectBuild@ indicates whether the
    -- implementation supports indirect acceleration structure build commands,
    -- e.g. 'cmdBuildAccelerationStructuresIndirectKHR'.
    PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
accelerationStructureIndirectBuild :: Bool
  , -- | #features-accelerationStructureHostCommands#
    -- @accelerationStructureHostCommands@ indicates whether the implementation
    -- supports host side acceleration structure commands, e.g.
    -- 'buildAccelerationStructuresKHR', 'copyAccelerationStructureKHR',
    -- 'copyAccelerationStructureToMemoryKHR',
    -- 'copyMemoryToAccelerationStructureKHR',
    -- 'writeAccelerationStructuresPropertiesKHR'.
    PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
accelerationStructureHostCommands :: Bool
  , -- | #features-descriptorBindingAccelerationStructureUpdateAfterBind#
    -- @descriptorBindingAccelerationStructureUpdateAfterBind@ indicates
    -- whether the implementation supports updating acceleration structure
    -- descriptors after a set is bound. If this feature is not enabled,
    -- 'Vulkan.Core12.Enums.DescriptorBindingFlagBits.DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT'
    -- /must/ not be used with
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR'.
    PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
descriptorBindingAccelerationStructureUpdateAfterBind :: Bool
  }
  deriving (Typeable, PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
(PhysicalDeviceAccelerationStructureFeaturesKHR
 -> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool)
-> (PhysicalDeviceAccelerationStructureFeaturesKHR
    -> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool)
-> Eq PhysicalDeviceAccelerationStructureFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
$c/= :: PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
== :: PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
$c== :: PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceAccelerationStructureFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceAccelerationStructureFeaturesKHR

instance ToCStruct PhysicalDeviceAccelerationStructureFeaturesKHR where
  withCStruct :: PhysicalDeviceAccelerationStructureFeaturesKHR
-> (Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceAccelerationStructureFeaturesKHR
x f :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p -> Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p PhysicalDeviceAccelerationStructureFeaturesKHR
x (Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b
f Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p)
  pokeCStruct :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p PhysicalDeviceAccelerationStructureFeaturesKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
accelerationStructure))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
accelerationStructureCaptureReplay))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
accelerationStructureIndirectBuild))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
accelerationStructureHostCommands))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
descriptorBindingAccelerationStructureUpdateAfterBind))
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceAccelerationStructureFeaturesKHR where
  peekCStruct :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> IO PhysicalDeviceAccelerationStructureFeaturesKHR
peekCStruct p :: Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p = do
    Bool32
accelerationStructure <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    Bool32
accelerationStructureCaptureReplay <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32))
    Bool32
accelerationStructureIndirectBuild <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32))
    Bool32
accelerationStructureHostCommands <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Bool32))
    Bool32
descriptorBindingAccelerationStructureUpdateAfterBind <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
p Ptr PhysicalDeviceAccelerationStructureFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32))
    PhysicalDeviceAccelerationStructureFeaturesKHR
-> IO PhysicalDeviceAccelerationStructureFeaturesKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceAccelerationStructureFeaturesKHR
 -> IO PhysicalDeviceAccelerationStructureFeaturesKHR)
-> PhysicalDeviceAccelerationStructureFeaturesKHR
-> IO PhysicalDeviceAccelerationStructureFeaturesKHR
forall a b. (a -> b) -> a -> b
$ Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceAccelerationStructureFeaturesKHR
PhysicalDeviceAccelerationStructureFeaturesKHR
             (Bool32 -> Bool
bool32ToBool Bool32
accelerationStructure) (Bool32 -> Bool
bool32ToBool Bool32
accelerationStructureCaptureReplay) (Bool32 -> Bool
bool32ToBool Bool32
accelerationStructureIndirectBuild) (Bool32 -> Bool
bool32ToBool Bool32
accelerationStructureHostCommands) (Bool32 -> Bool
bool32ToBool Bool32
descriptorBindingAccelerationStructureUpdateAfterBind)

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

instance Zero PhysicalDeviceAccelerationStructureFeaturesKHR where
  zero :: PhysicalDeviceAccelerationStructureFeaturesKHR
zero = Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceAccelerationStructureFeaturesKHR
PhysicalDeviceAccelerationStructureFeaturesKHR
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceAccelerationStructurePropertiesKHR - Properties of the
-- physical device for acceleration structure
--
-- = Description
--
-- If the 'PhysicalDeviceAccelerationStructurePropertiesKHR' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2',
-- it is filled with the implementation-dependent limits.
--
-- Limits specified by this structure /must/ match those specified with the
-- same name in
-- 'Vulkan.Extensions.VK_NV_ray_tracing.PhysicalDeviceRayTracingPropertiesNV'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceAccelerationStructurePropertiesKHR = PhysicalDeviceAccelerationStructurePropertiesKHR
  { -- | @maxGeometryCount@ is the maximum number of geometries in the bottom
    -- level acceleration structure.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "dataSize" ::: Word64
maxGeometryCount :: Word64
  , -- | @maxInstanceCount@ is the maximum number of instances in the top level
    -- acceleration structure.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "dataSize" ::: Word64
maxInstanceCount :: Word64
  , -- | @maxPrimitiveCount@ is the maximum number of triangles or AABBs in all
    -- geometries in the bottom level acceleration structure.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "dataSize" ::: Word64
maxPrimitiveCount :: Word64
  , -- | #limits-maxPerStageDescriptorAccelerationStructures#
    -- @maxPerStageDescriptorAccelerationStructures@ is the maximum number of
    -- acceleration structure bindings that /can/ be accessible to a single
    -- shader stage in a pipeline layout. Descriptor bindings with a descriptor
    -- type of
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR'
    -- count against this limit. Only descriptor bindings in descriptor set
    -- layouts created without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set count against this limit.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "firstQuery" ::: Word32
maxPerStageDescriptorAccelerationStructures :: Word32
  , -- | #limits-maxPerStageDescriptorUpdateAfterBindAccelerationStructures#
    -- @maxPerStageDescriptorUpdateAfterBindAccelerationStructures@ is similar
    -- to @maxPerStageDescriptorAccelerationStructures@ but counts descriptor
    -- bindings from descriptor sets created with or without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "firstQuery" ::: Word32
maxPerStageDescriptorUpdateAfterBindAccelerationStructures :: Word32
  , -- | #limits-maxDescriptorSetAccelerationStructures#
    -- @maxDescriptorSetAccelerationStructures@ is the maximum number of
    -- acceleration structure descriptors that /can/ be included in descriptor
    -- bindings in a pipeline layout across all pipeline shader stages and
    -- descriptor set numbers. Descriptor bindings with a descriptor type of
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR'
    -- count against this limit. Only descriptor bindings in descriptor set
    -- layouts created without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set count against this limit.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "firstQuery" ::: Word32
maxDescriptorSetAccelerationStructures :: Word32
  , -- | #limits-maxDescriptorSetUpdateAfterBindAccelerationStructures#
    -- @maxDescriptorSetUpdateAfterBindAccelerationStructures@ is similar to
    -- @maxDescriptorSetAccelerationStructures@ but counts descriptor bindings
    -- from descriptor sets created with or without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "firstQuery" ::: Word32
maxDescriptorSetUpdateAfterBindAccelerationStructures :: Word32
  , -- | #limits-minAccelerationStructureScratchOffsetAlignment#
    -- @minAccelerationStructureScratchOffsetAlignment@ is the minimum
    -- /required/ alignment, in bytes, for scratch data passed in to an
    -- acceleration structure build command.
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> "firstQuery" ::: Word32
minAccelerationStructureScratchOffsetAlignment :: Word32
  }
  deriving (Typeable, PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool
(PhysicalDeviceAccelerationStructurePropertiesKHR
 -> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool)
-> (PhysicalDeviceAccelerationStructurePropertiesKHR
    -> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool)
-> Eq PhysicalDeviceAccelerationStructurePropertiesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool
$c/= :: PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool
== :: PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool
$c== :: PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceAccelerationStructurePropertiesKHR)
#endif
deriving instance Show PhysicalDeviceAccelerationStructurePropertiesKHR

instance ToCStruct PhysicalDeviceAccelerationStructurePropertiesKHR where
  withCStruct :: PhysicalDeviceAccelerationStructurePropertiesKHR
-> (Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceAccelerationStructurePropertiesKHR
x f :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p -> Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p PhysicalDeviceAccelerationStructurePropertiesKHR
x (Ptr PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b
f Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p)
  pokeCStruct :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> PhysicalDeviceAccelerationStructurePropertiesKHR -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p PhysicalDeviceAccelerationStructurePropertiesKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word64)) ("dataSize" ::: Word64
maxGeometryCount)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word64)) ("dataSize" ::: Word64
maxInstanceCount)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word64)) ("dataSize" ::: Word64
maxPrimitiveCount)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("firstQuery" ::: Word32
maxPerStageDescriptorAccelerationStructures)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("firstQuery" ::: Word32
maxPerStageDescriptorUpdateAfterBindAccelerationStructures)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ("firstQuery" ::: Word32
maxDescriptorSetAccelerationStructures)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) ("firstQuery" ::: Word32
maxDescriptorSetUpdateAfterBindAccelerationStructures)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) ("firstQuery" ::: Word32
minAccelerationStructureScratchOffsetAlignment)
    IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word64)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word64)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word64)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceAccelerationStructurePropertiesKHR where
  peekCStruct :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> IO PhysicalDeviceAccelerationStructurePropertiesKHR
peekCStruct p :: Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p = do
    "dataSize" ::: Word64
maxGeometryCount <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word64))
    "dataSize" ::: Word64
maxInstanceCount <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word64))
    "dataSize" ::: Word64
maxPrimitiveCount <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word64))
    "firstQuery" ::: Word32
maxPerStageDescriptorAccelerationStructures <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    "firstQuery" ::: Word32
maxPerStageDescriptorUpdateAfterBindAccelerationStructures <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    "firstQuery" ::: Word32
maxDescriptorSetAccelerationStructures <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
    "firstQuery" ::: Word32
maxDescriptorSetUpdateAfterBindAccelerationStructures <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32))
    "firstQuery" ::: Word32
minAccelerationStructureScratchOffsetAlignment <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
p Ptr PhysicalDeviceAccelerationStructurePropertiesKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32))
    PhysicalDeviceAccelerationStructurePropertiesKHR
-> IO PhysicalDeviceAccelerationStructurePropertiesKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceAccelerationStructurePropertiesKHR
 -> IO PhysicalDeviceAccelerationStructurePropertiesKHR)
-> PhysicalDeviceAccelerationStructurePropertiesKHR
-> IO PhysicalDeviceAccelerationStructurePropertiesKHR
forall a b. (a -> b) -> a -> b
$ ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> PhysicalDeviceAccelerationStructurePropertiesKHR
PhysicalDeviceAccelerationStructurePropertiesKHR
             "dataSize" ::: Word64
maxGeometryCount "dataSize" ::: Word64
maxInstanceCount "dataSize" ::: Word64
maxPrimitiveCount "firstQuery" ::: Word32
maxPerStageDescriptorAccelerationStructures "firstQuery" ::: Word32
maxPerStageDescriptorUpdateAfterBindAccelerationStructures "firstQuery" ::: Word32
maxDescriptorSetAccelerationStructures "firstQuery" ::: Word32
maxDescriptorSetUpdateAfterBindAccelerationStructures "firstQuery" ::: Word32
minAccelerationStructureScratchOffsetAlignment

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

instance Zero PhysicalDeviceAccelerationStructurePropertiesKHR where
  zero :: PhysicalDeviceAccelerationStructurePropertiesKHR
zero = ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> PhysicalDeviceAccelerationStructurePropertiesKHR
PhysicalDeviceAccelerationStructurePropertiesKHR
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero


-- | VkAccelerationStructureGeometryTrianglesDataKHR - Structure specifying a
-- triangle geometry in a bottom-level acceleration structure
--
-- = Description
--
-- Note
--
-- Unlike the stride for vertex buffers in
-- 'Vulkan.Core10.Pipeline.VertexInputBindingDescription' for graphics
-- pipelines which must not exceed @maxVertexInputBindingStride@,
-- @vertexStride@ for acceleration structure geometry is instead restricted
-- to being a 32-bit value.
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-maxVertex-03655#
--     @maxVertex@ /must/ be greater than @0@
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexStride-03735#
--     @vertexStride@ /must/ be a multiple of the size in bytes of the
--     smallest component of @vertexFormat@
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexStride-03819#
--     @vertexStride@ /must/ be less than or equal to 232-1
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexFormat-03797#
--     @vertexFormat@ /must/ support the
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR'
--     in
--     'Vulkan.Core10.DeviceInitialization.FormatProperties'::@bufferFeatures@
--     as returned by
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFormatProperties2'
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexType-03798#
--     @indexType@ /must/ be
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT16',
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT32', or
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR'
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-pNext-pNext#
--     @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexFormat-parameter#
--     @vertexFormat@ /must/ be a valid 'Vulkan.Core10.Enums.Format.Format'
--     value
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexData-parameter#
--     @vertexData@ /must/ be a valid 'DeviceOrHostAddressConstKHR' union
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexType-parameter#
--     @indexType@ /must/ be a valid
--     'Vulkan.Core10.Enums.IndexType.IndexType' value
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexData-parameter#
--     If @indexData@ is not @0@, @indexData@ /must/ be a valid
--     'DeviceOrHostAddressConstKHR' union
--
-- -   #VUID-VkAccelerationStructureGeometryTrianglesDataKHR-transformData-parameter#
--     If @transformData@ is not @0@, @transformData@ /must/ be a valid
--     'DeviceOrHostAddressConstKHR' union
--
-- = See Also
--
-- 'AccelerationStructureGeometryDataKHR', 'DeviceOrHostAddressConstKHR',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Core10.Enums.IndexType.IndexType',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data AccelerationStructureGeometryTrianglesDataKHR = AccelerationStructureGeometryTrianglesDataKHR
  { -- | @vertexFormat@ is the 'Vulkan.Core10.Enums.Format.Format' of each vertex
    -- element.
    AccelerationStructureGeometryTrianglesDataKHR -> Format
vertexFormat :: Format
  , -- | @vertexData@ is a device or host address to memory containing vertex
    -- data for this geometry.
    AccelerationStructureGeometryTrianglesDataKHR
-> DeviceOrHostAddressConstKHR
vertexData :: DeviceOrHostAddressConstKHR
  , -- | @vertexStride@ is the stride in bytes between each vertex.
    AccelerationStructureGeometryTrianglesDataKHR
-> "dataSize" ::: Word64
vertexStride :: DeviceSize
  , -- | @maxVertex@ is the highest index of a vertex that will be addressed by a
    -- build command using this structure.
    AccelerationStructureGeometryTrianglesDataKHR
-> "firstQuery" ::: Word32
maxVertex :: Word32
  , -- | @indexType@ is the 'Vulkan.Core10.Enums.IndexType.IndexType' of each
    -- index element.
    AccelerationStructureGeometryTrianglesDataKHR -> IndexType
indexType :: IndexType
  , -- | @indexData@ is a device or host address to memory containing index data
    -- for this geometry.
    AccelerationStructureGeometryTrianglesDataKHR
-> DeviceOrHostAddressConstKHR
indexData :: DeviceOrHostAddressConstKHR
  , -- | @transformData@ is a device or host address to memory containing an
    -- optional reference to a 'TransformMatrixKHR' structure defining a
    -- transformation that should be applied to vertices in this geometry.
    AccelerationStructureGeometryTrianglesDataKHR
-> DeviceOrHostAddressConstKHR
transformData :: DeviceOrHostAddressConstKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureGeometryTrianglesDataKHR)
#endif
deriving instance Show AccelerationStructureGeometryTrianglesDataKHR

instance ToCStruct AccelerationStructureGeometryTrianglesDataKHR where
  withCStruct :: AccelerationStructureGeometryTrianglesDataKHR
-> (Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b)
-> IO b
withCStruct x :: AccelerationStructureGeometryTrianglesDataKHR
x f :: Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b
f = Int
-> Int
-> (Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b)
 -> IO b)
-> (Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureGeometryTrianglesDataKHR
p -> Ptr AccelerationStructureGeometryTrianglesDataKHR
-> AccelerationStructureGeometryTrianglesDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureGeometryTrianglesDataKHR
p AccelerationStructureGeometryTrianglesDataKHR
x (Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b
f Ptr AccelerationStructureGeometryTrianglesDataKHR
p)
  pokeCStruct :: Ptr AccelerationStructureGeometryTrianglesDataKHR
-> AccelerationStructureGeometryTrianglesDataKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureGeometryTrianglesDataKHR
p AccelerationStructureGeometryTrianglesDataKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Format)) (Format
vertexFormat)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
vertexData) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
vertexStride)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("firstQuery" ::: Word32
maxVertex)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr IndexType)) (IndexType
indexType)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
indexData) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
transformData) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryTrianglesDataKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureGeometryTrianglesDataKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryTrianglesDataKHR
p Ptr AccelerationStructureGeometryTrianglesDataKHR
-> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr IndexType)) (IndexType
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero AccelerationStructureGeometryTrianglesDataKHR where
  zero :: AccelerationStructureGeometryTrianglesDataKHR
zero = Format
-> DeviceOrHostAddressConstKHR
-> ("dataSize" ::: Word64)
-> ("firstQuery" ::: Word32)
-> IndexType
-> DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR
-> AccelerationStructureGeometryTrianglesDataKHR
AccelerationStructureGeometryTrianglesDataKHR
           Format
forall a. Zero a => a
zero
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           IndexType
forall a. Zero a => a
zero
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureGeometryAabbsDataKHR - Structure specifying
-- axis-aligned bounding box geometry in a bottom-level acceleration
-- structure
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'AccelerationStructureGeometryDataKHR', 'DeviceOrHostAddressConstKHR',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data AccelerationStructureGeometryAabbsDataKHR = AccelerationStructureGeometryAabbsDataKHR
  { -- | @data@ is a device or host address to memory containing
    -- 'AabbPositionsKHR' structures containing position data for each
    -- axis-aligned bounding box in the geometry.
    --
    -- #VUID-VkAccelerationStructureGeometryAabbsDataKHR-data-parameter# @data@
    -- /must/ be a valid 'DeviceOrHostAddressConstKHR' union
    AccelerationStructureGeometryAabbsDataKHR
-> DeviceOrHostAddressConstKHR
data' :: DeviceOrHostAddressConstKHR
  , -- | @stride@ is the stride in bytes between each entry in @data@. The stride
    -- /must/ be a multiple of @8@.
    --
    -- #VUID-VkAccelerationStructureGeometryAabbsDataKHR-stride-03545# @stride@
    -- /must/ be a multiple of @8@
    --
    -- #VUID-VkAccelerationStructureGeometryAabbsDataKHR-stride-03820# @stride@
    -- /must/ be less than or equal to 232-1
    AccelerationStructureGeometryAabbsDataKHR -> "dataSize" ::: Word64
stride :: DeviceSize
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureGeometryAabbsDataKHR)
#endif
deriving instance Show AccelerationStructureGeometryAabbsDataKHR

instance ToCStruct AccelerationStructureGeometryAabbsDataKHR where
  withCStruct :: AccelerationStructureGeometryAabbsDataKHR
-> (Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b) -> IO b
withCStruct x :: AccelerationStructureGeometryAabbsDataKHR
x f :: Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b
f = Int
-> Int
-> (Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b) -> IO b)
-> (Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureGeometryAabbsDataKHR
p -> Ptr AccelerationStructureGeometryAabbsDataKHR
-> AccelerationStructureGeometryAabbsDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureGeometryAabbsDataKHR
p AccelerationStructureGeometryAabbsDataKHR
x (Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b
f Ptr AccelerationStructureGeometryAabbsDataKHR
p)
  pokeCStruct :: Ptr AccelerationStructureGeometryAabbsDataKHR
-> AccelerationStructureGeometryAabbsDataKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureGeometryAabbsDataKHR
p AccelerationStructureGeometryAabbsDataKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
data') (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) ("dataSize" ::: Word64
stride)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryAabbsDataKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureGeometryAabbsDataKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryAabbsDataKHR
p Ptr AccelerationStructureGeometryAabbsDataKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero AccelerationStructureGeometryAabbsDataKHR where
  zero :: AccelerationStructureGeometryAabbsDataKHR
zero = DeviceOrHostAddressConstKHR
-> ("dataSize" ::: Word64)
-> AccelerationStructureGeometryAabbsDataKHR
AccelerationStructureGeometryAabbsDataKHR
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero


-- | VkAccelerationStructureGeometryInstancesDataKHR - Structure specifying a
-- geometry consisting of instances of other acceleration structures
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'AccelerationStructureGeometryDataKHR',
-- 'Vulkan.Core10.FundamentalTypes.Bool32', 'DeviceOrHostAddressConstKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data AccelerationStructureGeometryInstancesDataKHR = AccelerationStructureGeometryInstancesDataKHR
  { -- | @arrayOfPointers@ specifies whether @data@ is used as an array of
    -- addresses or just an array.
    AccelerationStructureGeometryInstancesDataKHR -> Bool
arrayOfPointers :: Bool
  , -- | @data@ is either the address of an array of device or host addresses
    -- referencing individual 'AccelerationStructureInstanceKHR' structures if
    -- @arrayOfPointers@ is 'Vulkan.Core10.FundamentalTypes.TRUE', or the
    -- address of an array of 'AccelerationStructureInstanceKHR' structures.
    --
    -- #VUID-VkAccelerationStructureGeometryInstancesDataKHR-data-parameter#
    -- @data@ /must/ be a valid 'DeviceOrHostAddressConstKHR' union
    AccelerationStructureGeometryInstancesDataKHR
-> DeviceOrHostAddressConstKHR
data' :: DeviceOrHostAddressConstKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureGeometryInstancesDataKHR)
#endif
deriving instance Show AccelerationStructureGeometryInstancesDataKHR

instance ToCStruct AccelerationStructureGeometryInstancesDataKHR where
  withCStruct :: AccelerationStructureGeometryInstancesDataKHR
-> (Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b)
-> IO b
withCStruct x :: AccelerationStructureGeometryInstancesDataKHR
x f :: Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b
f = Int
-> Int
-> (Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b)
 -> IO b)
-> (Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureGeometryInstancesDataKHR
p -> Ptr AccelerationStructureGeometryInstancesDataKHR
-> AccelerationStructureGeometryInstancesDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureGeometryInstancesDataKHR
p AccelerationStructureGeometryInstancesDataKHR
x (Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b
f Ptr AccelerationStructureGeometryInstancesDataKHR
p)
  pokeCStruct :: Ptr AccelerationStructureGeometryInstancesDataKHR
-> AccelerationStructureGeometryInstancesDataKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureGeometryInstancesDataKHR
p AccelerationStructureGeometryInstancesDataKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
arrayOfPointers))
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
data') (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryInstancesDataKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureGeometryInstancesDataKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryInstancesDataKHR
p Ptr AccelerationStructureGeometryInstancesDataKHR
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero AccelerationStructureGeometryInstancesDataKHR where
  zero :: AccelerationStructureGeometryInstancesDataKHR
zero = Bool
-> DeviceOrHostAddressConstKHR
-> AccelerationStructureGeometryInstancesDataKHR
AccelerationStructureGeometryInstancesDataKHR
           Bool
forall a. Zero a => a
zero
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureGeometryKHR - Structure specifying geometries to
-- be built into an acceleration structure
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-geometryType-03541# If
--     @geometryType@ is 'GEOMETRY_TYPE_AABBS_KHR', the @aabbs@ member of
--     @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryAabbsDataKHR' structure
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-geometryType-03542# If
--     @geometryType@ is 'GEOMETRY_TYPE_TRIANGLES_KHR', the @triangles@
--     member of @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryTrianglesDataKHR' structure
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-geometryType-03543# If
--     @geometryType@ is 'GEOMETRY_TYPE_INSTANCES_KHR', the @instances@
--     member of @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryInstancesDataKHR' structure
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR'
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-pNext-pNext# @pNext@ /must/
--     be @NULL@
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter#
--     @geometryType@ /must/ be a valid 'GeometryTypeKHR' value
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-triangles-parameter# If
--     @geometryType@ is 'GEOMETRY_TYPE_TRIANGLES_KHR', the @triangles@
--     member of @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryTrianglesDataKHR' structure
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-aabbs-parameter# If
--     @geometryType@ is 'GEOMETRY_TYPE_AABBS_KHR', the @aabbs@ member of
--     @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryAabbsDataKHR' structure
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-instances-parameter# If
--     @geometryType@ is 'GEOMETRY_TYPE_INSTANCES_KHR', the @instances@
--     member of @geometry@ /must/ be a valid
--     'AccelerationStructureGeometryInstancesDataKHR' structure
--
-- -   #VUID-VkAccelerationStructureGeometryKHR-flags-parameter# @flags@
--     /must/ be a valid combination of 'GeometryFlagBitsKHR' values
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureGeometryDataKHR', 'GeometryFlagsKHR',
-- 'GeometryTypeKHR', 'Vulkan.Core10.Enums.StructureType.StructureType'
data AccelerationStructureGeometryKHR = AccelerationStructureGeometryKHR
  { -- | @geometryType@ describes which type of geometry this
    -- 'AccelerationStructureGeometryKHR' refers to.
    AccelerationStructureGeometryKHR -> GeometryTypeKHR
geometryType :: GeometryTypeKHR
  , -- | @geometry@ is a 'AccelerationStructureGeometryDataKHR' union describing
    -- the geometry data for the relevant geometry type.
    AccelerationStructureGeometryKHR
-> AccelerationStructureGeometryDataKHR
geometry :: AccelerationStructureGeometryDataKHR
  , -- | @flags@ is a bitmask of 'GeometryFlagBitsKHR' values describing
    -- additional properties of how the geometry should be built.
    AccelerationStructureGeometryKHR -> GeometryFlagsKHR
flags :: GeometryFlagsKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureGeometryKHR)
#endif
deriving instance Show AccelerationStructureGeometryKHR

instance ToCStruct AccelerationStructureGeometryKHR where
  withCStruct :: AccelerationStructureGeometryKHR
-> (Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b
withCStruct x :: AccelerationStructureGeometryKHR
x f :: Ptr AccelerationStructureGeometryKHR -> IO b
f = Int
-> Int -> (Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 96 8 ((Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b)
-> (Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureGeometryKHR
p -> Ptr AccelerationStructureGeometryKHR
-> AccelerationStructureGeometryKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureGeometryKHR
p AccelerationStructureGeometryKHR
x (Ptr AccelerationStructureGeometryKHR -> IO b
f Ptr AccelerationStructureGeometryKHR
p)
  pokeCStruct :: Ptr AccelerationStructureGeometryKHR
-> AccelerationStructureGeometryKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureGeometryKHR
p AccelerationStructureGeometryKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr GeometryTypeKHR -> GeometryTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR -> Int -> Ptr GeometryTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr GeometryTypeKHR)) (GeometryTypeKHR
geometryType)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryDataKHR
-> AccelerationStructureGeometryDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR
-> Int -> Ptr AccelerationStructureGeometryDataKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureGeometryDataKHR)) (AccelerationStructureGeometryDataKHR
geometry) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr GeometryFlagsKHR -> GeometryFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR -> Int -> Ptr GeometryFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 88 :: Ptr GeometryFlagsKHR)) (GeometryFlagsKHR
flags)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 96
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureGeometryKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr GeometryTypeKHR -> GeometryTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR -> Int -> Ptr GeometryTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr GeometryTypeKHR)) (GeometryTypeKHR
forall a. Zero a => a
zero)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryDataKHR
-> AccelerationStructureGeometryDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr AccelerationStructureGeometryKHR
p Ptr AccelerationStructureGeometryKHR
-> Int -> Ptr AccelerationStructureGeometryDataKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureGeometryDataKHR)) (AccelerationStructureGeometryDataKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero AccelerationStructureGeometryKHR where
  zero :: AccelerationStructureGeometryKHR
zero = GeometryTypeKHR
-> AccelerationStructureGeometryDataKHR
-> GeometryFlagsKHR
-> AccelerationStructureGeometryKHR
AccelerationStructureGeometryKHR
           GeometryTypeKHR
forall a. Zero a => a
zero
           AccelerationStructureGeometryDataKHR
forall a. Zero a => a
zero
           GeometryFlagsKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureBuildGeometryInfoKHR - Structure specifying the
-- geometry data used to build an acceleration structure
--
-- = Description
--
-- Only one of @pGeometries@ or @ppGeometries@ /can/ be a valid pointer,
-- the other /must/ be @NULL@. Each element of the non-@NULL@ array
-- describes the data used to build each acceleration structure geometry.
--
-- The index of each element of the @pGeometries@ or @ppGeometries@ members
-- of 'AccelerationStructureBuildGeometryInfoKHR' is used as the /geometry
-- index/ during ray traversal. The geometry index is available in ray
-- shaders via the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-builtin-variables-raygeometryindex RayGeometryIndexKHR built-in>,
-- and is
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shader-binding-table-hit-shader-indexing used to determine hit and intersection shaders executed during traversal>.
-- The geometry index is available to ray queries via the
-- @OpRayQueryGetIntersectionGeometryIndexKHR@ instruction.
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03654# @type@
--     /must/ not be 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-pGeometries-03788#
--     Only one of @pGeometries@ or @ppGeometries@ /can/ be a valid
--     pointer, the other /must/ be @NULL@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03789# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR', the
--     @geometryType@ member of elements of either @pGeometries@ or
--     @ppGeometries@ /must/ be 'GEOMETRY_TYPE_INSTANCES_KHR'
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03790# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR',
--     @geometryCount@ /must/ be @1@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03791# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' the
--     @geometryType@ member of elements of either @pGeometries@ or
--     @ppGeometries@ /must/ not be 'GEOMETRY_TYPE_INSTANCES_KHR'
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03792# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' then the
--     @geometryType@ member of each geometry in either @pGeometries@ or
--     @ppGeometries@ /must/ be the same
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03793# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' then
--     @geometryCount@ /must/ be less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxGeometryCount@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03794# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' and the
--     @geometryType@ member of either @pGeometries@ or @ppGeometries@ is
--     'GEOMETRY_TYPE_AABBS_KHR', the total number of AABBs in all
--     geometries /must/ be less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxPrimitiveCount@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03795# If
--     @type@ is 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' and the
--     @geometryType@ member of either @pGeometries@ or @ppGeometries@ is
--     'GEOMETRY_TYPE_TRIANGLES_KHR', the total number of triangles in all
--     geometries /must/ be less than or equal to
--     'PhysicalDeviceAccelerationStructurePropertiesKHR'::@maxPrimitiveCount@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-03796# If
--     @flags@ has the
--     'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR' bit set,
--     then it /must/ not have the
--     'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR' bit set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR'
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext#
--     @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter#
--     @type@ /must/ be a valid 'AccelerationStructureTypeKHR' value
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter#
--     @flags@ /must/ be a valid combination of
--     'BuildAccelerationStructureFlagBitsKHR' values
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-mode-parameter#
--     @mode@ /must/ be a valid 'BuildAccelerationStructureModeKHR' value
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-srcAccelerationStructure-parameter#
--     If @srcAccelerationStructure@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @srcAccelerationStructure@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-dstAccelerationStructure-parameter#
--     If @dstAccelerationStructure@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @dstAccelerationStructure@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-pGeometries-parameter#
--     If @geometryCount@ is not @0@, and @pGeometries@ is not @NULL@,
--     @pGeometries@ /must/ be a valid pointer to an array of
--     @geometryCount@ valid 'AccelerationStructureGeometryKHR' structures
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-ppGeometries-parameter#
--     If @geometryCount@ is not @0@, and @ppGeometries@ is not @NULL@,
--     @ppGeometries@ /must/ be a valid pointer to an array of
--     @geometryCount@ valid pointers to valid
--     'AccelerationStructureGeometryKHR' structures
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-scratchData-parameter#
--     @scratchData@ /must/ be a valid 'DeviceOrHostAddressKHR' union
--
-- -   #VUID-VkAccelerationStructureBuildGeometryInfoKHR-commonparent# Both
--     of @dstAccelerationStructure@, and @srcAccelerationStructure@ that
--     are valid handles of non-ignored parameters /must/ have been
--     created, allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'AccelerationStructureGeometryKHR',
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'AccelerationStructureTypeKHR', 'BuildAccelerationStructureFlagsKHR',
-- 'BuildAccelerationStructureModeKHR', 'DeviceOrHostAddressKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'buildAccelerationStructuresKHR',
-- 'cmdBuildAccelerationStructuresIndirectKHR',
-- 'cmdBuildAccelerationStructuresKHR',
-- 'getAccelerationStructureBuildSizesKHR'
data AccelerationStructureBuildGeometryInfoKHR = AccelerationStructureBuildGeometryInfoKHR
  { -- | @type@ is a 'AccelerationStructureTypeKHR' value specifying the type of
    -- acceleration structure being built.
    AccelerationStructureBuildGeometryInfoKHR
-> AccelerationStructureTypeKHR
type' :: AccelerationStructureTypeKHR
  , -- | @flags@ is a bitmask of 'BuildAccelerationStructureFlagBitsKHR'
    -- specifying additional parameters of the acceleration structure.
    AccelerationStructureBuildGeometryInfoKHR
-> BuildAccelerationStructureFlagsKHR
flags :: BuildAccelerationStructureFlagsKHR
  , -- | @mode@ is a 'BuildAccelerationStructureModeKHR' value specifying the
    -- type of operation to perform.
    AccelerationStructureBuildGeometryInfoKHR
-> BuildAccelerationStructureModeKHR
mode :: BuildAccelerationStructureModeKHR
  , -- | @srcAccelerationStructure@ points to an existing acceleration structure
    -- that is to be used to update the @dst@ acceleration structure when
    -- @mode@ is 'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR'.
    AccelerationStructureBuildGeometryInfoKHR
-> AccelerationStructureKHR
srcAccelerationStructure :: AccelerationStructureKHR
  , -- | @dstAccelerationStructure@ points to the target acceleration structure
    -- for the build.
    AccelerationStructureBuildGeometryInfoKHR
-> AccelerationStructureKHR
dstAccelerationStructure :: AccelerationStructureKHR
  , -- | @geometryCount@ specifies the number of geometries that will be built
    -- into @dstAccelerationStructure@.
    AccelerationStructureBuildGeometryInfoKHR
-> "firstQuery" ::: Word32
geometryCount :: Word32
  , -- | @pGeometries@ is a pointer to an array of
    -- 'AccelerationStructureGeometryKHR' structures.
    AccelerationStructureBuildGeometryInfoKHR
-> Vector AccelerationStructureGeometryKHR
geometries :: Vector AccelerationStructureGeometryKHR
  , -- | @scratchData@ is the device or host address to memory that will be used
    -- as scratch memory for the build.
    AccelerationStructureBuildGeometryInfoKHR -> DeviceOrHostAddressKHR
scratchData :: DeviceOrHostAddressKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureBuildGeometryInfoKHR)
#endif
deriving instance Show AccelerationStructureBuildGeometryInfoKHR

instance ToCStruct AccelerationStructureBuildGeometryInfoKHR where
  withCStruct :: AccelerationStructureBuildGeometryInfoKHR
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: AccelerationStructureBuildGeometryInfoKHR
x f :: ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> IO b
f = Int
-> Int
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 80 8 ((("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
  -> IO b)
 -> IO b)
-> (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p -> ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> AccelerationStructureBuildGeometryInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p AccelerationStructureBuildGeometryInfoKHR
x (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> IO b
f "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p)
  pokeCStruct :: ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> AccelerationStructureBuildGeometryInfoKHR -> IO b -> IO b
pokeCStruct p :: "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p AccelerationStructureBuildGeometryInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr AccelerationStructureTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureTypeKHR)) (AccelerationStructureTypeKHR
type')
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr BuildAccelerationStructureFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr BuildAccelerationStructureFlagsKHR)) (BuildAccelerationStructureFlagsKHR
flags)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr BuildAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr BuildAccelerationStructureModeKHR)) (BuildAccelerationStructureModeKHR
mode)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
srcAccelerationStructure)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
dstAccelerationStructure)
    let pGeometriesLength :: Int
pGeometriesLength = Vector AccelerationStructureGeometryKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AccelerationStructureGeometryKHR -> Int)
-> Vector AccelerationStructureGeometryKHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector AccelerationStructureGeometryKHR
geometries)
    "firstQuery" ::: Word32
geometryCount'' <- IO ("firstQuery" ::: Word32)
-> ContT b IO ("firstQuery" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("firstQuery" ::: Word32)
 -> ContT b IO ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
-> ContT b IO ("firstQuery" ::: Word32)
forall a b. (a -> b) -> a -> b
$ if ("firstQuery" ::: Word32
geometryCount) ("firstQuery" ::: Word32) -> ("firstQuery" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== 0
      then ("firstQuery" ::: Word32) -> IO ("firstQuery" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("firstQuery" ::: Word32) -> IO ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ("firstQuery" ::: Word32)
forall a b. (a -> b) -> a -> b
$ Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pGeometriesLength
      else do
        Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> "firstQuery" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pGeometriesLength ("firstQuery" ::: Word32) -> ("firstQuery" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== ("firstQuery" ::: Word32
geometryCount) Bool -> Bool -> Bool
|| Int
pGeometriesLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== 0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "pGeometries must be empty or have 'geometryCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
        ("firstQuery" ::: Word32) -> IO ("firstQuery" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("firstQuery" ::: Word32
geometryCount)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ("firstQuery" ::: Word32
geometryCount'')
    Ptr AccelerationStructureGeometryKHR
pGeometries'' <- if Vector AccelerationStructureGeometryKHR -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector AccelerationStructureGeometryKHR
geometries)
      then Ptr AccelerationStructureGeometryKHR
-> ContT b IO (Ptr AccelerationStructureGeometryKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AccelerationStructureGeometryKHR
forall a. Ptr a
nullPtr
      else do
        Ptr AccelerationStructureGeometryKHR
pPGeometries <- ((Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b)
-> ContT b IO (Ptr AccelerationStructureGeometryKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b)
 -> ContT b IO (Ptr AccelerationStructureGeometryKHR))
-> ((Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b)
-> ContT b IO (Ptr AccelerationStructureGeometryKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> Int -> (Ptr AccelerationStructureGeometryKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @AccelerationStructureGeometryKHR (((Vector AccelerationStructureGeometryKHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector AccelerationStructureGeometryKHR
geometries))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 96) 8
        (Int -> AccelerationStructureGeometryKHR -> ContT b IO ())
-> Vector AccelerationStructureGeometryKHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: AccelerationStructureGeometryKHR
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryKHR
-> AccelerationStructureGeometryKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AccelerationStructureGeometryKHR
pPGeometries Ptr AccelerationStructureGeometryKHR
-> Int -> Ptr AccelerationStructureGeometryKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (96 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AccelerationStructureGeometryKHR) (AccelerationStructureGeometryKHR
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) ((Vector AccelerationStructureGeometryKHR
geometries))
        Ptr AccelerationStructureGeometryKHR
-> ContT b IO (Ptr AccelerationStructureGeometryKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr AccelerationStructureGeometryKHR
 -> ContT b IO (Ptr AccelerationStructureGeometryKHR))
-> Ptr AccelerationStructureGeometryKHR
-> ContT b IO (Ptr AccelerationStructureGeometryKHR)
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryKHR
pPGeometries
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr AccelerationStructureGeometryKHR)
-> Ptr AccelerationStructureGeometryKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr (Ptr AccelerationStructureGeometryKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (Ptr AccelerationStructureGeometryKHR))) Ptr AccelerationStructureGeometryKHR
pGeometries''
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (Ptr AccelerationStructureGeometryKHR))
-> Ptr (Ptr AccelerationStructureGeometryKHR) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr (Ptr (Ptr AccelerationStructureGeometryKHR))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr (Ptr (Ptr AccelerationStructureGeometryKHR)))) (Ptr (Ptr AccelerationStructureGeometryKHR)
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr DeviceOrHostAddressKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr DeviceOrHostAddressKHR)) (DeviceOrHostAddressKHR
scratchData) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 80
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr AccelerationStructureTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureTypeKHR)) (AccelerationStructureTypeKHR
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr BuildAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr BuildAccelerationStructureModeKHR)) (BuildAccelerationStructureModeKHR
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (Ptr AccelerationStructureGeometryKHR))
-> Ptr (Ptr AccelerationStructureGeometryKHR) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr (Ptr (Ptr AccelerationStructureGeometryKHR))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr (Ptr (Ptr AccelerationStructureGeometryKHR)))) (Ptr (Ptr AccelerationStructureGeometryKHR)
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR
p ("pInfos" ::: Ptr AccelerationStructureBuildGeometryInfoKHR)
-> Int -> Ptr DeviceOrHostAddressKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr DeviceOrHostAddressKHR)) (DeviceOrHostAddressKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero AccelerationStructureBuildGeometryInfoKHR where
  zero :: AccelerationStructureBuildGeometryInfoKHR
zero = AccelerationStructureTypeKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureModeKHR
-> AccelerationStructureKHR
-> AccelerationStructureKHR
-> ("firstQuery" ::: Word32)
-> Vector AccelerationStructureGeometryKHR
-> DeviceOrHostAddressKHR
-> AccelerationStructureBuildGeometryInfoKHR
AccelerationStructureBuildGeometryInfoKHR
           AccelerationStructureTypeKHR
forall a. Zero a => a
zero
           BuildAccelerationStructureFlagsKHR
forall a. Zero a => a
zero
           BuildAccelerationStructureModeKHR
forall a. Zero a => a
zero
           AccelerationStructureKHR
forall a. Zero a => a
zero
           AccelerationStructureKHR
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           Vector AccelerationStructureGeometryKHR
forall a. Monoid a => a
mempty
           DeviceOrHostAddressKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureBuildRangeInfoKHR - Structure specifying build
-- offsets and counts for acceleration structure builds
--
-- = Description
--
-- The primitive count and primitive offset are interpreted differently
-- depending on the 'GeometryTypeKHR' used:
--
-- -   For geometries of type 'GEOMETRY_TYPE_TRIANGLES_KHR',
--     @primitiveCount@ is the number of triangles to be built, where each
--     triangle is treated as 3 vertices.
--
--     -   If the geometry uses indices, @primitiveCount@ × 3 indices are
--         consumed from
--         'AccelerationStructureGeometryTrianglesDataKHR'::@indexData@,
--         starting at an offset of @primitiveOffset@. The value of
--         @firstVertex@ is added to the index values before fetching
--         vertices.
--
--     -   If the geometry does not use indices, @primitiveCount@ × 3
--         vertices are consumed from
--         'AccelerationStructureGeometryTrianglesDataKHR'::@vertexData@,
--         starting at an offset of @primitiveOffset@ +
--         'AccelerationStructureGeometryTrianglesDataKHR'::@vertexStride@
--         × @firstVertex@.
--
--     -   A single 'TransformMatrixKHR' structure is consumed from
--         'AccelerationStructureGeometryTrianglesDataKHR'::@transformData@,
--         at an offset of @transformOffset@. This transformation matrix is
--         used by all triangles.
--
-- -   For geometries of type 'GEOMETRY_TYPE_AABBS_KHR', @primitiveCount@
--     is the number of axis-aligned bounding boxes. @primitiveCount@
--     'AabbPositionsKHR' structures are consumed from
--     'AccelerationStructureGeometryAabbsDataKHR'::@data@, starting at an
--     offset of @primitiveOffset@.
--
-- -   For geometries of type 'GEOMETRY_TYPE_INSTANCES_KHR',
--     @primitiveCount@ is the number of acceleration structures.
--     @primitiveCount@ 'AccelerationStructureInstanceKHR' structures are
--     consumed from
--     'AccelerationStructureGeometryInstancesDataKHR'::@data@, starting at
--     an offset of @primitiveOffset@.
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03656#
--     For geometries of type 'GEOMETRY_TYPE_TRIANGLES_KHR', if the
--     geometry uses indices, the offset @primitiveOffset@ from
--     'AccelerationStructureGeometryTrianglesDataKHR'::@indexData@ /must/
--     be a multiple of the element size of
--     'AccelerationStructureGeometryTrianglesDataKHR'::@indexType@
--
-- -   #VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03657#
--     For geometries of type 'GEOMETRY_TYPE_TRIANGLES_KHR', if the
--     geometry doesn’t use indices, the offset @primitiveOffset@ from
--     'AccelerationStructureGeometryTrianglesDataKHR'::@vertexData@ /must/
--     be a multiple of the component size of
--     'AccelerationStructureGeometryTrianglesDataKHR'::@vertexFormat@
--
-- -   #VUID-VkAccelerationStructureBuildRangeInfoKHR-transformOffset-03658#
--     For geometries of type 'GEOMETRY_TYPE_TRIANGLES_KHR', the offset
--     @transformOffset@ from
--     'AccelerationStructureGeometryTrianglesDataKHR'::@transformData@
--     /must/ be a multiple of 16
--
-- -   #VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03659#
--     For geometries of type 'GEOMETRY_TYPE_AABBS_KHR', the offset
--     @primitiveOffset@ from
--     'AccelerationStructureGeometryAabbsDataKHR'::@data@ /must/ be a
--     multiple of 8
--
-- -   #VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03660#
--     For geometries of type 'GEOMETRY_TYPE_INSTANCES_KHR', the offset
--     @primitiveOffset@ from
--     'AccelerationStructureGeometryInstancesDataKHR'::@data@ /must/ be a
--     multiple of 16
--
-- = See Also
--
-- 'buildAccelerationStructuresKHR', 'cmdBuildAccelerationStructuresKHR'
data AccelerationStructureBuildRangeInfoKHR = AccelerationStructureBuildRangeInfoKHR
  { -- | @primitiveCount@ defines the number of primitives for a corresponding
    -- acceleration structure geometry.
    AccelerationStructureBuildRangeInfoKHR -> "firstQuery" ::: Word32
primitiveCount :: Word32
  , -- | @primitiveOffset@ defines an offset in bytes into the memory where
    -- primitive data is defined.
    AccelerationStructureBuildRangeInfoKHR -> "firstQuery" ::: Word32
primitiveOffset :: Word32
  , -- | @firstVertex@ is the index of the first vertex to build from for
    -- triangle geometry.
    AccelerationStructureBuildRangeInfoKHR -> "firstQuery" ::: Word32
firstVertex :: Word32
  , -- | @transformOffset@ defines an offset in bytes into the memory where a
    -- transform matrix is defined.
    AccelerationStructureBuildRangeInfoKHR -> "firstQuery" ::: Word32
transformOffset :: Word32
  }
  deriving (Typeable, AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> Bool
(AccelerationStructureBuildRangeInfoKHR
 -> AccelerationStructureBuildRangeInfoKHR -> Bool)
-> (AccelerationStructureBuildRangeInfoKHR
    -> AccelerationStructureBuildRangeInfoKHR -> Bool)
-> Eq AccelerationStructureBuildRangeInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> Bool
$c/= :: AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> Bool
== :: AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> Bool
$c== :: AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureBuildRangeInfoKHR)
#endif
deriving instance Show AccelerationStructureBuildRangeInfoKHR

instance ToCStruct AccelerationStructureBuildRangeInfoKHR where
  withCStruct :: AccelerationStructureBuildRangeInfoKHR
-> (Ptr AccelerationStructureBuildRangeInfoKHR -> IO b) -> IO b
withCStruct x :: AccelerationStructureBuildRangeInfoKHR
x f :: Ptr AccelerationStructureBuildRangeInfoKHR -> IO b
f = Int
-> Int
-> (Ptr AccelerationStructureBuildRangeInfoKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 4 ((Ptr AccelerationStructureBuildRangeInfoKHR -> IO b) -> IO b)
-> (Ptr AccelerationStructureBuildRangeInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureBuildRangeInfoKHR
p -> Ptr AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureBuildRangeInfoKHR
p AccelerationStructureBuildRangeInfoKHR
x (Ptr AccelerationStructureBuildRangeInfoKHR -> IO b
f Ptr AccelerationStructureBuildRangeInfoKHR
p)
  pokeCStruct :: Ptr AccelerationStructureBuildRangeInfoKHR
-> AccelerationStructureBuildRangeInfoKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureBuildRangeInfoKHR
p AccelerationStructureBuildRangeInfoKHR{..} f :: IO b
f = do
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("firstQuery" ::: Word32
primitiveCount)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstQuery" ::: Word32
primitiveOffset)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("firstQuery" ::: Word32
firstVertex)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32)) ("firstQuery" ::: Word32
transformOffset)
    IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr AccelerationStructureBuildRangeInfoKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureBuildRangeInfoKHR
p f :: IO b
f = do
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) ("firstQuery" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureBuildRangeInfoKHR where
  peekCStruct :: Ptr AccelerationStructureBuildRangeInfoKHR
-> IO AccelerationStructureBuildRangeInfoKHR
peekCStruct p :: Ptr AccelerationStructureBuildRangeInfoKHR
p = do
    "firstQuery" ::: Word32
primitiveCount <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    "firstQuery" ::: Word32
primitiveOffset <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
    "firstQuery" ::: Word32
firstVertex <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    "firstQuery" ::: Word32
transformOffset <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureBuildRangeInfoKHR
p Ptr AccelerationStructureBuildRangeInfoKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32))
    AccelerationStructureBuildRangeInfoKHR
-> IO AccelerationStructureBuildRangeInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureBuildRangeInfoKHR
 -> IO AccelerationStructureBuildRangeInfoKHR)
-> AccelerationStructureBuildRangeInfoKHR
-> IO AccelerationStructureBuildRangeInfoKHR
forall a b. (a -> b) -> a -> b
$ ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> AccelerationStructureBuildRangeInfoKHR
AccelerationStructureBuildRangeInfoKHR
             "firstQuery" ::: Word32
primitiveCount "firstQuery" ::: Word32
primitiveOffset "firstQuery" ::: Word32
firstVertex "firstQuery" ::: Word32
transformOffset

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

instance Zero AccelerationStructureBuildRangeInfoKHR where
  zero :: AccelerationStructureBuildRangeInfoKHR
zero = ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> AccelerationStructureBuildRangeInfoKHR
AccelerationStructureBuildRangeInfoKHR
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero


-- | VkAccelerationStructureCreateInfoKHR - Structure specifying the
-- parameters of a newly created acceleration structure object
--
-- = Description
--
-- If @deviceAddress@ is zero, no specific address is requested.
--
-- If @deviceAddress@ is not zero, @deviceAddress@ /must/ be an address
-- retrieved from an identically created acceleration structure on the same
-- implementation. The acceleration structure /must/ also be placed on an
-- identically created @buffer@ and at the same @offset@.
--
-- Applications /should/ avoid creating acceleration structures with
-- application-provided addresses and implementation-provided addresses in
-- the same process, to reduce the likelihood of
-- 'Vulkan.Extensions.VK_KHR_buffer_device_address.ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR'
-- errors.
--
-- Note
--
-- The expected usage for this is that a trace capture\/replay tool will
-- add the
-- 'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT'
-- flag to all buffers that use
-- 'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT',
-- and
-- 'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT'
-- to all buffers used as storage for an acceleration structure where
-- @deviceAddress@ is not zero. During capture the tool will save the
-- queried opaque device addresses in the trace. During replay, the buffers
-- will be created specifying the original address so any address values
-- stored in the trace data will remain valid.
--
-- Implementations are expected to separate such buffers in the GPU address
-- space so normal allocations will avoid using these addresses.
-- Apps\/tools should avoid mixing app-provided and implementation-provided
-- addresses for buffers created with
-- 'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT',
-- to avoid address space allocation conflicts.
--
-- Applications /should/ create an acceleration structure with a specific
-- 'AccelerationStructureTypeKHR' other than
-- 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR'.
--
-- If the acceleration structure will be the target of a build operation,
-- the required size for an acceleration structure /can/ be queried with
-- 'getAccelerationStructureBuildSizesKHR'. If the acceleration structure
-- is going to be the target of a compacting copy,
-- 'cmdWriteAccelerationStructuresPropertiesKHR' or
-- 'writeAccelerationStructuresPropertiesKHR' /can/ be used to obtain the
-- compacted size required.
--
-- == Valid Usage
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-deviceAddress-03612# If
--     @deviceAddress@ is not zero, @createFlags@ /must/ include
--     'ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR'
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-createFlags-03613# If
--     @createFlags@ includes
--     'ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR',
--     'PhysicalDeviceAccelerationStructureFeaturesKHR'::@accelerationStructureCaptureReplay@
--     /must/ be 'Vulkan.Core10.FundamentalTypes.TRUE'
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-buffer-03614# @buffer@
--     /must/ have been created with a @usage@ value containing
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR'
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-buffer-03615# @buffer@
--     /must/ not have been created with
--     'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_SPARSE_RESIDENCY_BIT'
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-offset-03616# The sum of
--     @offset@ and @size@ /must/ be less than the size of @buffer@
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-offset-03734# @offset@
--     /must/ be a multiple of @256@ bytes
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR'
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-createFlags-parameter#
--     @createFlags@ /must/ be a valid combination of
--     'AccelerationStructureCreateFlagBitsKHR' values
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-buffer-parameter#
--     @buffer@ /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkAccelerationStructureCreateInfoKHR-type-parameter# @type@
--     /must/ be a valid 'AccelerationStructureTypeKHR' value
--
-- = See Also
--
-- 'AccelerationStructureCreateFlagsKHR', 'AccelerationStructureTypeKHR',
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createAccelerationStructureKHR'
data AccelerationStructureCreateInfoKHR = AccelerationStructureCreateInfoKHR
  { -- | @createFlags@ is a bitmask of 'AccelerationStructureCreateFlagBitsKHR'
    -- specifying additional creation parameters of the acceleration structure.
    AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateFlagsKHR
createFlags :: AccelerationStructureCreateFlagsKHR
  , -- | @buffer@ is the buffer on which the acceleration structure will be
    -- stored.
    AccelerationStructureCreateInfoKHR -> Buffer
buffer :: Buffer
  , -- | @offset@ is an offset in bytes from the base address of the buffer at
    -- which the acceleration structure will be stored, and /must/ be a
    -- multiple of @256@.
    AccelerationStructureCreateInfoKHR -> "dataSize" ::: Word64
offset :: DeviceSize
  , -- | @size@ is the size required for the acceleration structure.
    AccelerationStructureCreateInfoKHR -> "dataSize" ::: Word64
size :: DeviceSize
  , -- | @type@ is a 'AccelerationStructureTypeKHR' value specifying the type of
    -- acceleration structure that will be created.
    AccelerationStructureCreateInfoKHR -> AccelerationStructureTypeKHR
type' :: AccelerationStructureTypeKHR
  , -- | @deviceAddress@ is the device address requested for the acceleration
    -- structure if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructureCaptureReplay accelerationStructureCaptureReplay>
    -- feature is being used.
    AccelerationStructureCreateInfoKHR -> "dataSize" ::: Word64
deviceAddress :: DeviceAddress
  }
  deriving (Typeable, AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateInfoKHR -> Bool
(AccelerationStructureCreateInfoKHR
 -> AccelerationStructureCreateInfoKHR -> Bool)
-> (AccelerationStructureCreateInfoKHR
    -> AccelerationStructureCreateInfoKHR -> Bool)
-> Eq AccelerationStructureCreateInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateInfoKHR -> Bool
$c/= :: AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateInfoKHR -> Bool
== :: AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateInfoKHR -> Bool
$c== :: AccelerationStructureCreateInfoKHR
-> AccelerationStructureCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureCreateInfoKHR)
#endif
deriving instance Show AccelerationStructureCreateInfoKHR

instance ToCStruct AccelerationStructureCreateInfoKHR where
  withCStruct :: AccelerationStructureCreateInfoKHR
-> (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: AccelerationStructureCreateInfoKHR
x f :: ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
  -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p -> ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> AccelerationStructureCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p AccelerationStructureCreateInfoKHR
x (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> AccelerationStructureCreateInfoKHR -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p AccelerationStructureCreateInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr AccelerationStructureCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureCreateFlagsKHR)) (AccelerationStructureCreateFlagsKHR
createFlags)
    Ptr Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer)) (Buffer
buffer)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
offset)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DeviceSize)) ("dataSize" ::: Word64
size)
    Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr AccelerationStructureTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr AccelerationStructureTypeKHR)) (AccelerationStructureTypeKHR
type')
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr DeviceAddress)) ("dataSize" ::: Word64
deviceAddress)
    IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr AccelerationStructureTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr AccelerationStructureTypeKHR)) (AccelerationStructureTypeKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureCreateInfoKHR where
  peekCStruct :: ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> IO AccelerationStructureCreateInfoKHR
peekCStruct p :: "pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p = do
    AccelerationStructureCreateFlagsKHR
createFlags <- Ptr AccelerationStructureCreateFlagsKHR
-> IO AccelerationStructureCreateFlagsKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureCreateFlagsKHR (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr AccelerationStructureCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureCreateFlagsKHR))
    Buffer
buffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer))
    "dataSize" ::: Word64
offset <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize))
    "dataSize" ::: Word64
size <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DeviceSize))
    AccelerationStructureTypeKHR
type' <- Ptr AccelerationStructureTypeKHR -> IO AccelerationStructureTypeKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureTypeKHR (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int -> Ptr AccelerationStructureTypeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr AccelerationStructureTypeKHR))
    "dataSize" ::: Word64
deviceAddress <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress (("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR
p ("pCreateInfo" ::: Ptr AccelerationStructureCreateInfoKHR)
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr DeviceAddress))
    AccelerationStructureCreateInfoKHR
-> IO AccelerationStructureCreateInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureCreateInfoKHR
 -> IO AccelerationStructureCreateInfoKHR)
-> AccelerationStructureCreateInfoKHR
-> IO AccelerationStructureCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ AccelerationStructureCreateFlagsKHR
-> Buffer
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> AccelerationStructureTypeKHR
-> ("dataSize" ::: Word64)
-> AccelerationStructureCreateInfoKHR
AccelerationStructureCreateInfoKHR
             AccelerationStructureCreateFlagsKHR
createFlags Buffer
buffer "dataSize" ::: Word64
offset "dataSize" ::: Word64
size AccelerationStructureTypeKHR
type' "dataSize" ::: Word64
deviceAddress

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

instance Zero AccelerationStructureCreateInfoKHR where
  zero :: AccelerationStructureCreateInfoKHR
zero = AccelerationStructureCreateFlagsKHR
-> Buffer
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> AccelerationStructureTypeKHR
-> ("dataSize" ::: Word64)
-> AccelerationStructureCreateInfoKHR
AccelerationStructureCreateInfoKHR
           AccelerationStructureCreateFlagsKHR
forall a. Zero a => a
zero
           Buffer
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           AccelerationStructureTypeKHR
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero


-- | VkAabbPositionsKHR - Structure specifying two opposing corners of an
-- axis-aligned bounding box
--
-- == Valid Usage
--
-- = See Also
--
-- No cross-references are available
data AabbPositionsKHR = AabbPositionsKHR
  { -- | @minX@ is the x position of one opposing corner of a bounding box.
    --
    -- #VUID-VkAabbPositionsKHR-minX-03546# @minX@ /must/ be less than or equal
    -- to @maxX@
    AabbPositionsKHR -> Float
minX :: Float
  , -- | @minY@ is the y position of one opposing corner of a bounding box.
    --
    -- #VUID-VkAabbPositionsKHR-minY-03547# @minY@ /must/ be less than or equal
    -- to @maxY@
    AabbPositionsKHR -> Float
minY :: Float
  , -- | @minZ@ is the z position of one opposing corner of a bounding box.
    --
    -- #VUID-VkAabbPositionsKHR-minZ-03548# @minZ@ /must/ be less than or equal
    -- to @maxZ@
    AabbPositionsKHR -> Float
minZ :: Float
  , -- | @maxX@ is the x position of the other opposing corner of a bounding box.
    AabbPositionsKHR -> Float
maxX :: Float
  , -- | @maxY@ is the y position of the other opposing corner of a bounding box.
    AabbPositionsKHR -> Float
maxY :: Float
  , -- | @maxZ@ is the z position of the other opposing corner of a bounding box.
    AabbPositionsKHR -> Float
maxZ :: Float
  }
  deriving (Typeable, AabbPositionsKHR -> AabbPositionsKHR -> Bool
(AabbPositionsKHR -> AabbPositionsKHR -> Bool)
-> (AabbPositionsKHR -> AabbPositionsKHR -> Bool)
-> Eq AabbPositionsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AabbPositionsKHR -> AabbPositionsKHR -> Bool
$c/= :: AabbPositionsKHR -> AabbPositionsKHR -> Bool
== :: AabbPositionsKHR -> AabbPositionsKHR -> Bool
$c== :: AabbPositionsKHR -> AabbPositionsKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AabbPositionsKHR)
#endif
deriving instance Show AabbPositionsKHR

instance ToCStruct AabbPositionsKHR where
  withCStruct :: AabbPositionsKHR -> (Ptr AabbPositionsKHR -> IO b) -> IO b
withCStruct x :: AabbPositionsKHR
x f :: Ptr AabbPositionsKHR -> IO b
f = Int -> Int -> (Ptr AabbPositionsKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 4 ((Ptr AabbPositionsKHR -> IO b) -> IO b)
-> (Ptr AabbPositionsKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AabbPositionsKHR
p -> Ptr AabbPositionsKHR -> AabbPositionsKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AabbPositionsKHR
p AabbPositionsKHR
x (Ptr AabbPositionsKHR -> IO b
f Ptr AabbPositionsKHR
p)
  pokeCStruct :: Ptr AabbPositionsKHR -> AabbPositionsKHR -> IO b -> IO b
pokeCStruct p :: Ptr AabbPositionsKHR
p AabbPositionsKHR{..} f :: IO b
f = do
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minX))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minY))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minZ))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
maxX))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
maxY))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
maxZ))
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr AabbPositionsKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AabbPositionsKHR
p f :: IO b
f = do
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct AabbPositionsKHR where
  peekCStruct :: Ptr AabbPositionsKHR -> IO AabbPositionsKHR
peekCStruct p :: Ptr AabbPositionsKHR
p = do
    CFloat
minX <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr CFloat))
    CFloat
minY <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat))
    CFloat
minZ <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat))
    CFloat
maxX <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat))
    CFloat
maxY <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CFloat))
    CFloat
maxZ <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AabbPositionsKHR
p Ptr AabbPositionsKHR -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr CFloat))
    AabbPositionsKHR -> IO AabbPositionsKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AabbPositionsKHR -> IO AabbPositionsKHR)
-> AabbPositionsKHR -> IO AabbPositionsKHR
forall a b. (a -> b) -> a -> b
$ Float
-> Float -> Float -> Float -> Float -> Float -> AabbPositionsKHR
AabbPositionsKHR
             ((\(CFloat a :: Float
a) -> Float
a) CFloat
minX) ((\(CFloat a :: Float
a) -> Float
a) CFloat
minY) ((\(CFloat a :: Float
a) -> Float
a) CFloat
minZ) ((\(CFloat a :: Float
a) -> Float
a) CFloat
maxX) ((\(CFloat a :: Float
a) -> Float
a) CFloat
maxY) ((\(CFloat a :: Float
a) -> Float
a) CFloat
maxZ)

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

instance Zero AabbPositionsKHR where
  zero :: AabbPositionsKHR
zero = Float
-> Float -> Float -> Float -> Float -> Float -> AabbPositionsKHR
AabbPositionsKHR
           Float
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero


-- | VkTransformMatrixKHR - Structure specifying a 3x4 affine transformation
-- matrix
--
-- == Valid Usage
--
-- -   #VUID-VkTransformMatrixKHR-matrix-03799# The first three columns of
--     @matrix@ /must/ define an invertible 3x3 matrix
--
-- = See Also
--
-- 'AccelerationStructureInstanceKHR'
data TransformMatrixKHR = TransformMatrixKHR
  { -- No documentation found for Nested "VkTransformMatrixKHR" "matrixRow0"
    TransformMatrixKHR -> (Float, Float, Float, Float)
matrixRow0 :: (Float, Float, Float, Float)
  , -- No documentation found for Nested "VkTransformMatrixKHR" "matrixRow1"
    TransformMatrixKHR -> (Float, Float, Float, Float)
matrixRow1 :: (Float, Float, Float, Float)
  , -- No documentation found for Nested "VkTransformMatrixKHR" "matrixRow2"
    TransformMatrixKHR -> (Float, Float, Float, Float)
matrixRow2 :: (Float, Float, Float, Float)
  }
  deriving (Typeable, TransformMatrixKHR -> TransformMatrixKHR -> Bool
(TransformMatrixKHR -> TransformMatrixKHR -> Bool)
-> (TransformMatrixKHR -> TransformMatrixKHR -> Bool)
-> Eq TransformMatrixKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransformMatrixKHR -> TransformMatrixKHR -> Bool
$c/= :: TransformMatrixKHR -> TransformMatrixKHR -> Bool
== :: TransformMatrixKHR -> TransformMatrixKHR -> Bool
$c== :: TransformMatrixKHR -> TransformMatrixKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TransformMatrixKHR)
#endif
deriving instance Show TransformMatrixKHR

instance ToCStruct TransformMatrixKHR where
  withCStruct :: TransformMatrixKHR -> (Ptr TransformMatrixKHR -> IO b) -> IO b
withCStruct x :: TransformMatrixKHR
x f :: Ptr TransformMatrixKHR -> IO b
f = Int -> Int -> (Ptr TransformMatrixKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 4 ((Ptr TransformMatrixKHR -> IO b) -> IO b)
-> (Ptr TransformMatrixKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr TransformMatrixKHR
p -> Ptr TransformMatrixKHR -> TransformMatrixKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TransformMatrixKHR
p TransformMatrixKHR
x (Ptr TransformMatrixKHR -> IO b
f Ptr TransformMatrixKHR
p)
  pokeCStruct :: Ptr TransformMatrixKHR -> TransformMatrixKHR -> IO b -> IO b
pokeCStruct p :: Ptr TransformMatrixKHR
p TransformMatrixKHR{..} f :: IO b
f = do
    let pMatrixRow0' :: Ptr CFloat
pMatrixRow0' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr (FixedArray 4 CFloat)))
    case ((Float, Float, Float, Float)
matrixRow0) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    let pMatrixRow1' :: Ptr CFloat
pMatrixRow1' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray 4 CFloat)))
    case ((Float, Float, Float, Float)
matrixRow1) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    let pMatrixRow2' :: Ptr CFloat
pMatrixRow2' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 4 CFloat)))
    case ((Float, Float, Float, Float)
matrixRow2) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr TransformMatrixKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr TransformMatrixKHR
p f :: IO b
f = do
    let pMatrixRow0' :: Ptr CFloat
pMatrixRow0' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr (FixedArray 4 CFloat)))
    case ((Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow0' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    let pMatrixRow1' :: Ptr CFloat
pMatrixRow1' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray 4 CFloat)))
    case ((Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow1' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    let pMatrixRow2' :: Ptr CFloat
pMatrixRow2' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 4 CFloat)))
    case ((Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)) of
      (e0 :: Float
e0, e1 :: Float
e1, e2 :: Float
e2, e3 :: Float
e3) -> do
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
        Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pMatrixRow2' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
    IO b
f

instance FromCStruct TransformMatrixKHR where
  peekCStruct :: Ptr TransformMatrixKHR -> IO TransformMatrixKHR
peekCStruct p :: Ptr TransformMatrixKHR
p = do
    let pmatrixRow0 :: Ptr CFloat
pmatrixRow0 = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr (FixedArray 4 CFloat)))
    CFloat
matrixRow00 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow0 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr CFloat))
    CFloat
matrixRow01 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow0 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr CFloat))
    CFloat
matrixRow02 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow0 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 8 :: Ptr CFloat))
    CFloat
matrixRow03 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow0 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 12 :: Ptr CFloat))
    let pmatrixRow1 :: Ptr CFloat
pmatrixRow1 = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray 4 CFloat)))
    CFloat
matrixRow10 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow1 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr CFloat))
    CFloat
matrixRow11 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow1 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr CFloat))
    CFloat
matrixRow12 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow1 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 8 :: Ptr CFloat))
    CFloat
matrixRow13 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow1 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 12 :: Ptr CFloat))
    let pmatrixRow2 :: Ptr CFloat
pmatrixRow2 = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr TransformMatrixKHR
p Ptr TransformMatrixKHR -> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 4 CFloat)))
    CFloat
matrixRow20 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow2 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr CFloat))
    CFloat
matrixRow21 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow2 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr CFloat))
    CFloat
matrixRow22 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow2 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 8 :: Ptr CFloat))
    CFloat
matrixRow23 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pmatrixRow2 Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 12 :: Ptr CFloat))
    TransformMatrixKHR -> IO TransformMatrixKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (TransformMatrixKHR -> IO TransformMatrixKHR)
-> TransformMatrixKHR -> IO TransformMatrixKHR
forall a b. (a -> b) -> a -> b
$ (Float, Float, Float, Float)
-> (Float, Float, Float, Float)
-> (Float, Float, Float, Float)
-> TransformMatrixKHR
TransformMatrixKHR
             ((((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow00), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow01), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow02), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow03))) ((((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow10), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow11), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow12), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow13))) ((((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow20), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow21), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow22), ((\(CFloat a :: Float
a) -> Float
a) CFloat
matrixRow23)))

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

instance Zero TransformMatrixKHR where
  zero :: TransformMatrixKHR
zero = (Float, Float, Float, Float)
-> (Float, Float, Float, Float)
-> (Float, Float, Float, Float)
-> TransformMatrixKHR
TransformMatrixKHR
           (Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)
           (Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)
           (Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)


-- | VkAccelerationStructureInstanceKHR - Structure specifying a single
-- acceleration structure instance for building into an acceleration
-- structure geometry
--
-- = Description
--
-- The C language spec does not define the ordering of bit-fields, but in
-- practice, this struct produces the correct layout with existing
-- compilers. The intended bit pattern is for the following:
--
-- If a compiler produces code that diverges from that pattern,
-- applications /must/ employ another method to set values according to the
-- correct bit pattern.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'GeometryInstanceFlagsKHR', 'TransformMatrixKHR'
data AccelerationStructureInstanceKHR = AccelerationStructureInstanceKHR
  { -- | @transform@ is a 'TransformMatrixKHR' structure describing a
    -- transformation to be applied to the acceleration structure.
    AccelerationStructureInstanceKHR -> TransformMatrixKHR
transform :: TransformMatrixKHR
  , -- | @instanceCustomIndex@ is a 24-bit user-specified index value accessible
    -- to ray shaders in the @InstanceCustomIndexKHR@ built-in.
    --
    -- @instanceCustomIndex@ and @mask@ occupy the same memory as if a single
    -- @int32_t@ was specified in their place
    --
    -- -   @instanceCustomIndex@ occupies the 24 least significant bits of that
    --     memory
    --
    -- -   @mask@ occupies the 8 most significant bits of that memory
    AccelerationStructureInstanceKHR -> "firstQuery" ::: Word32
instanceCustomIndex :: Word32
  , -- | @mask@ is an 8-bit visibility mask for the geometry. The instance /may/
    -- only be hit if @rayMask & instance.mask != 0@
    AccelerationStructureInstanceKHR -> "firstQuery" ::: Word32
mask :: Word32
  , -- | @instanceShaderBindingTableRecordOffset@ is a 24-bit offset used in
    -- calculating the hit shader binding table index.
    --
    -- @instanceShaderBindingTableRecordOffset@ and @flags@ occupy the same
    -- memory as if a single @int32_t@ was specified in their place
    --
    -- -   @instanceShaderBindingTableRecordOffset@ occupies the 24 least
    --     significant bits of that memory
    --
    -- -   @flags@ occupies the 8 most significant bits of that memory
    AccelerationStructureInstanceKHR -> "firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset :: Word32
  , -- | @flags@ is an 8-bit mask of 'GeometryInstanceFlagBitsKHR' values to
    -- apply to this instance.
    --
    -- #VUID-VkAccelerationStructureInstanceKHR-flags-parameter# @flags@ /must/
    -- be a valid combination of 'GeometryInstanceFlagBitsKHR' values
    AccelerationStructureInstanceKHR -> GeometryInstanceFlagsKHR
flags :: GeometryInstanceFlagsKHR
  , -- | @accelerationStructureReference@ is either:
    --
    -- -   a device address containing the value obtained from
    --     'getAccelerationStructureDeviceAddressKHR' or
    --     'Vulkan.Extensions.VK_NV_ray_tracing.getAccelerationStructureHandleNV'
    --     (used by device operations which reference acceleration structures)
    --     or,
    --
    -- -   a 'Vulkan.Extensions.Handles.AccelerationStructureKHR' object (used
    --     by host operations which reference acceleration structures).
    AccelerationStructureInstanceKHR -> "dataSize" ::: Word64
accelerationStructureReference :: Word64
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureInstanceKHR)
#endif
deriving instance Show AccelerationStructureInstanceKHR

instance ToCStruct AccelerationStructureInstanceKHR where
  withCStruct :: AccelerationStructureInstanceKHR
-> (Ptr AccelerationStructureInstanceKHR -> IO b) -> IO b
withCStruct x :: AccelerationStructureInstanceKHR
x f :: Ptr AccelerationStructureInstanceKHR -> IO b
f = Int
-> Int -> (Ptr AccelerationStructureInstanceKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr AccelerationStructureInstanceKHR -> IO b) -> IO b)
-> (Ptr AccelerationStructureInstanceKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureInstanceKHR
p -> Ptr AccelerationStructureInstanceKHR
-> AccelerationStructureInstanceKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureInstanceKHR
p AccelerationStructureInstanceKHR
x (Ptr AccelerationStructureInstanceKHR -> IO b
f Ptr AccelerationStructureInstanceKHR
p)
  pokeCStruct :: Ptr AccelerationStructureInstanceKHR
-> AccelerationStructureInstanceKHR -> IO b -> IO b
pokeCStruct p :: Ptr AccelerationStructureInstanceKHR
p AccelerationStructureInstanceKHR{..} f :: IO b
f = do
    Ptr TransformMatrixKHR -> TransformMatrixKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> Ptr TransformMatrixKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr TransformMatrixKHR)) (TransformMatrixKHR
transform)
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) (((("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a b. Coercible a b => a -> b
coerce @_ @Word32 ("firstQuery" ::: Word32
mask)) ("firstQuery" ::: Word32) -> Int -> "firstQuery" ::: Word32
forall a. Bits a => a -> Int -> a
`shiftL` 24) ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a. Bits a => a -> a -> a
.|. ("firstQuery" ::: Word32
instanceCustomIndex))
    ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> ("firstQuery" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) (((GeometryInstanceFlagsKHR -> "firstQuery" ::: Word32
forall a b. Coercible a b => a -> b
coerce @_ @Word32 (GeometryInstanceFlagsKHR
flags)) ("firstQuery" ::: Word32) -> Int -> "firstQuery" ::: Word32
forall a. Bits a => a -> Int -> a
`shiftL` 24) ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a. Bits a => a -> a -> a
.|. ("firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset))
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word64)) ("dataSize" ::: Word64
accelerationStructureReference)
    IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr AccelerationStructureInstanceKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr AccelerationStructureInstanceKHR
p f :: IO b
f = do
    Ptr TransformMatrixKHR -> TransformMatrixKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> Ptr TransformMatrixKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr TransformMatrixKHR)) (TransformMatrixKHR
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word64)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureInstanceKHR where
  peekCStruct :: Ptr AccelerationStructureInstanceKHR
-> IO AccelerationStructureInstanceKHR
peekCStruct p :: Ptr AccelerationStructureInstanceKHR
p = do
    TransformMatrixKHR
transform <- Ptr TransformMatrixKHR -> IO TransformMatrixKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @TransformMatrixKHR ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> Ptr TransformMatrixKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr TransformMatrixKHR))
    "firstQuery" ::: Word32
instanceCustomIndex <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
    let instanceCustomIndex' :: "firstQuery" ::: Word32
instanceCustomIndex' = (("firstQuery" ::: Word32
instanceCustomIndex ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a. Bits a => a -> a -> a
.&. ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a b. Coercible a b => a -> b
coerce @Word32 0xffffff))
    "firstQuery" ::: Word32
mask <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
    let mask' :: "firstQuery" ::: Word32
mask' = (((("firstQuery" ::: Word32
mask ("firstQuery" ::: Word32) -> Int -> "firstQuery" ::: Word32
forall a. Bits a => a -> Int -> a
`shiftR` 24)) ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a. Bits a => a -> a -> a
.&. ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a b. Coercible a b => a -> b
coerce @Word32 0xff))
    "firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset <- ("pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32))
-> IO ("firstQuery" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> "pIndirectStrides" ::: Ptr ("firstQuery" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32))
    let instanceShaderBindingTableRecordOffset' :: "firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset' = (("firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a. Bits a => a -> a -> a
.&. ("firstQuery" ::: Word32) -> "firstQuery" ::: Word32
forall a b. Coercible a b => a -> b
coerce @Word32 0xffffff))
    GeometryInstanceFlagsKHR
flags <- Ptr GeometryInstanceFlagsKHR -> IO GeometryInstanceFlagsKHR
forall a. Storable a => Ptr a -> IO a
peek @GeometryInstanceFlagsKHR ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int -> Ptr GeometryInstanceFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr GeometryInstanceFlagsKHR))
    let flags' :: GeometryInstanceFlagsKHR
flags' = ((((GeometryInstanceFlagsKHR
flags GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
forall a. Bits a => a -> Int -> a
`shiftR` 24)) GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
forall a. Bits a => a -> a -> a
.&. ("firstQuery" ::: Word32) -> GeometryInstanceFlagsKHR
forall a b. Coercible a b => a -> b
coerce @Word32 0xff))
    "dataSize" ::: Word64
accelerationStructureReference <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr AccelerationStructureInstanceKHR
p Ptr AccelerationStructureInstanceKHR
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word64))
    AccelerationStructureInstanceKHR
-> IO AccelerationStructureInstanceKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureInstanceKHR
 -> IO AccelerationStructureInstanceKHR)
-> AccelerationStructureInstanceKHR
-> IO AccelerationStructureInstanceKHR
forall a b. (a -> b) -> a -> b
$ TransformMatrixKHR
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> GeometryInstanceFlagsKHR
-> ("dataSize" ::: Word64)
-> AccelerationStructureInstanceKHR
AccelerationStructureInstanceKHR
             TransformMatrixKHR
transform "firstQuery" ::: Word32
instanceCustomIndex' "firstQuery" ::: Word32
mask' "firstQuery" ::: Word32
instanceShaderBindingTableRecordOffset' GeometryInstanceFlagsKHR
flags' "dataSize" ::: Word64
accelerationStructureReference

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

instance Zero AccelerationStructureInstanceKHR where
  zero :: AccelerationStructureInstanceKHR
zero = TransformMatrixKHR
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> ("firstQuery" ::: Word32)
-> GeometryInstanceFlagsKHR
-> ("dataSize" ::: Word64)
-> AccelerationStructureInstanceKHR
AccelerationStructureInstanceKHR
           TransformMatrixKHR
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           "firstQuery" ::: Word32
forall a. Zero a => a
zero
           GeometryInstanceFlagsKHR
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero


-- | VkAccelerationStructureDeviceAddressInfoKHR - Structure specifying the
-- acceleration structure to query an address for
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getAccelerationStructureDeviceAddressKHR'
data AccelerationStructureDeviceAddressInfoKHR = AccelerationStructureDeviceAddressInfoKHR
  { -- | @accelerationStructure@ specifies the acceleration structure whose
    -- address is being queried.
    --
    -- #VUID-VkAccelerationStructureDeviceAddressInfoKHR-accelerationStructure-parameter#
    -- @accelerationStructure@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
    AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureKHR
accelerationStructure :: AccelerationStructureKHR }
  deriving (Typeable, AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureDeviceAddressInfoKHR -> Bool
(AccelerationStructureDeviceAddressInfoKHR
 -> AccelerationStructureDeviceAddressInfoKHR -> Bool)
-> (AccelerationStructureDeviceAddressInfoKHR
    -> AccelerationStructureDeviceAddressInfoKHR -> Bool)
-> Eq AccelerationStructureDeviceAddressInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureDeviceAddressInfoKHR -> Bool
$c/= :: AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureDeviceAddressInfoKHR -> Bool
== :: AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureDeviceAddressInfoKHR -> Bool
$c== :: AccelerationStructureDeviceAddressInfoKHR
-> AccelerationStructureDeviceAddressInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureDeviceAddressInfoKHR)
#endif
deriving instance Show AccelerationStructureDeviceAddressInfoKHR

instance ToCStruct AccelerationStructureDeviceAddressInfoKHR where
  withCStruct :: AccelerationStructureDeviceAddressInfoKHR
-> (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: AccelerationStructureDeviceAddressInfoKHR
x f :: ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR) -> IO b
f = Int
-> Int
-> (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
  -> IO b)
 -> IO b)
-> (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p -> ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> AccelerationStructureDeviceAddressInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p AccelerationStructureDeviceAddressInfoKHR
x (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR) -> IO b
f "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p)
  pokeCStruct :: ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> AccelerationStructureDeviceAddressInfoKHR -> IO b -> IO b
pokeCStruct p :: "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p AccelerationStructureDeviceAddressInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
accelerationStructure)
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureDeviceAddressInfoKHR where
  peekCStruct :: ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> IO AccelerationStructureDeviceAddressInfoKHR
peekCStruct p :: "pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p = do
    AccelerationStructureKHR
accelerationStructure <- ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureKHR (("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR
p ("pInfo" ::: Ptr AccelerationStructureDeviceAddressInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR))
    AccelerationStructureDeviceAddressInfoKHR
-> IO AccelerationStructureDeviceAddressInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureDeviceAddressInfoKHR
 -> IO AccelerationStructureDeviceAddressInfoKHR)
-> AccelerationStructureDeviceAddressInfoKHR
-> IO AccelerationStructureDeviceAddressInfoKHR
forall a b. (a -> b) -> a -> b
$ AccelerationStructureKHR
-> AccelerationStructureDeviceAddressInfoKHR
AccelerationStructureDeviceAddressInfoKHR
             AccelerationStructureKHR
accelerationStructure

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

instance Zero AccelerationStructureDeviceAddressInfoKHR where
  zero :: AccelerationStructureDeviceAddressInfoKHR
zero = AccelerationStructureKHR
-> AccelerationStructureDeviceAddressInfoKHR
AccelerationStructureDeviceAddressInfoKHR
           AccelerationStructureKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureVersionInfoKHR - Acceleration structure version
-- information
--
-- = Description
--
-- Note
--
-- @pVersionData@ is a /pointer/ to an array of
-- 2*'Vulkan.Core10.APIConstants.UUID_SIZE' @uint8_t@ values instead of two
-- 'Vulkan.Core10.APIConstants.UUID_SIZE' arrays as the expected use case
-- for this member is to be pointed at the header of an previously
-- serialized acceleration structure (via
-- 'cmdCopyAccelerationStructureToMemoryKHR' or
-- 'copyAccelerationStructureToMemoryKHR') that is loaded in memory. Using
-- arrays would necessitate extra memory copies of the UUIDs.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceAccelerationStructureCompatibilityKHR'
data AccelerationStructureVersionInfoKHR = AccelerationStructureVersionInfoKHR
  { -- | @pVersionData@ is a pointer to the version header of an acceleration
    -- structure as defined in 'cmdCopyAccelerationStructureToMemoryKHR'
    --
    -- #VUID-VkAccelerationStructureVersionInfoKHR-pVersionData-parameter#
    -- @pVersionData@ /must/ be a valid pointer to an array of
    -- @2@*'Vulkan.Core10.APIConstants.UUID_SIZE' @uint8_t@ values
    AccelerationStructureVersionInfoKHR -> ByteString
versionData :: ByteString }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureVersionInfoKHR)
#endif
deriving instance Show AccelerationStructureVersionInfoKHR

instance ToCStruct AccelerationStructureVersionInfoKHR where
  withCStruct :: AccelerationStructureVersionInfoKHR
-> (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: AccelerationStructureVersionInfoKHR
x f :: ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> IO b
f = Int
-> Int
-> (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
  -> IO b)
 -> IO b)
-> (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p -> ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> AccelerationStructureVersionInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p AccelerationStructureVersionInfoKHR
x (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> IO b
f "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p)
  pokeCStruct :: ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> AccelerationStructureVersionInfoKHR -> IO b -> IO b
pokeCStruct p :: "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p AccelerationStructureVersionInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (ByteString -> Int
Data.ByteString.length (ByteString
versionData) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== 2 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
forall a. Integral a => a
UUID_SIZE) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
      IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "AccelerationStructureVersionKHR::versionData must be 2*VK_UUID_SIZE bytes" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
    Ptr Word8
versionData' <- (Ptr CChar -> Ptr Word8)
-> ContT b IO (Ptr CChar) -> ContT b IO (Ptr Word8)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Ptr CChar -> Ptr Word8
forall a b. Ptr a -> Ptr b
castPtr @CChar @Word8) (ContT b IO (Ptr CChar) -> ContT b IO (Ptr Word8))
-> (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar))
-> ((Ptr CChar -> IO b) -> IO b)
-> ContT b IO (Ptr Word8)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr Word8))
-> ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr Word8)
forall a b. (a -> b) -> a -> b
$ ByteString -> (Ptr CChar -> IO b) -> IO b
forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
unsafeUseAsCString (ByteString
versionData)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Word8) -> Ptr Word8 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr (Ptr Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Word8))) Ptr Word8
versionData'
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct AccelerationStructureVersionInfoKHR where
  peekCStruct :: ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> IO AccelerationStructureVersionInfoKHR
peekCStruct p :: "pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p = do
    Ptr Word8
versionData <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word8) (("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR
p ("pVersionInfo" ::: Ptr AccelerationStructureVersionInfoKHR)
-> Int -> Ptr (Ptr Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Word8)))
    ByteString
versionData' <- CStringLen -> IO ByteString
packCStringLen (Ptr Word8 -> Ptr CChar
forall a b. Ptr a -> Ptr b
castPtr @Word8 @CChar Ptr Word8
versionData, 2 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
forall a. Integral a => a
UUID_SIZE)
    AccelerationStructureVersionInfoKHR
-> IO AccelerationStructureVersionInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AccelerationStructureVersionInfoKHR
 -> IO AccelerationStructureVersionInfoKHR)
-> AccelerationStructureVersionInfoKHR
-> IO AccelerationStructureVersionInfoKHR
forall a b. (a -> b) -> a -> b
$ ByteString -> AccelerationStructureVersionInfoKHR
AccelerationStructureVersionInfoKHR
             ByteString
versionData'

instance Zero AccelerationStructureVersionInfoKHR where
  zero :: AccelerationStructureVersionInfoKHR
zero = ByteString -> AccelerationStructureVersionInfoKHR
AccelerationStructureVersionInfoKHR
           ByteString
forall a. Monoid a => a
mempty


-- | VkCopyAccelerationStructureInfoKHR - Parameters for copying an
-- acceleration structure
--
-- == Valid Usage
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-mode-03410# @mode@ /must/
--     be 'COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR' or
--     'COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR'
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-src-03411# If @mode@ is
--     'COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR', @src@ /must/ have
--     been built with
--     'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR'
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-buffer-03718# The @buffer@
--     used to create @src@ /must/ be bound to device memory
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-buffer-03719# The @buffer@
--     used to create @dst@ /must/ be bound to device memory
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR'
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext# @pNext@ /must/
--     be @NULL@
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-src-parameter# @src@ /must/
--     be a valid 'Vulkan.Extensions.Handles.AccelerationStructureKHR'
--     handle
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-dst-parameter# @dst@ /must/
--     be a valid 'Vulkan.Extensions.Handles.AccelerationStructureKHR'
--     handle
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-mode-parameter# @mode@
--     /must/ be a valid 'CopyAccelerationStructureModeKHR' value
--
-- -   #VUID-VkCopyAccelerationStructureInfoKHR-commonparent# Both of
--     @dst@, and @src@ /must/ have been created, allocated, or retrieved
--     from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'CopyAccelerationStructureModeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyAccelerationStructureKHR', 'copyAccelerationStructureKHR'
data CopyAccelerationStructureInfoKHR = CopyAccelerationStructureInfoKHR
  { -- | @src@ is the source acceleration structure for the copy.
    CopyAccelerationStructureInfoKHR -> AccelerationStructureKHR
src :: AccelerationStructureKHR
  , -- | @dst@ is the target acceleration structure for the copy.
    CopyAccelerationStructureInfoKHR -> AccelerationStructureKHR
dst :: AccelerationStructureKHR
  , -- | @mode@ is a 'CopyAccelerationStructureModeKHR' value that specifies
    -- additional operations to perform during the copy.
    CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureModeKHR
mode :: CopyAccelerationStructureModeKHR
  }
  deriving (Typeable, CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureInfoKHR -> Bool
(CopyAccelerationStructureInfoKHR
 -> CopyAccelerationStructureInfoKHR -> Bool)
-> (CopyAccelerationStructureInfoKHR
    -> CopyAccelerationStructureInfoKHR -> Bool)
-> Eq CopyAccelerationStructureInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureInfoKHR -> Bool
$c/= :: CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureInfoKHR -> Bool
== :: CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureInfoKHR -> Bool
$c== :: CopyAccelerationStructureInfoKHR
-> CopyAccelerationStructureInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyAccelerationStructureInfoKHR)
#endif
deriving instance Show CopyAccelerationStructureInfoKHR

instance ToCStruct CopyAccelerationStructureInfoKHR where
  withCStruct :: CopyAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b)
-> IO b
withCStruct x :: CopyAccelerationStructureInfoKHR
x f :: ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b
f = Int
-> Int
-> (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b)
 -> IO b)
-> (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p -> ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> CopyAccelerationStructureInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p CopyAccelerationStructureInfoKHR
x (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b
f "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p)
  pokeCStruct :: ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> CopyAccelerationStructureInfoKHR -> IO b -> IO b
pokeCStruct p :: "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p CopyAccelerationStructureInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
src)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
dst)
    Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
mode)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR) -> IO b -> IO b
pokeZeroCStruct p :: "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
forall a. Zero a => a
zero)
    ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
forall a. Zero a => a
zero)
    Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CopyAccelerationStructureInfoKHR where
  peekCStruct :: ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> IO CopyAccelerationStructureInfoKHR
peekCStruct p :: "pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p = do
    AccelerationStructureKHR
src <- ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureKHR (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR))
    AccelerationStructureKHR
dst <- ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> IO AccelerationStructureKHR
forall a. Storable a => Ptr a -> IO a
peek @AccelerationStructureKHR (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureKHR))
    CopyAccelerationStructureModeKHR
mode <- Ptr CopyAccelerationStructureModeKHR
-> IO CopyAccelerationStructureModeKHR
forall a. Storable a => Ptr a -> IO a
peek @CopyAccelerationStructureModeKHR (("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR))
    CopyAccelerationStructureInfoKHR
-> IO CopyAccelerationStructureInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CopyAccelerationStructureInfoKHR
 -> IO CopyAccelerationStructureInfoKHR)
-> CopyAccelerationStructureInfoKHR
-> IO CopyAccelerationStructureInfoKHR
forall a b. (a -> b) -> a -> b
$ AccelerationStructureKHR
-> AccelerationStructureKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureInfoKHR
CopyAccelerationStructureInfoKHR
             AccelerationStructureKHR
src AccelerationStructureKHR
dst CopyAccelerationStructureModeKHR
mode

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

instance Zero CopyAccelerationStructureInfoKHR where
  zero :: CopyAccelerationStructureInfoKHR
zero = AccelerationStructureKHR
-> AccelerationStructureKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureInfoKHR
CopyAccelerationStructureInfoKHR
           AccelerationStructureKHR
forall a. Zero a => a
zero
           AccelerationStructureKHR
forall a. Zero a => a
zero
           CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero


-- | VkCopyAccelerationStructureToMemoryInfoKHR - Parameters for serializing
-- an acceleration structure
--
-- == Valid Usage
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-dst-03561# The
--     memory pointed to by @dst@ /must/ be at least as large as the
--     serialization size of @src@, as reported by
--     'writeAccelerationStructuresPropertiesKHR' or
--     'cmdWriteAccelerationStructuresPropertiesKHR' with a query type of
--     'Vulkan.Core10.Enums.QueryType.QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR'
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-03412# @mode@
--     /must/ be 'COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR'
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext#
--     @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-src-parameter#
--     @src@ /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-dst-parameter#
--     @dst@ /must/ be a valid 'DeviceOrHostAddressKHR' union
--
-- -   #VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-parameter#
--     @mode@ /must/ be a valid 'CopyAccelerationStructureModeKHR' value
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'CopyAccelerationStructureModeKHR', 'DeviceOrHostAddressKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyAccelerationStructureToMemoryKHR',
-- 'copyAccelerationStructureToMemoryKHR'
data CopyAccelerationStructureToMemoryInfoKHR = CopyAccelerationStructureToMemoryInfoKHR
  { -- | @src@ is the source acceleration structure for the copy
    CopyAccelerationStructureToMemoryInfoKHR
-> AccelerationStructureKHR
src :: AccelerationStructureKHR
  , -- | @dst@ is the device or host address to memory which is the target for
    -- the copy
    CopyAccelerationStructureToMemoryInfoKHR -> DeviceOrHostAddressKHR
dst :: DeviceOrHostAddressKHR
  , -- | @mode@ is a 'CopyAccelerationStructureModeKHR' value that specifies
    -- additional operations to perform during the copy.
    CopyAccelerationStructureToMemoryInfoKHR
-> CopyAccelerationStructureModeKHR
mode :: CopyAccelerationStructureModeKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyAccelerationStructureToMemoryInfoKHR)
#endif
deriving instance Show CopyAccelerationStructureToMemoryInfoKHR

instance ToCStruct CopyAccelerationStructureToMemoryInfoKHR where
  withCStruct :: CopyAccelerationStructureToMemoryInfoKHR
-> (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: CopyAccelerationStructureToMemoryInfoKHR
x f :: ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR) -> IO b
f = Int
-> Int
-> (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
  -> IO b)
 -> IO b)
-> (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p -> ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> CopyAccelerationStructureToMemoryInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p CopyAccelerationStructureToMemoryInfoKHR
x (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR) -> IO b
f "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p)
  pokeCStruct :: ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> CopyAccelerationStructureToMemoryInfoKHR -> IO b -> IO b
pokeCStruct p :: "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p CopyAccelerationStructureToMemoryInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
src)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr DeviceOrHostAddressKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressKHR)) (DeviceOrHostAddressKHR
dst) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
mode)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
forall a. Zero a => a
zero)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr DeviceOrHostAddressKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceOrHostAddressKHR)) (DeviceOrHostAddressKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR
p ("pInfo" ::: Ptr CopyAccelerationStructureToMemoryInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero CopyAccelerationStructureToMemoryInfoKHR where
  zero :: CopyAccelerationStructureToMemoryInfoKHR
zero = AccelerationStructureKHR
-> DeviceOrHostAddressKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureToMemoryInfoKHR
CopyAccelerationStructureToMemoryInfoKHR
           AccelerationStructureKHR
forall a. Zero a => a
zero
           DeviceOrHostAddressKHR
forall a. Zero a => a
zero
           CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero


-- | VkCopyMemoryToAccelerationStructureInfoKHR - Parameters for
-- deserializing an acceleration structure
--
-- == Valid Usage
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-03413# @mode@
--     /must/ be 'COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR'
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pInfo-03414# The
--     data in @src@ /must/ have a format compatible with the destination
--     physical device as returned by
--     'getDeviceAccelerationStructureCompatibilityKHR'
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-dst-03746# @dst@
--     /must/ have been created with a @size@ greater than or equal to that
--     used to serialize the data in @src@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR'
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext#
--     @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-src-parameter#
--     @src@ /must/ be a valid 'DeviceOrHostAddressConstKHR' union
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-dst-parameter#
--     @dst@ /must/ be a valid
--     'Vulkan.Extensions.Handles.AccelerationStructureKHR' handle
--
-- -   #VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-parameter#
--     @mode@ /must/ be a valid 'CopyAccelerationStructureModeKHR' value
--
-- = See Also
--
-- 'Vulkan.Extensions.Handles.AccelerationStructureKHR',
-- 'CopyAccelerationStructureModeKHR', 'DeviceOrHostAddressConstKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyMemoryToAccelerationStructureKHR',
-- 'copyMemoryToAccelerationStructureKHR'
data CopyMemoryToAccelerationStructureInfoKHR = CopyMemoryToAccelerationStructureInfoKHR
  { -- | @src@ is the device or host address to memory containing the source data
    -- for the copy.
    CopyMemoryToAccelerationStructureInfoKHR
-> DeviceOrHostAddressConstKHR
src :: DeviceOrHostAddressConstKHR
  , -- | @dst@ is the target acceleration structure for the copy.
    CopyMemoryToAccelerationStructureInfoKHR
-> AccelerationStructureKHR
dst :: AccelerationStructureKHR
  , -- | @mode@ is a 'CopyAccelerationStructureModeKHR' value that specifies
    -- additional operations to perform during the copy.
    CopyMemoryToAccelerationStructureInfoKHR
-> CopyAccelerationStructureModeKHR
mode :: CopyAccelerationStructureModeKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyMemoryToAccelerationStructureInfoKHR)
#endif
deriving instance Show CopyMemoryToAccelerationStructureInfoKHR

instance ToCStruct CopyMemoryToAccelerationStructureInfoKHR where
  withCStruct :: CopyMemoryToAccelerationStructureInfoKHR
-> (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
    -> IO b)
-> IO b
withCStruct x :: CopyMemoryToAccelerationStructureInfoKHR
x f :: ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR) -> IO b
f = Int
-> Int
-> (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
  -> IO b)
 -> IO b)
-> (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p -> ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> CopyMemoryToAccelerationStructureInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p CopyMemoryToAccelerationStructureInfoKHR
x (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR) -> IO b
f "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p)
  pokeCStruct :: ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> CopyMemoryToAccelerationStructureInfoKHR -> IO b -> IO b
pokeCStruct p :: "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p CopyMemoryToAccelerationStructureInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
src) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
dst)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
mode)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr DeviceOrHostAddressConstKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceOrHostAddressConstKHR)) (DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pAccelerationStructures" ::: Ptr AccelerationStructureKHR)
-> AccelerationStructureKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int
-> "pAccelerationStructures" ::: Ptr AccelerationStructureKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr AccelerationStructureKHR)) (AccelerationStructureKHR
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR
p ("pInfo" ::: Ptr CopyMemoryToAccelerationStructureInfoKHR)
-> Int -> Ptr CopyAccelerationStructureModeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CopyAccelerationStructureModeKHR)) (CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance Zero CopyMemoryToAccelerationStructureInfoKHR where
  zero :: CopyMemoryToAccelerationStructureInfoKHR
zero = DeviceOrHostAddressConstKHR
-> AccelerationStructureKHR
-> CopyAccelerationStructureModeKHR
-> CopyMemoryToAccelerationStructureInfoKHR
CopyMemoryToAccelerationStructureInfoKHR
           DeviceOrHostAddressConstKHR
forall a. Zero a => a
zero
           AccelerationStructureKHR
forall a. Zero a => a
zero
           CopyAccelerationStructureModeKHR
forall a. Zero a => a
zero


-- | VkAccelerationStructureBuildSizesInfoKHR - Structure specifying build
-- sizes for an acceleration structure
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getAccelerationStructureBuildSizesKHR'
data AccelerationStructureBuildSizesInfoKHR = AccelerationStructureBuildSizesInfoKHR
  { -- | @accelerationStructureSize@ is the size in bytes required in a
    -- 'Vulkan.Extensions.Handles.AccelerationStructureKHR' for a build or
    -- update operation.
    ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> "dataSize" ::: Word64
accelerationStructureSize :: DeviceSize
  , -- | @updateScratchSize@ is the size in bytes required in a scratch buffer
    -- for an update operation.
    ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> "dataSize" ::: Word64
updateScratchSize :: DeviceSize
  , -- | @buildScratchSize@ is the size in bytes required in a scratch buffer for
    -- a build operation.
    ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> "dataSize" ::: Word64
buildScratchSize :: DeviceSize
  }
  deriving (Typeable, ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool
(("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool)
-> (("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
    -> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool)
-> Eq ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool
$c/= :: ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool
== :: ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool
$c== :: ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR) -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AccelerationStructureBuildSizesInfoKHR)
#endif
deriving instance Show AccelerationStructureBuildSizesInfoKHR

instance ToCStruct AccelerationStructureBuildSizesInfoKHR where
  withCStruct :: ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> (("pSizeInfo"
     ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
    -> IO b)
-> IO b
withCStruct x :: "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
x f :: ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO b
f = Int
-> Int
-> (("pSizeInfo"
     ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pSizeInfo"
   ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
  -> IO b)
 -> IO b)
-> (("pSizeInfo"
     ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p -> ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
x (("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO b
f "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p)
  pokeCStruct :: ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> IO b
-> IO b
pokeCStruct p :: "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p AccelerationStructureBuildSizesInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) ("dataSize" ::: Word64
accelerationStructureSize)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) ("dataSize" ::: Word64
updateScratchSize)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
buildScratchSize)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO b -> IO b
pokeZeroCStruct p :: "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR)
    Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) ("dataSize" ::: Word64
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AccelerationStructureBuildSizesInfoKHR where
  peekCStruct :: ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
peekCStruct p :: "pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p = do
    "dataSize" ::: Word64
accelerationStructureSize <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize))
    "dataSize" ::: Word64
updateScratchSize <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize))
    "dataSize" ::: Word64
buildScratchSize <- ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> IO ("dataSize" ::: Word64)
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("pSizeInfo"
::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
p ("pSizeInfo"
 ::: Ptr ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> Int
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize))
    ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
 -> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR))
-> ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
-> IO ("sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR)
forall a b. (a -> b) -> a -> b
$ ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
AccelerationStructureBuildSizesInfoKHR
             "dataSize" ::: Word64
accelerationStructureSize "dataSize" ::: Word64
updateScratchSize "dataSize" ::: Word64
buildScratchSize

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

instance Zero AccelerationStructureBuildSizesInfoKHR where
  zero :: "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
zero = ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> ("dataSize" ::: Word64)
-> "sizeInfo" ::: AccelerationStructureBuildSizesInfoKHR
AccelerationStructureBuildSizesInfoKHR
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero
           "dataSize" ::: Word64
forall a. Zero a => a
zero


data DeviceOrHostAddressKHR
  = DeviceAddress DeviceAddress
  | HostAddress (Ptr ())
  deriving (Int -> DeviceOrHostAddressKHR -> ShowS
[DeviceOrHostAddressKHR] -> ShowS
DeviceOrHostAddressKHR -> String
(Int -> DeviceOrHostAddressKHR -> ShowS)
-> (DeviceOrHostAddressKHR -> String)
-> ([DeviceOrHostAddressKHR] -> ShowS)
-> Show DeviceOrHostAddressKHR
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceOrHostAddressKHR] -> ShowS
$cshowList :: [DeviceOrHostAddressKHR] -> ShowS
show :: DeviceOrHostAddressKHR -> String
$cshow :: DeviceOrHostAddressKHR -> String
showsPrec :: Int -> DeviceOrHostAddressKHR -> ShowS
$cshowsPrec :: Int -> DeviceOrHostAddressKHR -> ShowS
Show)

instance ToCStruct DeviceOrHostAddressKHR where
  withCStruct :: DeviceOrHostAddressKHR
-> (Ptr DeviceOrHostAddressKHR -> IO b) -> IO b
withCStruct x :: DeviceOrHostAddressKHR
x f :: Ptr DeviceOrHostAddressKHR -> IO b
f = Int -> Int -> (Ptr DeviceOrHostAddressKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 8 8 ((Ptr DeviceOrHostAddressKHR -> IO b) -> IO b)
-> (Ptr DeviceOrHostAddressKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceOrHostAddressKHR
p -> Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceOrHostAddressKHR
p DeviceOrHostAddressKHR
x (Ptr DeviceOrHostAddressKHR -> IO b
f Ptr DeviceOrHostAddressKHR
p)
  pokeCStruct :: Ptr DeviceOrHostAddressKHR -> DeviceOrHostAddressKHR -> IO a -> IO a
  pokeCStruct :: Ptr DeviceOrHostAddressKHR
-> DeviceOrHostAddressKHR -> IO a -> IO a
pokeCStruct p :: Ptr DeviceOrHostAddressKHR
p = (((() -> IO a) -> IO a) -> (IO a -> () -> IO a) -> IO a -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO a -> () -> IO a
forall a b. a -> b -> a
const) (((() -> IO a) -> IO a) -> IO a -> IO a)
-> (DeviceOrHostAddressKHR -> (() -> IO a) -> IO a)
-> DeviceOrHostAddressKHR
-> IO a
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT a IO () -> (() -> IO a) -> IO a
forall k (r :: k) (m :: k -> *) a. ContT r m a -> (a -> m r) -> m r
runContT (ContT a IO () -> (() -> IO a) -> IO a)
-> (DeviceOrHostAddressKHR -> ContT a IO ())
-> DeviceOrHostAddressKHR
-> (() -> IO a)
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  \case
    DeviceAddress v :: "dataSize" ::: Word64
v -> IO () -> ContT a IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT a IO ()) -> IO () -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DeviceOrHostAddressKHR
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Ptr b
castPtr @_ @DeviceAddress Ptr DeviceOrHostAddressKHR
p) ("dataSize" ::: Word64
v)
    HostAddress v :: "data" ::: Ptr ()
v -> IO () -> ContT a IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT a IO ()) -> IO () -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DeviceOrHostAddressKHR -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Ptr b
castPtr @_ @(Ptr ()) Ptr DeviceOrHostAddressKHR
p) ("data" ::: Ptr ()
v)
  pokeZeroCStruct :: Ptr DeviceOrHostAddressKHR -> IO b -> IO b
  pokeZeroCStruct :: Ptr DeviceOrHostAddressKHR -> IO b -> IO b
pokeZeroCStruct _ f :: IO b
f = IO b
f
  cStructSize :: Int
cStructSize = 8
  cStructAlignment :: Int
cStructAlignment = 8

instance Zero DeviceOrHostAddressKHR where
  zero :: DeviceOrHostAddressKHR
zero = ("dataSize" ::: Word64) -> DeviceOrHostAddressKHR
DeviceAddress "dataSize" ::: Word64
forall a. Zero a => a
zero


data DeviceOrHostAddressConstKHR
  = DeviceAddressConst DeviceAddress
  | HostAddressConst (Ptr ())
  deriving (Int -> DeviceOrHostAddressConstKHR -> ShowS
[DeviceOrHostAddressConstKHR] -> ShowS
DeviceOrHostAddressConstKHR -> String
(Int -> DeviceOrHostAddressConstKHR -> ShowS)
-> (DeviceOrHostAddressConstKHR -> String)
-> ([DeviceOrHostAddressConstKHR] -> ShowS)
-> Show DeviceOrHostAddressConstKHR
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceOrHostAddressConstKHR] -> ShowS
$cshowList :: [DeviceOrHostAddressConstKHR] -> ShowS
show :: DeviceOrHostAddressConstKHR -> String
$cshow :: DeviceOrHostAddressConstKHR -> String
showsPrec :: Int -> DeviceOrHostAddressConstKHR -> ShowS
$cshowsPrec :: Int -> DeviceOrHostAddressConstKHR -> ShowS
Show)

instance ToCStruct DeviceOrHostAddressConstKHR where
  withCStruct :: DeviceOrHostAddressConstKHR
-> (Ptr DeviceOrHostAddressConstKHR -> IO b) -> IO b
withCStruct x :: DeviceOrHostAddressConstKHR
x f :: Ptr DeviceOrHostAddressConstKHR -> IO b
f = Int -> Int -> (Ptr DeviceOrHostAddressConstKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 8 8 ((Ptr DeviceOrHostAddressConstKHR -> IO b) -> IO b)
-> (Ptr DeviceOrHostAddressConstKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceOrHostAddressConstKHR
p -> Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceOrHostAddressConstKHR
p DeviceOrHostAddressConstKHR
x (Ptr DeviceOrHostAddressConstKHR -> IO b
f Ptr DeviceOrHostAddressConstKHR
p)
  pokeCStruct :: Ptr DeviceOrHostAddressConstKHR -> DeviceOrHostAddressConstKHR -> IO a -> IO a
  pokeCStruct :: Ptr DeviceOrHostAddressConstKHR
-> DeviceOrHostAddressConstKHR -> IO a -> IO a
pokeCStruct p :: Ptr DeviceOrHostAddressConstKHR
p = (((() -> IO a) -> IO a) -> (IO a -> () -> IO a) -> IO a -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO a -> () -> IO a
forall a b. a -> b -> a
const) (((() -> IO a) -> IO a) -> IO a -> IO a)
-> (DeviceOrHostAddressConstKHR -> (() -> IO a) -> IO a)
-> DeviceOrHostAddressConstKHR
-> IO a
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT a IO () -> (() -> IO a) -> IO a
forall k (r :: k) (m :: k -> *) a. ContT r m a -> (a -> m r) -> m r
runContT (ContT a IO () -> (() -> IO a) -> IO a)
-> (DeviceOrHostAddressConstKHR -> ContT a IO ())
-> DeviceOrHostAddressConstKHR
-> (() -> IO a)
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  \case
    DeviceAddressConst v :: "dataSize" ::: Word64
v -> IO () -> ContT a IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT a IO ()) -> IO () -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ ("pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64))
-> ("dataSize" ::: Word64) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DeviceOrHostAddressConstKHR
-> "pIndirectDeviceAddresses" ::: Ptr ("dataSize" ::: Word64)
forall a b. Ptr a -> Ptr b
castPtr @_ @DeviceAddress Ptr DeviceOrHostAddressConstKHR
p) ("dataSize" ::: Word64
v)
    HostAddressConst v :: "data" ::: Ptr ()
v -> IO () -> ContT a IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT a IO ()) -> IO () -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DeviceOrHostAddressConstKHR -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Ptr b
castPtr @_ @(Ptr ()) Ptr DeviceOrHostAddressConstKHR
p) ("data" ::: Ptr ()
v)
  pokeZeroCStruct :: Ptr DeviceOrHostAddressConstKHR -> IO b -> IO b
  pokeZeroCStruct :: Ptr DeviceOrHostAddressConstKHR -> IO b -> IO b
pokeZeroCStruct _ f :: IO b
f = IO b
f
  cStructSize :: Int
cStructSize = 8
  cStructAlignment :: Int
cStructAlignment = 8

instance Zero DeviceOrHostAddressConstKHR where
  zero :: DeviceOrHostAddressConstKHR
zero = ("dataSize" ::: Word64) -> DeviceOrHostAddressConstKHR
DeviceAddressConst "dataSize" ::: Word64
forall a. Zero a => a
zero


data AccelerationStructureGeometryDataKHR
  = Triangles AccelerationStructureGeometryTrianglesDataKHR
  | Aabbs AccelerationStructureGeometryAabbsDataKHR
  | Instances AccelerationStructureGeometryInstancesDataKHR
  deriving (Int -> AccelerationStructureGeometryDataKHR -> ShowS
[AccelerationStructureGeometryDataKHR] -> ShowS
AccelerationStructureGeometryDataKHR -> String
(Int -> AccelerationStructureGeometryDataKHR -> ShowS)
-> (AccelerationStructureGeometryDataKHR -> String)
-> ([AccelerationStructureGeometryDataKHR] -> ShowS)
-> Show AccelerationStructureGeometryDataKHR
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccelerationStructureGeometryDataKHR] -> ShowS
$cshowList :: [AccelerationStructureGeometryDataKHR] -> ShowS
show :: AccelerationStructureGeometryDataKHR -> String
$cshow :: AccelerationStructureGeometryDataKHR -> String
showsPrec :: Int -> AccelerationStructureGeometryDataKHR -> ShowS
$cshowsPrec :: Int -> AccelerationStructureGeometryDataKHR -> ShowS
Show)

instance ToCStruct AccelerationStructureGeometryDataKHR where
  withCStruct :: AccelerationStructureGeometryDataKHR
-> (Ptr AccelerationStructureGeometryDataKHR -> IO b) -> IO b
withCStruct x :: AccelerationStructureGeometryDataKHR
x f :: Ptr AccelerationStructureGeometryDataKHR -> IO b
f = Int
-> Int
-> (Ptr AccelerationStructureGeometryDataKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr AccelerationStructureGeometryDataKHR -> IO b) -> IO b)
-> (Ptr AccelerationStructureGeometryDataKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr AccelerationStructureGeometryDataKHR
p -> Ptr AccelerationStructureGeometryDataKHR
-> AccelerationStructureGeometryDataKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AccelerationStructureGeometryDataKHR
p AccelerationStructureGeometryDataKHR
x (Ptr AccelerationStructureGeometryDataKHR -> IO b
f Ptr AccelerationStructureGeometryDataKHR
p)
  pokeCStruct :: Ptr AccelerationStructureGeometryDataKHR -> AccelerationStructureGeometryDataKHR -> IO a -> IO a
  pokeCStruct :: Ptr AccelerationStructureGeometryDataKHR
-> AccelerationStructureGeometryDataKHR -> IO a -> IO a
pokeCStruct p :: Ptr AccelerationStructureGeometryDataKHR
p = (((() -> IO a) -> IO a) -> (IO a -> () -> IO a) -> IO a -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO a -> () -> IO a
forall a b. a -> b -> a
const) (((() -> IO a) -> IO a) -> IO a -> IO a)
-> (AccelerationStructureGeometryDataKHR -> (() -> IO a) -> IO a)
-> AccelerationStructureGeometryDataKHR
-> IO a
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT a IO () -> (() -> IO a) -> IO a
forall k (r :: k) (m :: k -> *) a. ContT r m a -> (a -> m r) -> m r
runContT (ContT a IO () -> (() -> IO a) -> IO a)
-> (AccelerationStructureGeometryDataKHR -> ContT a IO ())
-> AccelerationStructureGeometryDataKHR
-> (() -> IO a)
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.  \case
    Triangles v :: AccelerationStructureGeometryTrianglesDataKHR
v -> ((() -> IO a) -> IO a) -> ContT a IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO a) -> IO a) -> ContT a IO ())
-> ((() -> IO a) -> IO a) -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryTrianglesDataKHR
-> AccelerationStructureGeometryTrianglesDataKHR -> IO a -> IO a
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AccelerationStructureGeometryDataKHR
-> Ptr AccelerationStructureGeometryTrianglesDataKHR
forall a b. Ptr a -> Ptr b
castPtr @_ @AccelerationStructureGeometryTrianglesDataKHR Ptr AccelerationStructureGeometryDataKHR
p) (AccelerationStructureGeometryTrianglesDataKHR
v) (IO a -> IO a) -> ((() -> IO a) -> IO a) -> (() -> IO a) -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO a) -> () -> IO a
forall a b. (a -> b) -> a -> b
$ ())
    Aabbs v :: AccelerationStructureGeometryAabbsDataKHR
v -> ((() -> IO a) -> IO a) -> ContT a IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO a) -> IO a) -> ContT a IO ())
-> ((() -> IO a) -> IO a) -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryAabbsDataKHR
-> AccelerationStructureGeometryAabbsDataKHR -> IO a -> IO a
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AccelerationStructureGeometryDataKHR
-> Ptr AccelerationStructureGeometryAabbsDataKHR
forall a b. Ptr a -> Ptr b
castPtr @_ @AccelerationStructureGeometryAabbsDataKHR Ptr AccelerationStructureGeometryDataKHR
p) (AccelerationStructureGeometryAabbsDataKHR
v) (IO a -> IO a) -> ((() -> IO a) -> IO a) -> (() -> IO a) -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO a) -> () -> IO a
forall a b. (a -> b) -> a -> b
$ ())
    Instances v :: AccelerationStructureGeometryInstancesDataKHR
v -> ((() -> IO a) -> IO a) -> ContT a IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO a) -> IO a) -> ContT a IO ())
-> ((() -> IO a) -> IO a) -> ContT a IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AccelerationStructureGeometryInstancesDataKHR
-> AccelerationStructureGeometryInstancesDataKHR -> IO a -> IO a
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr AccelerationStructureGeometryDataKHR
-> Ptr AccelerationStructureGeometryInstancesDataKHR
forall a b. Ptr a -> Ptr b
castPtr @_ @AccelerationStructureGeometryInstancesDataKHR Ptr AccelerationStructureGeometryDataKHR
p) (AccelerationStructureGeometryInstancesDataKHR
v) (IO a -> IO a) -> ((() -> IO a) -> IO a) -> (() -> IO a) -> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO a) -> () -> IO a
forall a b. (a -> b) -> a -> b
$ ())
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryDataKHR -> IO b -> IO b
  pokeZeroCStruct :: Ptr AccelerationStructureGeometryDataKHR -> IO b -> IO b
pokeZeroCStruct _ f :: IO b
f = IO b
f
  cStructSize :: Int
cStructSize = 64
  cStructAlignment :: Int
cStructAlignment = 8

instance Zero AccelerationStructureGeometryDataKHR where
  zero :: AccelerationStructureGeometryDataKHR
zero = AccelerationStructureGeometryTrianglesDataKHR
-> AccelerationStructureGeometryDataKHR
Triangles AccelerationStructureGeometryTrianglesDataKHR
forall a. Zero a => a
zero


type GeometryInstanceFlagsKHR = GeometryInstanceFlagBitsKHR

-- | VkGeometryInstanceFlagBitsKHR - Instance flag bits
--
-- = Description
--
-- 'GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR' and
-- 'GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR' /must/ not be used in the same
-- flag.
--
-- = See Also
--
-- 'GeometryInstanceFlagsKHR'
newtype GeometryInstanceFlagBitsKHR = GeometryInstanceFlagBitsKHR Flags
  deriving newtype (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
(GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> Eq GeometryInstanceFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c/= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
== :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c== :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
Eq, Eq GeometryInstanceFlagsKHR
Eq GeometryInstanceFlagsKHR =>
(GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Ordering)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR
    -> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR
    -> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> Ord GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Ordering
GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
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 :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$cmin :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
max :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$cmax :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
>= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c>= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
> :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c> :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
<= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c<= :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
< :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
$c< :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Bool
compare :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Ordering
$ccompare :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> Ordering
$cp1Ord :: Eq GeometryInstanceFlagsKHR
Ord, Ptr b -> Int -> IO GeometryInstanceFlagsKHR
Ptr b -> Int -> GeometryInstanceFlagsKHR -> IO ()
Ptr GeometryInstanceFlagsKHR -> IO GeometryInstanceFlagsKHR
Ptr GeometryInstanceFlagsKHR -> Int -> IO GeometryInstanceFlagsKHR
Ptr GeometryInstanceFlagsKHR
-> Int -> GeometryInstanceFlagsKHR -> IO ()
Ptr GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> IO ()
GeometryInstanceFlagsKHR -> Int
(GeometryInstanceFlagsKHR -> Int)
-> (GeometryInstanceFlagsKHR -> Int)
-> (Ptr GeometryInstanceFlagsKHR
    -> Int -> IO GeometryInstanceFlagsKHR)
-> (Ptr GeometryInstanceFlagsKHR
    -> Int -> GeometryInstanceFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO GeometryInstanceFlagsKHR)
-> (forall b. Ptr b -> Int -> GeometryInstanceFlagsKHR -> IO ())
-> (Ptr GeometryInstanceFlagsKHR -> IO GeometryInstanceFlagsKHR)
-> (Ptr GeometryInstanceFlagsKHR
    -> GeometryInstanceFlagsKHR -> IO ())
-> Storable GeometryInstanceFlagsKHR
forall b. Ptr b -> Int -> IO GeometryInstanceFlagsKHR
forall b. Ptr b -> Int -> GeometryInstanceFlagsKHR -> 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 GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> IO ()
$cpoke :: Ptr GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR -> IO ()
peek :: Ptr GeometryInstanceFlagsKHR -> IO GeometryInstanceFlagsKHR
$cpeek :: Ptr GeometryInstanceFlagsKHR -> IO GeometryInstanceFlagsKHR
pokeByteOff :: Ptr b -> Int -> GeometryInstanceFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> GeometryInstanceFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO GeometryInstanceFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO GeometryInstanceFlagsKHR
pokeElemOff :: Ptr GeometryInstanceFlagsKHR
-> Int -> GeometryInstanceFlagsKHR -> IO ()
$cpokeElemOff :: Ptr GeometryInstanceFlagsKHR
-> Int -> GeometryInstanceFlagsKHR -> IO ()
peekElemOff :: Ptr GeometryInstanceFlagsKHR -> Int -> IO GeometryInstanceFlagsKHR
$cpeekElemOff :: Ptr GeometryInstanceFlagsKHR -> Int -> IO GeometryInstanceFlagsKHR
alignment :: GeometryInstanceFlagsKHR -> Int
$calignment :: GeometryInstanceFlagsKHR -> Int
sizeOf :: GeometryInstanceFlagsKHR -> Int
$csizeOf :: GeometryInstanceFlagsKHR -> Int
Storable, GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR -> Zero GeometryInstanceFlagsKHR
forall a. a -> Zero a
zero :: GeometryInstanceFlagsKHR
$czero :: GeometryInstanceFlagsKHR
Zero, Eq GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR
Eq GeometryInstanceFlagsKHR =>
(GeometryInstanceFlagsKHR
 -> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR
    -> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR
    -> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> GeometryInstanceFlagsKHR
-> (Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> Bool)
-> (GeometryInstanceFlagsKHR -> Maybe Int)
-> (GeometryInstanceFlagsKHR -> Int)
-> (GeometryInstanceFlagsKHR -> Bool)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR)
-> (GeometryInstanceFlagsKHR -> Int)
-> Bits GeometryInstanceFlagsKHR
Int -> GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR -> Bool
GeometryInstanceFlagsKHR -> Int
GeometryInstanceFlagsKHR -> Maybe Int
GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR -> Int -> Bool
GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: GeometryInstanceFlagsKHR -> Int
$cpopCount :: GeometryInstanceFlagsKHR -> Int
rotateR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$crotateR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
rotateL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$crotateL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
unsafeShiftR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cunsafeShiftR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
shiftR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cshiftR :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
unsafeShiftL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cunsafeShiftL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
shiftL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cshiftL :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
isSigned :: GeometryInstanceFlagsKHR -> Bool
$cisSigned :: GeometryInstanceFlagsKHR -> Bool
bitSize :: GeometryInstanceFlagsKHR -> Int
$cbitSize :: GeometryInstanceFlagsKHR -> Int
bitSizeMaybe :: GeometryInstanceFlagsKHR -> Maybe Int
$cbitSizeMaybe :: GeometryInstanceFlagsKHR -> Maybe Int
testBit :: GeometryInstanceFlagsKHR -> Int -> Bool
$ctestBit :: GeometryInstanceFlagsKHR -> Int -> Bool
complementBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$ccomplementBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
clearBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cclearBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
setBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$csetBit :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
bit :: Int -> GeometryInstanceFlagsKHR
$cbit :: Int -> GeometryInstanceFlagsKHR
zeroBits :: GeometryInstanceFlagsKHR
$czeroBits :: GeometryInstanceFlagsKHR
rotate :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$crotate :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
shift :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
$cshift :: GeometryInstanceFlagsKHR -> Int -> GeometryInstanceFlagsKHR
complement :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$ccomplement :: GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
xor :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$cxor :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
.|. :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$c.|. :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
.&. :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$c.&. :: GeometryInstanceFlagsKHR
-> GeometryInstanceFlagsKHR -> GeometryInstanceFlagsKHR
$cp1Bits :: Eq GeometryInstanceFlagsKHR
Bits, Bits GeometryInstanceFlagsKHR
Bits GeometryInstanceFlagsKHR =>
(GeometryInstanceFlagsKHR -> Int)
-> (GeometryInstanceFlagsKHR -> Int)
-> (GeometryInstanceFlagsKHR -> Int)
-> FiniteBits GeometryInstanceFlagsKHR
GeometryInstanceFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: GeometryInstanceFlagsKHR -> Int
$ccountTrailingZeros :: GeometryInstanceFlagsKHR -> Int
countLeadingZeros :: GeometryInstanceFlagsKHR -> Int
$ccountLeadingZeros :: GeometryInstanceFlagsKHR -> Int
finiteBitSize :: GeometryInstanceFlagsKHR -> Int
$cfiniteBitSize :: GeometryInstanceFlagsKHR -> Int
$cp1FiniteBits :: Bits GeometryInstanceFlagsKHR
FiniteBits)

-- | 'GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR' disables face
-- culling for this instance.
pattern $bGEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR :: GeometryInstanceFlagsKHR
$mGEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR :: forall r.
GeometryInstanceFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR    = GeometryInstanceFlagBitsKHR 0x00000001
-- | 'GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR' indicates
-- that the front face of the triangle for culling purposes is the face
-- that is counter clockwise in object space relative to the ray origin.
-- Because the facing is determined in object space, an instance transform
-- matrix does not change the winding, but a geometry transform does.
pattern $bGEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR :: GeometryInstanceFlagsKHR
$mGEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR :: forall r.
GeometryInstanceFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = GeometryInstanceFlagBitsKHR 0x00000002
-- | 'GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR' causes this instance to act as
-- though 'GEOMETRY_OPAQUE_BIT_KHR' were specified on all geometries
-- referenced by this instance. This behavior /can/ be overridden by the
-- SPIR-V @NoOpaqueKHR@ ray flag.
pattern $bGEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR :: GeometryInstanceFlagsKHR
$mGEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR :: forall r.
GeometryInstanceFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR                    = GeometryInstanceFlagBitsKHR 0x00000004
-- | 'GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR' causes this instance to act
-- as though 'GEOMETRY_OPAQUE_BIT_KHR' were not specified on all geometries
-- referenced by this instance. This behavior /can/ be overridden by the
-- SPIR-V @OpaqueKHR@ ray flag.
pattern $bGEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR :: GeometryInstanceFlagsKHR
$mGEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR :: forall r.
GeometryInstanceFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR                 = GeometryInstanceFlagBitsKHR 0x00000008

conNameGeometryInstanceFlagBitsKHR :: String
conNameGeometryInstanceFlagBitsKHR :: String
conNameGeometryInstanceFlagBitsKHR = "GeometryInstanceFlagBitsKHR"

enumPrefixGeometryInstanceFlagBitsKHR :: String
enumPrefixGeometryInstanceFlagBitsKHR :: String
enumPrefixGeometryInstanceFlagBitsKHR = "GEOMETRY_INSTANCE_"

showTableGeometryInstanceFlagBitsKHR :: [(GeometryInstanceFlagBitsKHR, String)]
showTableGeometryInstanceFlagBitsKHR :: [(GeometryInstanceFlagsKHR, String)]
showTableGeometryInstanceFlagBitsKHR =
  [ (GeometryInstanceFlagsKHR
GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR   , "TRIANGLE_FACING_CULL_DISABLE_BIT_KHR")
  , (GeometryInstanceFlagsKHR
GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR, "TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR")
  , (GeometryInstanceFlagsKHR
GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR                   , "FORCE_OPAQUE_BIT_KHR")
  , (GeometryInstanceFlagsKHR
GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR                , "FORCE_NO_OPAQUE_BIT_KHR")
  ]

instance Show GeometryInstanceFlagBitsKHR where
  showsPrec :: Int -> GeometryInstanceFlagsKHR -> ShowS
showsPrec = String
-> [(GeometryInstanceFlagsKHR, String)]
-> String
-> (GeometryInstanceFlagsKHR -> "firstQuery" ::: Word32)
-> (("firstQuery" ::: Word32) -> ShowS)
-> Int
-> GeometryInstanceFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixGeometryInstanceFlagBitsKHR
                            [(GeometryInstanceFlagsKHR, String)]
showTableGeometryInstanceFlagBitsKHR
                            String
conNameGeometryInstanceFlagBitsKHR
                            (\(GeometryInstanceFlagBitsKHR x :: "firstQuery" ::: Word32
x) -> "firstQuery" ::: Word32
x)
                            (\x :: "firstQuery" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("firstQuery" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "firstQuery" ::: Word32
x)

instance Read GeometryInstanceFlagBitsKHR where
  readPrec :: ReadPrec GeometryInstanceFlagsKHR
readPrec = String
-> [(GeometryInstanceFlagsKHR, String)]
-> String
-> (("firstQuery" ::: Word32) -> GeometryInstanceFlagsKHR)
-> ReadPrec GeometryInstanceFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixGeometryInstanceFlagBitsKHR
                          [(GeometryInstanceFlagsKHR, String)]
showTableGeometryInstanceFlagBitsKHR
                          String
conNameGeometryInstanceFlagBitsKHR
                          ("firstQuery" ::: Word32) -> GeometryInstanceFlagsKHR
GeometryInstanceFlagBitsKHR


type GeometryFlagsKHR = GeometryFlagBitsKHR

-- | VkGeometryFlagBitsKHR - Bitmask specifying additional parameters for a
-- geometry
--
-- = See Also
--
-- 'GeometryFlagsKHR'
newtype GeometryFlagBitsKHR = GeometryFlagBitsKHR Flags
  deriving newtype (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
(GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> Eq GeometryFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c/= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
== :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c== :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
Eq, Eq GeometryFlagsKHR
Eq GeometryFlagsKHR =>
(GeometryFlagsKHR -> GeometryFlagsKHR -> Ordering)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR)
-> Ord GeometryFlagsKHR
GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
GeometryFlagsKHR -> GeometryFlagsKHR -> Ordering
GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
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 :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$cmin :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
max :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$cmax :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
>= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c>= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
> :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c> :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
<= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c<= :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
< :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
$c< :: GeometryFlagsKHR -> GeometryFlagsKHR -> Bool
compare :: GeometryFlagsKHR -> GeometryFlagsKHR -> Ordering
$ccompare :: GeometryFlagsKHR -> GeometryFlagsKHR -> Ordering
$cp1Ord :: Eq GeometryFlagsKHR
Ord, Ptr b -> Int -> IO GeometryFlagsKHR
Ptr b -> Int -> GeometryFlagsKHR -> IO ()
Ptr GeometryFlagsKHR -> IO GeometryFlagsKHR
Ptr GeometryFlagsKHR -> Int -> IO GeometryFlagsKHR
Ptr GeometryFlagsKHR -> Int -> GeometryFlagsKHR -> IO ()
Ptr GeometryFlagsKHR -> GeometryFlagsKHR -> IO ()
GeometryFlagsKHR -> Int
(GeometryFlagsKHR -> Int)
-> (GeometryFlagsKHR -> Int)
-> (Ptr GeometryFlagsKHR -> Int -> IO GeometryFlagsKHR)
-> (Ptr GeometryFlagsKHR -> Int -> GeometryFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO GeometryFlagsKHR)
-> (forall b. Ptr b -> Int -> GeometryFlagsKHR -> IO ())
-> (Ptr GeometryFlagsKHR -> IO GeometryFlagsKHR)
-> (Ptr GeometryFlagsKHR -> GeometryFlagsKHR -> IO ())
-> Storable GeometryFlagsKHR
forall b. Ptr b -> Int -> IO GeometryFlagsKHR
forall b. Ptr b -> Int -> GeometryFlagsKHR -> 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 GeometryFlagsKHR -> GeometryFlagsKHR -> IO ()
$cpoke :: Ptr GeometryFlagsKHR -> GeometryFlagsKHR -> IO ()
peek :: Ptr GeometryFlagsKHR -> IO GeometryFlagsKHR
$cpeek :: Ptr GeometryFlagsKHR -> IO GeometryFlagsKHR
pokeByteOff :: Ptr b -> Int -> GeometryFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> GeometryFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO GeometryFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO GeometryFlagsKHR
pokeElemOff :: Ptr GeometryFlagsKHR -> Int -> GeometryFlagsKHR -> IO ()
$cpokeElemOff :: Ptr GeometryFlagsKHR -> Int -> GeometryFlagsKHR -> IO ()
peekElemOff :: Ptr GeometryFlagsKHR -> Int -> IO GeometryFlagsKHR
$cpeekElemOff :: Ptr GeometryFlagsKHR -> Int -> IO GeometryFlagsKHR
alignment :: GeometryFlagsKHR -> Int
$calignment :: GeometryFlagsKHR -> Int
sizeOf :: GeometryFlagsKHR -> Int
$csizeOf :: GeometryFlagsKHR -> Int
Storable, GeometryFlagsKHR
GeometryFlagsKHR -> Zero GeometryFlagsKHR
forall a. a -> Zero a
zero :: GeometryFlagsKHR
$czero :: GeometryFlagsKHR
Zero, Eq GeometryFlagsKHR
GeometryFlagsKHR
Eq GeometryFlagsKHR =>
(GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> GeometryFlagsKHR
-> (Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> Bool)
-> (GeometryFlagsKHR -> Maybe Int)
-> (GeometryFlagsKHR -> Int)
-> (GeometryFlagsKHR -> Bool)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int -> GeometryFlagsKHR)
-> (GeometryFlagsKHR -> Int)
-> Bits GeometryFlagsKHR
Int -> GeometryFlagsKHR
GeometryFlagsKHR -> Bool
GeometryFlagsKHR -> Int
GeometryFlagsKHR -> Maybe Int
GeometryFlagsKHR -> GeometryFlagsKHR
GeometryFlagsKHR -> Int -> Bool
GeometryFlagsKHR -> Int -> GeometryFlagsKHR
GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: GeometryFlagsKHR -> Int
$cpopCount :: GeometryFlagsKHR -> Int
rotateR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$crotateR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
rotateL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$crotateL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
unsafeShiftR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cunsafeShiftR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
shiftR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cshiftR :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
unsafeShiftL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cunsafeShiftL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
shiftL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cshiftL :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
isSigned :: GeometryFlagsKHR -> Bool
$cisSigned :: GeometryFlagsKHR -> Bool
bitSize :: GeometryFlagsKHR -> Int
$cbitSize :: GeometryFlagsKHR -> Int
bitSizeMaybe :: GeometryFlagsKHR -> Maybe Int
$cbitSizeMaybe :: GeometryFlagsKHR -> Maybe Int
testBit :: GeometryFlagsKHR -> Int -> Bool
$ctestBit :: GeometryFlagsKHR -> Int -> Bool
complementBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$ccomplementBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
clearBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cclearBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
setBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$csetBit :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
bit :: Int -> GeometryFlagsKHR
$cbit :: Int -> GeometryFlagsKHR
zeroBits :: GeometryFlagsKHR
$czeroBits :: GeometryFlagsKHR
rotate :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$crotate :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
shift :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
$cshift :: GeometryFlagsKHR -> Int -> GeometryFlagsKHR
complement :: GeometryFlagsKHR -> GeometryFlagsKHR
$ccomplement :: GeometryFlagsKHR -> GeometryFlagsKHR
xor :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$cxor :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
.|. :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$c.|. :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
.&. :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$c.&. :: GeometryFlagsKHR -> GeometryFlagsKHR -> GeometryFlagsKHR
$cp1Bits :: Eq GeometryFlagsKHR
Bits, Bits GeometryFlagsKHR
Bits GeometryFlagsKHR =>
(GeometryFlagsKHR -> Int)
-> (GeometryFlagsKHR -> Int)
-> (GeometryFlagsKHR -> Int)
-> FiniteBits GeometryFlagsKHR
GeometryFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: GeometryFlagsKHR -> Int
$ccountTrailingZeros :: GeometryFlagsKHR -> Int
countLeadingZeros :: GeometryFlagsKHR -> Int
$ccountLeadingZeros :: GeometryFlagsKHR -> Int
finiteBitSize :: GeometryFlagsKHR -> Int
$cfiniteBitSize :: GeometryFlagsKHR -> Int
$cp1FiniteBits :: Bits GeometryFlagsKHR
FiniteBits)

-- | 'GEOMETRY_OPAQUE_BIT_KHR' indicates that this geometry does not invoke
-- the any-hit shaders even if present in a hit group.
pattern $bGEOMETRY_OPAQUE_BIT_KHR :: GeometryFlagsKHR
$mGEOMETRY_OPAQUE_BIT_KHR :: forall r. GeometryFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_OPAQUE_BIT_KHR                          = GeometryFlagBitsKHR 0x00000001
-- | 'GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR' indicates that the
-- implementation /must/ only call the any-hit shader a single time for
-- each primitive in this geometry. If this bit is absent an implementation
-- /may/ invoke the any-hit shader more than once for this geometry.
pattern $bGEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR :: GeometryFlagsKHR
$mGEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR :: forall r. GeometryFlagsKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = GeometryFlagBitsKHR 0x00000002

conNameGeometryFlagBitsKHR :: String
conNameGeometryFlagBitsKHR :: String
conNameGeometryFlagBitsKHR = "GeometryFlagBitsKHR"

enumPrefixGeometryFlagBitsKHR :: String
enumPrefixGeometryFlagBitsKHR :: String
enumPrefixGeometryFlagBitsKHR = "GEOMETRY_"

showTableGeometryFlagBitsKHR :: [(GeometryFlagBitsKHR, String)]
showTableGeometryFlagBitsKHR :: [(GeometryFlagsKHR, String)]
showTableGeometryFlagBitsKHR =
  [ (GeometryFlagsKHR
GEOMETRY_OPAQUE_BIT_KHR                         , "OPAQUE_BIT_KHR")
  , (GeometryFlagsKHR
GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR, "NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR")
  ]

instance Show GeometryFlagBitsKHR where
  showsPrec :: Int -> GeometryFlagsKHR -> ShowS
showsPrec = String
-> [(GeometryFlagsKHR, String)]
-> String
-> (GeometryFlagsKHR -> "firstQuery" ::: Word32)
-> (("firstQuery" ::: Word32) -> ShowS)
-> Int
-> GeometryFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixGeometryFlagBitsKHR
                            [(GeometryFlagsKHR, String)]
showTableGeometryFlagBitsKHR
                            String
conNameGeometryFlagBitsKHR
                            (\(GeometryFlagBitsKHR x :: "firstQuery" ::: Word32
x) -> "firstQuery" ::: Word32
x)
                            (\x :: "firstQuery" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("firstQuery" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "firstQuery" ::: Word32
x)

instance Read GeometryFlagBitsKHR where
  readPrec :: ReadPrec GeometryFlagsKHR
readPrec = String
-> [(GeometryFlagsKHR, String)]
-> String
-> (("firstQuery" ::: Word32) -> GeometryFlagsKHR)
-> ReadPrec GeometryFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixGeometryFlagBitsKHR
                          [(GeometryFlagsKHR, String)]
showTableGeometryFlagBitsKHR
                          String
conNameGeometryFlagBitsKHR
                          ("firstQuery" ::: Word32) -> GeometryFlagsKHR
GeometryFlagBitsKHR


type BuildAccelerationStructureFlagsKHR = BuildAccelerationStructureFlagBitsKHR

-- | VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional
-- parameters for acceleration structure builds
--
-- = Description
--
-- Note
--
-- 'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR' and
-- 'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR' /may/ take more
-- time and memory than a normal build, and so /should/ only be used when
-- those features are needed.
--
-- = See Also
--
-- 'BuildAccelerationStructureFlagsKHR'
newtype BuildAccelerationStructureFlagBitsKHR = BuildAccelerationStructureFlagBitsKHR Flags
  deriving newtype (BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
(BuildAccelerationStructureFlagsKHR
 -> BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> Bool)
-> Eq BuildAccelerationStructureFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c/= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
== :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c== :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
Eq, Eq BuildAccelerationStructureFlagsKHR
Eq BuildAccelerationStructureFlagsKHR =>
(BuildAccelerationStructureFlagsKHR
 -> BuildAccelerationStructureFlagsKHR -> Ordering)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR)
-> Ord BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Ordering
BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
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 :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$cmin :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
max :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$cmax :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
>= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c>= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
> :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c> :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
<= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c<= :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
< :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
$c< :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Bool
compare :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Ordering
$ccompare :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> Ordering
$cp1Ord :: Eq BuildAccelerationStructureFlagsKHR
Ord, Ptr b -> Int -> IO BuildAccelerationStructureFlagsKHR
Ptr b -> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
Ptr BuildAccelerationStructureFlagsKHR
-> IO BuildAccelerationStructureFlagsKHR
Ptr BuildAccelerationStructureFlagsKHR
-> Int -> IO BuildAccelerationStructureFlagsKHR
Ptr BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
Ptr BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> IO ()
BuildAccelerationStructureFlagsKHR -> Int
(BuildAccelerationStructureFlagsKHR -> Int)
-> (BuildAccelerationStructureFlagsKHR -> Int)
-> (Ptr BuildAccelerationStructureFlagsKHR
    -> Int -> IO BuildAccelerationStructureFlagsKHR)
-> (Ptr BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR -> IO ())
-> (forall b.
    Ptr b -> Int -> IO BuildAccelerationStructureFlagsKHR)
-> (forall b.
    Ptr b -> Int -> BuildAccelerationStructureFlagsKHR -> IO ())
-> (Ptr BuildAccelerationStructureFlagsKHR
    -> IO BuildAccelerationStructureFlagsKHR)
-> (Ptr BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR -> IO ())
-> Storable BuildAccelerationStructureFlagsKHR
forall b. Ptr b -> Int -> IO BuildAccelerationStructureFlagsKHR
forall b.
Ptr b -> Int -> BuildAccelerationStructureFlagsKHR -> 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 BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> IO ()
$cpoke :: Ptr BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR -> IO ()
peek :: Ptr BuildAccelerationStructureFlagsKHR
-> IO BuildAccelerationStructureFlagsKHR
$cpeek :: Ptr BuildAccelerationStructureFlagsKHR
-> IO BuildAccelerationStructureFlagsKHR
pokeByteOff :: Ptr b -> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO BuildAccelerationStructureFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BuildAccelerationStructureFlagsKHR
pokeElemOff :: Ptr BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
$cpokeElemOff :: Ptr BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR -> IO ()
peekElemOff :: Ptr BuildAccelerationStructureFlagsKHR
-> Int -> IO BuildAccelerationStructureFlagsKHR
$cpeekElemOff :: Ptr BuildAccelerationStructureFlagsKHR
-> Int -> IO BuildAccelerationStructureFlagsKHR
alignment :: BuildAccelerationStructureFlagsKHR -> Int
$calignment :: BuildAccelerationStructureFlagsKHR -> Int
sizeOf :: BuildAccelerationStructureFlagsKHR -> Int
$csizeOf :: BuildAccelerationStructureFlagsKHR -> Int
Storable, BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR
-> Zero BuildAccelerationStructureFlagsKHR
forall a. a -> Zero a
zero :: BuildAccelerationStructureFlagsKHR
$czero :: BuildAccelerationStructureFlagsKHR
Zero, Eq BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR
Eq BuildAccelerationStructureFlagsKHR =>
(BuildAccelerationStructureFlagsKHR
 -> BuildAccelerationStructureFlagsKHR
 -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> BuildAccelerationStructureFlagsKHR
-> (Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR -> Int -> Bool)
-> (BuildAccelerationStructureFlagsKHR -> Maybe Int)
-> (BuildAccelerationStructureFlagsKHR -> Int)
-> (BuildAccelerationStructureFlagsKHR -> Bool)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR
    -> Int -> BuildAccelerationStructureFlagsKHR)
-> (BuildAccelerationStructureFlagsKHR -> Int)
-> Bits BuildAccelerationStructureFlagsKHR
Int -> BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR -> Bool
BuildAccelerationStructureFlagsKHR -> Int
BuildAccelerationStructureFlagsKHR -> Maybe Int
BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR -> Int -> Bool
BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: BuildAccelerationStructureFlagsKHR -> Int
$cpopCount :: BuildAccelerationStructureFlagsKHR -> Int
rotateR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$crotateR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
rotateL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$crotateL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
unsafeShiftR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cunsafeShiftR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
shiftR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cshiftR :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
unsafeShiftL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cunsafeShiftL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
shiftL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cshiftL :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
isSigned :: BuildAccelerationStructureFlagsKHR -> Bool
$cisSigned :: BuildAccelerationStructureFlagsKHR -> Bool
bitSize :: BuildAccelerationStructureFlagsKHR -> Int
$cbitSize :: BuildAccelerationStructureFlagsKHR -> Int
bitSizeMaybe :: BuildAccelerationStructureFlagsKHR -> Maybe Int
$cbitSizeMaybe :: BuildAccelerationStructureFlagsKHR -> Maybe Int
testBit :: BuildAccelerationStructureFlagsKHR -> Int -> Bool
$ctestBit :: BuildAccelerationStructureFlagsKHR -> Int -> Bool
complementBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$ccomplementBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
clearBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cclearBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
setBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$csetBit :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
bit :: Int -> BuildAccelerationStructureFlagsKHR
$cbit :: Int -> BuildAccelerationStructureFlagsKHR
zeroBits :: BuildAccelerationStructureFlagsKHR
$czeroBits :: BuildAccelerationStructureFlagsKHR
rotate :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$crotate :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
shift :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
$cshift :: BuildAccelerationStructureFlagsKHR
-> Int -> BuildAccelerationStructureFlagsKHR
complement :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$ccomplement :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
xor :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$cxor :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
.|. :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$c.|. :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
.&. :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$c.&. :: BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
-> BuildAccelerationStructureFlagsKHR
$cp1Bits :: Eq BuildAccelerationStructureFlagsKHR
Bits, Bits BuildAccelerationStructureFlagsKHR
Bits BuildAccelerationStructureFlagsKHR =>
(BuildAccelerationStructureFlagsKHR -> Int)
-> (BuildAccelerationStructureFlagsKHR -> Int)
-> (BuildAccelerationStructureFlagsKHR -> Int)
-> FiniteBits BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: BuildAccelerationStructureFlagsKHR -> Int
$ccountTrailingZeros :: BuildAccelerationStructureFlagsKHR -> Int
countLeadingZeros :: BuildAccelerationStructureFlagsKHR -> Int
$ccountLeadingZeros :: BuildAccelerationStructureFlagsKHR -> Int
finiteBitSize :: BuildAccelerationStructureFlagsKHR -> Int
$cfiniteBitSize :: BuildAccelerationStructureFlagsKHR -> Int
$cp1FiniteBits :: Bits BuildAccelerationStructureFlagsKHR
FiniteBits)

-- | 'BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR' indicates that the
-- specified acceleration structure /can/ be updated with @update@ of
-- 'Vulkan.Core10.FundamentalTypes.TRUE' in
-- 'cmdBuildAccelerationStructuresKHR' or
-- 'Vulkan.Extensions.VK_NV_ray_tracing.cmdBuildAccelerationStructureNV' .
pattern $bBUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR :: BuildAccelerationStructureFlagsKHR
$mBUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR :: forall r.
BuildAccelerationStructureFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR      = BuildAccelerationStructureFlagBitsKHR 0x00000001
-- | 'BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR' indicates that
-- the specified acceleration structure /can/ act as the source for a copy
-- acceleration structure command with @mode@ of
-- 'COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR' to produce a compacted
-- acceleration structure.
pattern $bBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR :: BuildAccelerationStructureFlagsKHR
$mBUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR :: forall r.
BuildAccelerationStructureFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR  = BuildAccelerationStructureFlagBitsKHR 0x00000002
-- | 'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR' indicates that
-- the given acceleration structure build /should/ prioritize trace
-- performance over build time.
pattern $bBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR :: BuildAccelerationStructureFlagsKHR
$mBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR :: forall r.
BuildAccelerationStructureFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR = BuildAccelerationStructureFlagBitsKHR 0x00000004
-- | 'BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR' indicates that
-- the given acceleration structure build /should/ prioritize build time
-- over trace performance.
pattern $bBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR :: BuildAccelerationStructureFlagsKHR
$mBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR :: forall r.
BuildAccelerationStructureFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = BuildAccelerationStructureFlagBitsKHR 0x00000008
-- | 'BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR' indicates that this
-- acceleration structure /should/ minimize the size of the scratch memory
-- and the final result build, potentially at the expense of build time or
-- trace performance.
pattern $bBUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR :: BuildAccelerationStructureFlagsKHR
$mBUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR :: forall r.
BuildAccelerationStructureFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR        = BuildAccelerationStructureFlagBitsKHR 0x00000010

conNameBuildAccelerationStructureFlagBitsKHR :: String
conNameBuildAccelerationStructureFlagBitsKHR :: String
conNameBuildAccelerationStructureFlagBitsKHR = "BuildAccelerationStructureFlagBitsKHR"

enumPrefixBuildAccelerationStructureFlagBitsKHR :: String
enumPrefixBuildAccelerationStructureFlagBitsKHR :: String
enumPrefixBuildAccelerationStructureFlagBitsKHR = "BUILD_ACCELERATION_STRUCTURE_"

showTableBuildAccelerationStructureFlagBitsKHR :: [(BuildAccelerationStructureFlagBitsKHR, String)]
showTableBuildAccelerationStructureFlagBitsKHR :: [(BuildAccelerationStructureFlagsKHR, String)]
showTableBuildAccelerationStructureFlagBitsKHR =
  [ (BuildAccelerationStructureFlagsKHR
BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR     , "ALLOW_UPDATE_BIT_KHR")
  , (BuildAccelerationStructureFlagsKHR
BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR , "ALLOW_COMPACTION_BIT_KHR")
  , (BuildAccelerationStructureFlagsKHR
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, "PREFER_FAST_TRACE_BIT_KHR")
  , (BuildAccelerationStructureFlagsKHR
BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR, "PREFER_FAST_BUILD_BIT_KHR")
  , (BuildAccelerationStructureFlagsKHR
BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR       , "LOW_MEMORY_BIT_KHR")
  ]

instance Show BuildAccelerationStructureFlagBitsKHR where
  showsPrec :: Int -> BuildAccelerationStructureFlagsKHR -> ShowS
showsPrec = String
-> [(BuildAccelerationStructureFlagsKHR, String)]
-> String
-> (BuildAccelerationStructureFlagsKHR -> "firstQuery" ::: Word32)
-> (("firstQuery" ::: Word32) -> ShowS)
-> Int
-> BuildAccelerationStructureFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixBuildAccelerationStructureFlagBitsKHR
                            [(BuildAccelerationStructureFlagsKHR, String)]
showTableBuildAccelerationStructureFlagBitsKHR
                            String
conNameBuildAccelerationStructureFlagBitsKHR
                            (\(BuildAccelerationStructureFlagBitsKHR x :: "firstQuery" ::: Word32
x) -> "firstQuery" ::: Word32
x)
                            (\x :: "firstQuery" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("firstQuery" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "firstQuery" ::: Word32
x)

instance Read BuildAccelerationStructureFlagBitsKHR where
  readPrec :: ReadPrec BuildAccelerationStructureFlagsKHR
readPrec = String
-> [(BuildAccelerationStructureFlagsKHR, String)]
-> String
-> (("firstQuery" ::: Word32)
    -> BuildAccelerationStructureFlagsKHR)
-> ReadPrec BuildAccelerationStructureFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixBuildAccelerationStructureFlagBitsKHR
                          [(BuildAccelerationStructureFlagsKHR, String)]
showTableBuildAccelerationStructureFlagBitsKHR
                          String
conNameBuildAccelerationStructureFlagBitsKHR
                          ("firstQuery" ::: Word32) -> BuildAccelerationStructureFlagsKHR
BuildAccelerationStructureFlagBitsKHR


type AccelerationStructureCreateFlagsKHR = AccelerationStructureCreateFlagBitsKHR

-- | VkAccelerationStructureCreateFlagBitsKHR - Bitmask specifying additional
-- creation parameters for acceleration structure
--
-- = See Also
--
-- 'AccelerationStructureCreateFlagsKHR'
newtype AccelerationStructureCreateFlagBitsKHR = AccelerationStructureCreateFlagBitsKHR Flags
  deriving newtype (AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
(AccelerationStructureCreateFlagsKHR
 -> AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> Bool)
-> Eq AccelerationStructureCreateFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c/= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
== :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c== :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
Eq, Eq AccelerationStructureCreateFlagsKHR
Eq AccelerationStructureCreateFlagsKHR =>
(AccelerationStructureCreateFlagsKHR
 -> AccelerationStructureCreateFlagsKHR -> Ordering)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR)
-> Ord AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Ordering
AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
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 :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$cmin :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
max :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$cmax :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
>= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c>= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
> :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c> :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
<= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c<= :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
< :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
$c< :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Bool
compare :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Ordering
$ccompare :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> Ordering
$cp1Ord :: Eq AccelerationStructureCreateFlagsKHR
Ord, Ptr b -> Int -> IO AccelerationStructureCreateFlagsKHR
Ptr b -> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
Ptr AccelerationStructureCreateFlagsKHR
-> IO AccelerationStructureCreateFlagsKHR
Ptr AccelerationStructureCreateFlagsKHR
-> Int -> IO AccelerationStructureCreateFlagsKHR
Ptr AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
Ptr AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> IO ()
AccelerationStructureCreateFlagsKHR -> Int
(AccelerationStructureCreateFlagsKHR -> Int)
-> (AccelerationStructureCreateFlagsKHR -> Int)
-> (Ptr AccelerationStructureCreateFlagsKHR
    -> Int -> IO AccelerationStructureCreateFlagsKHR)
-> (Ptr AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR -> IO ())
-> (forall b.
    Ptr b -> Int -> IO AccelerationStructureCreateFlagsKHR)
-> (forall b.
    Ptr b -> Int -> AccelerationStructureCreateFlagsKHR -> IO ())
-> (Ptr AccelerationStructureCreateFlagsKHR
    -> IO AccelerationStructureCreateFlagsKHR)
-> (Ptr AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR -> IO ())
-> Storable AccelerationStructureCreateFlagsKHR
forall b. Ptr b -> Int -> IO AccelerationStructureCreateFlagsKHR
forall b.
Ptr b -> Int -> AccelerationStructureCreateFlagsKHR -> 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 AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> IO ()
$cpoke :: Ptr AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR -> IO ()
peek :: Ptr AccelerationStructureCreateFlagsKHR
-> IO AccelerationStructureCreateFlagsKHR
$cpeek :: Ptr AccelerationStructureCreateFlagsKHR
-> IO AccelerationStructureCreateFlagsKHR
pokeByteOff :: Ptr b -> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO AccelerationStructureCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AccelerationStructureCreateFlagsKHR
pokeElemOff :: Ptr AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR -> IO ()
peekElemOff :: Ptr AccelerationStructureCreateFlagsKHR
-> Int -> IO AccelerationStructureCreateFlagsKHR
$cpeekElemOff :: Ptr AccelerationStructureCreateFlagsKHR
-> Int -> IO AccelerationStructureCreateFlagsKHR
alignment :: AccelerationStructureCreateFlagsKHR -> Int
$calignment :: AccelerationStructureCreateFlagsKHR -> Int
sizeOf :: AccelerationStructureCreateFlagsKHR -> Int
$csizeOf :: AccelerationStructureCreateFlagsKHR -> Int
Storable, AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR
-> Zero AccelerationStructureCreateFlagsKHR
forall a. a -> Zero a
zero :: AccelerationStructureCreateFlagsKHR
$czero :: AccelerationStructureCreateFlagsKHR
Zero, Eq AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR
Eq AccelerationStructureCreateFlagsKHR =>
(AccelerationStructureCreateFlagsKHR
 -> AccelerationStructureCreateFlagsKHR
 -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> AccelerationStructureCreateFlagsKHR
-> (Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR -> Int -> Bool)
-> (AccelerationStructureCreateFlagsKHR -> Maybe Int)
-> (AccelerationStructureCreateFlagsKHR -> Int)
-> (AccelerationStructureCreateFlagsKHR -> Bool)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR
    -> Int -> AccelerationStructureCreateFlagsKHR)
-> (AccelerationStructureCreateFlagsKHR -> Int)
-> Bits AccelerationStructureCreateFlagsKHR
Int -> AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR -> Bool
AccelerationStructureCreateFlagsKHR -> Int
AccelerationStructureCreateFlagsKHR -> Maybe Int
AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR -> Int -> Bool
AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: AccelerationStructureCreateFlagsKHR -> Int
$cpopCount :: AccelerationStructureCreateFlagsKHR -> Int
rotateR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$crotateR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
rotateL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$crotateL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
unsafeShiftR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cunsafeShiftR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
shiftR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cshiftR :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
unsafeShiftL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cunsafeShiftL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
shiftL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cshiftL :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
isSigned :: AccelerationStructureCreateFlagsKHR -> Bool
$cisSigned :: AccelerationStructureCreateFlagsKHR -> Bool
bitSize :: AccelerationStructureCreateFlagsKHR -> Int
$cbitSize :: AccelerationStructureCreateFlagsKHR -> Int
bitSizeMaybe :: AccelerationStructureCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: AccelerationStructureCreateFlagsKHR -> Maybe Int
testBit :: AccelerationStructureCreateFlagsKHR -> Int -> Bool
$ctestBit :: AccelerationStructureCreateFlagsKHR -> Int -> Bool
complementBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$ccomplementBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
clearBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cclearBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
setBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$csetBit :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
bit :: Int -> AccelerationStructureCreateFlagsKHR
$cbit :: Int -> AccelerationStructureCreateFlagsKHR
zeroBits :: AccelerationStructureCreateFlagsKHR
$czeroBits :: AccelerationStructureCreateFlagsKHR
rotate :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$crotate :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
shift :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
$cshift :: AccelerationStructureCreateFlagsKHR
-> Int -> AccelerationStructureCreateFlagsKHR
complement :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$ccomplement :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
xor :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$cxor :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
.|. :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$c.|. :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
.&. :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$c.&. :: AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
-> AccelerationStructureCreateFlagsKHR
$cp1Bits :: Eq AccelerationStructureCreateFlagsKHR
Bits, Bits AccelerationStructureCreateFlagsKHR
Bits AccelerationStructureCreateFlagsKHR =>
(AccelerationStructureCreateFlagsKHR -> Int)
-> (AccelerationStructureCreateFlagsKHR -> Int)
-> (AccelerationStructureCreateFlagsKHR -> Int)
-> FiniteBits AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: AccelerationStructureCreateFlagsKHR -> Int
$ccountTrailingZeros :: AccelerationStructureCreateFlagsKHR -> Int
countLeadingZeros :: AccelerationStructureCreateFlagsKHR -> Int
$ccountLeadingZeros :: AccelerationStructureCreateFlagsKHR -> Int
finiteBitSize :: AccelerationStructureCreateFlagsKHR -> Int
$cfiniteBitSize :: AccelerationStructureCreateFlagsKHR -> Int
$cp1FiniteBits :: Bits AccelerationStructureCreateFlagsKHR
FiniteBits)

-- | 'ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR'
-- specifies that the acceleration structure’s address /can/ be saved and
-- reused on a subsequent run.
pattern $bACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR :: AccelerationStructureCreateFlagsKHR
$mACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR :: forall r.
AccelerationStructureCreateFlagsKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR =
  AccelerationStructureCreateFlagBitsKHR 0x00000001

conNameAccelerationStructureCreateFlagBitsKHR :: String
conNameAccelerationStructureCreateFlagBitsKHR :: String
conNameAccelerationStructureCreateFlagBitsKHR = "AccelerationStructureCreateFlagBitsKHR"

enumPrefixAccelerationStructureCreateFlagBitsKHR :: String
enumPrefixAccelerationStructureCreateFlagBitsKHR :: String
enumPrefixAccelerationStructureCreateFlagBitsKHR =
  "ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR"

showTableAccelerationStructureCreateFlagBitsKHR :: [(AccelerationStructureCreateFlagBitsKHR, String)]
showTableAccelerationStructureCreateFlagBitsKHR :: [(AccelerationStructureCreateFlagsKHR, String)]
showTableAccelerationStructureCreateFlagBitsKHR =
  [(AccelerationStructureCreateFlagsKHR
ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR, "")]

instance Show AccelerationStructureCreateFlagBitsKHR where
  showsPrec :: Int -> AccelerationStructureCreateFlagsKHR -> ShowS
showsPrec = String
-> [(AccelerationStructureCreateFlagsKHR, String)]
-> String
-> (AccelerationStructureCreateFlagsKHR -> "firstQuery" ::: Word32)
-> (("firstQuery" ::: Word32) -> ShowS)
-> Int
-> AccelerationStructureCreateFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixAccelerationStructureCreateFlagBitsKHR
                            [(AccelerationStructureCreateFlagsKHR, String)]
showTableAccelerationStructureCreateFlagBitsKHR
                            String
conNameAccelerationStructureCreateFlagBitsKHR
                            (\(AccelerationStructureCreateFlagBitsKHR x :: "firstQuery" ::: Word32
x) -> "firstQuery" ::: Word32
x)
                            (\x :: "firstQuery" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("firstQuery" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "firstQuery" ::: Word32
x)

instance Read AccelerationStructureCreateFlagBitsKHR where
  readPrec :: ReadPrec AccelerationStructureCreateFlagsKHR
readPrec = String
-> [(AccelerationStructureCreateFlagsKHR, String)]
-> String
-> (("firstQuery" ::: Word32)
    -> AccelerationStructureCreateFlagsKHR)
-> ReadPrec AccelerationStructureCreateFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixAccelerationStructureCreateFlagBitsKHR
                          [(AccelerationStructureCreateFlagsKHR, String)]
showTableAccelerationStructureCreateFlagBitsKHR
                          String
conNameAccelerationStructureCreateFlagBitsKHR
                          ("firstQuery" ::: Word32) -> AccelerationStructureCreateFlagsKHR
AccelerationStructureCreateFlagBitsKHR


-- | VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode
--
-- = See Also
--
-- 'CopyAccelerationStructureInfoKHR',
-- 'CopyAccelerationStructureToMemoryInfoKHR',
-- 'CopyMemoryToAccelerationStructureInfoKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.cmdCopyAccelerationStructureNV'
newtype CopyAccelerationStructureModeKHR = CopyAccelerationStructureModeKHR Int32
  deriving newtype (CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
(CopyAccelerationStructureModeKHR
 -> CopyAccelerationStructureModeKHR -> Bool)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> Bool)
-> Eq CopyAccelerationStructureModeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c/= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
== :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c== :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
Eq, Eq CopyAccelerationStructureModeKHR
Eq CopyAccelerationStructureModeKHR =>
(CopyAccelerationStructureModeKHR
 -> CopyAccelerationStructureModeKHR -> Ordering)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> Bool)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> Bool)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> Bool)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> Bool)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR)
-> (CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR)
-> Ord CopyAccelerationStructureModeKHR
CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Ordering
CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
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 :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
$cmin :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
max :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
$cmax :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR
>= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c>= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
> :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c> :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
<= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c<= :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
< :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
$c< :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Bool
compare :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Ordering
$ccompare :: CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> Ordering
$cp1Ord :: Eq CopyAccelerationStructureModeKHR
Ord, Ptr b -> Int -> IO CopyAccelerationStructureModeKHR
Ptr b -> Int -> CopyAccelerationStructureModeKHR -> IO ()
Ptr CopyAccelerationStructureModeKHR
-> IO CopyAccelerationStructureModeKHR
Ptr CopyAccelerationStructureModeKHR
-> Int -> IO CopyAccelerationStructureModeKHR
Ptr CopyAccelerationStructureModeKHR
-> Int -> CopyAccelerationStructureModeKHR -> IO ()
Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
CopyAccelerationStructureModeKHR -> Int
(CopyAccelerationStructureModeKHR -> Int)
-> (CopyAccelerationStructureModeKHR -> Int)
-> (Ptr CopyAccelerationStructureModeKHR
    -> Int -> IO CopyAccelerationStructureModeKHR)
-> (Ptr CopyAccelerationStructureModeKHR
    -> Int -> CopyAccelerationStructureModeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO CopyAccelerationStructureModeKHR)
-> (forall b.
    Ptr b -> Int -> CopyAccelerationStructureModeKHR -> IO ())
-> (Ptr CopyAccelerationStructureModeKHR
    -> IO CopyAccelerationStructureModeKHR)
-> (Ptr CopyAccelerationStructureModeKHR
    -> CopyAccelerationStructureModeKHR -> IO ())
-> Storable CopyAccelerationStructureModeKHR
forall b. Ptr b -> Int -> IO CopyAccelerationStructureModeKHR
forall b. Ptr b -> Int -> CopyAccelerationStructureModeKHR -> 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 CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
$cpoke :: Ptr CopyAccelerationStructureModeKHR
-> CopyAccelerationStructureModeKHR -> IO ()
peek :: Ptr CopyAccelerationStructureModeKHR
-> IO CopyAccelerationStructureModeKHR
$cpeek :: Ptr CopyAccelerationStructureModeKHR
-> IO CopyAccelerationStructureModeKHR
pokeByteOff :: Ptr b -> Int -> CopyAccelerationStructureModeKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> CopyAccelerationStructureModeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO CopyAccelerationStructureModeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO CopyAccelerationStructureModeKHR
pokeElemOff :: Ptr CopyAccelerationStructureModeKHR
-> Int -> CopyAccelerationStructureModeKHR -> IO ()
$cpokeElemOff :: Ptr CopyAccelerationStructureModeKHR
-> Int -> CopyAccelerationStructureModeKHR -> IO ()
peekElemOff :: Ptr CopyAccelerationStructureModeKHR
-> Int -> IO CopyAccelerationStructureModeKHR
$cpeekElemOff :: Ptr CopyAccelerationStructureModeKHR
-> Int -> IO CopyAccelerationStructureModeKHR
alignment :: CopyAccelerationStructureModeKHR -> Int
$calignment :: CopyAccelerationStructureModeKHR -> Int
sizeOf :: CopyAccelerationStructureModeKHR -> Int
$csizeOf :: CopyAccelerationStructureModeKHR -> Int
Storable, CopyAccelerationStructureModeKHR
CopyAccelerationStructureModeKHR
-> Zero CopyAccelerationStructureModeKHR
forall a. a -> Zero a
zero :: CopyAccelerationStructureModeKHR
$czero :: CopyAccelerationStructureModeKHR
Zero)

-- | 'COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR' creates a direct copy of
-- the acceleration structure specified in @src@ into the one specified by
-- @dst@. The @dst@ acceleration structure /must/ have been created with
-- the same parameters as @src@.
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR :: forall r.
CopyAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR       = CopyAccelerationStructureModeKHR 0
-- | 'COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR' creates a more compact
-- version of an acceleration structure @src@ into @dst@. The acceleration
-- structure @dst@ /must/ have been created with a size at least as large
-- as that returned by 'cmdWriteAccelerationStructuresPropertiesKHR' or
-- 'writeAccelerationStructuresPropertiesKHR' after the build of the
-- acceleration structure specified by @src@.
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR :: forall r.
CopyAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR     = CopyAccelerationStructureModeKHR 1
-- | 'COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR' serializes the
-- acceleration structure to a semi-opaque format which can be reloaded on
-- a compatible implementation.
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR :: forall r.
CopyAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR   = CopyAccelerationStructureModeKHR 2
-- | 'COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR' deserializes the
-- semi-opaque serialization format in the buffer to the acceleration
-- structure.
pattern $bCOPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR :: CopyAccelerationStructureModeKHR
$mCOPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR :: forall r.
CopyAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR = CopyAccelerationStructureModeKHR 3
{-# complete COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR,
             COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR,
             COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR,
             COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR :: CopyAccelerationStructureModeKHR #-}

conNameCopyAccelerationStructureModeKHR :: String
conNameCopyAccelerationStructureModeKHR :: String
conNameCopyAccelerationStructureModeKHR = "CopyAccelerationStructureModeKHR"

enumPrefixCopyAccelerationStructureModeKHR :: String
enumPrefixCopyAccelerationStructureModeKHR :: String
enumPrefixCopyAccelerationStructureModeKHR = "COPY_ACCELERATION_STRUCTURE_MODE_"

showTableCopyAccelerationStructureModeKHR :: [(CopyAccelerationStructureModeKHR, String)]
showTableCopyAccelerationStructureModeKHR :: [(CopyAccelerationStructureModeKHR, String)]
showTableCopyAccelerationStructureModeKHR =
  [ (CopyAccelerationStructureModeKHR
COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR      , "CLONE_KHR")
  , (CopyAccelerationStructureModeKHR
COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR    , "COMPACT_KHR")
  , (CopyAccelerationStructureModeKHR
COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR  , "SERIALIZE_KHR")
  , (CopyAccelerationStructureModeKHR
COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR, "DESERIALIZE_KHR")
  ]

instance Show CopyAccelerationStructureModeKHR where
  showsPrec :: Int -> CopyAccelerationStructureModeKHR -> ShowS
showsPrec = String
-> [(CopyAccelerationStructureModeKHR, String)]
-> String
-> (CopyAccelerationStructureModeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> CopyAccelerationStructureModeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixCopyAccelerationStructureModeKHR
                            [(CopyAccelerationStructureModeKHR, String)]
showTableCopyAccelerationStructureModeKHR
                            String
conNameCopyAccelerationStructureModeKHR
                            (\(CopyAccelerationStructureModeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read CopyAccelerationStructureModeKHR where
  readPrec :: ReadPrec CopyAccelerationStructureModeKHR
readPrec = String
-> [(CopyAccelerationStructureModeKHR, String)]
-> String
-> (Int32 -> CopyAccelerationStructureModeKHR)
-> ReadPrec CopyAccelerationStructureModeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixCopyAccelerationStructureModeKHR
                          [(CopyAccelerationStructureModeKHR, String)]
showTableCopyAccelerationStructureModeKHR
                          String
conNameCopyAccelerationStructureModeKHR
                          Int32 -> CopyAccelerationStructureModeKHR
CopyAccelerationStructureModeKHR


-- | VkBuildAccelerationStructureModeKHR - Enum specifying the type of build
-- operation to perform
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR'
newtype BuildAccelerationStructureModeKHR = BuildAccelerationStructureModeKHR Int32
  deriving newtype (BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
(BuildAccelerationStructureModeKHR
 -> BuildAccelerationStructureModeKHR -> Bool)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> Bool)
-> Eq BuildAccelerationStructureModeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c/= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
== :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c== :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
Eq, Eq BuildAccelerationStructureModeKHR
Eq BuildAccelerationStructureModeKHR =>
(BuildAccelerationStructureModeKHR
 -> BuildAccelerationStructureModeKHR -> Ordering)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> Bool)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> Bool)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> Bool)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> Bool)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR)
-> (BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR)
-> Ord BuildAccelerationStructureModeKHR
BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Ordering
BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
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 :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
$cmin :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
max :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
$cmax :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR
>= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c>= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
> :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c> :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
<= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c<= :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
< :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
$c< :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Bool
compare :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Ordering
$ccompare :: BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> Ordering
$cp1Ord :: Eq BuildAccelerationStructureModeKHR
Ord, Ptr b -> Int -> IO BuildAccelerationStructureModeKHR
Ptr b -> Int -> BuildAccelerationStructureModeKHR -> IO ()
Ptr BuildAccelerationStructureModeKHR
-> IO BuildAccelerationStructureModeKHR
Ptr BuildAccelerationStructureModeKHR
-> Int -> IO BuildAccelerationStructureModeKHR
Ptr BuildAccelerationStructureModeKHR
-> Int -> BuildAccelerationStructureModeKHR -> IO ()
Ptr BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> IO ()
BuildAccelerationStructureModeKHR -> Int
(BuildAccelerationStructureModeKHR -> Int)
-> (BuildAccelerationStructureModeKHR -> Int)
-> (Ptr BuildAccelerationStructureModeKHR
    -> Int -> IO BuildAccelerationStructureModeKHR)
-> (Ptr BuildAccelerationStructureModeKHR
    -> Int -> BuildAccelerationStructureModeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO BuildAccelerationStructureModeKHR)
-> (forall b.
    Ptr b -> Int -> BuildAccelerationStructureModeKHR -> IO ())
-> (Ptr BuildAccelerationStructureModeKHR
    -> IO BuildAccelerationStructureModeKHR)
-> (Ptr BuildAccelerationStructureModeKHR
    -> BuildAccelerationStructureModeKHR -> IO ())
-> Storable BuildAccelerationStructureModeKHR
forall b. Ptr b -> Int -> IO BuildAccelerationStructureModeKHR
forall b.
Ptr b -> Int -> BuildAccelerationStructureModeKHR -> 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 BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> IO ()
$cpoke :: Ptr BuildAccelerationStructureModeKHR
-> BuildAccelerationStructureModeKHR -> IO ()
peek :: Ptr BuildAccelerationStructureModeKHR
-> IO BuildAccelerationStructureModeKHR
$cpeek :: Ptr BuildAccelerationStructureModeKHR
-> IO BuildAccelerationStructureModeKHR
pokeByteOff :: Ptr b -> Int -> BuildAccelerationStructureModeKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> BuildAccelerationStructureModeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO BuildAccelerationStructureModeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BuildAccelerationStructureModeKHR
pokeElemOff :: Ptr BuildAccelerationStructureModeKHR
-> Int -> BuildAccelerationStructureModeKHR -> IO ()
$cpokeElemOff :: Ptr BuildAccelerationStructureModeKHR
-> Int -> BuildAccelerationStructureModeKHR -> IO ()
peekElemOff :: Ptr BuildAccelerationStructureModeKHR
-> Int -> IO BuildAccelerationStructureModeKHR
$cpeekElemOff :: Ptr BuildAccelerationStructureModeKHR
-> Int -> IO BuildAccelerationStructureModeKHR
alignment :: BuildAccelerationStructureModeKHR -> Int
$calignment :: BuildAccelerationStructureModeKHR -> Int
sizeOf :: BuildAccelerationStructureModeKHR -> Int
$csizeOf :: BuildAccelerationStructureModeKHR -> Int
Storable, BuildAccelerationStructureModeKHR
BuildAccelerationStructureModeKHR
-> Zero BuildAccelerationStructureModeKHR
forall a. a -> Zero a
zero :: BuildAccelerationStructureModeKHR
$czero :: BuildAccelerationStructureModeKHR
Zero)

-- | 'BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR' specifies that the
-- destination acceleration structure will be built using the specified
-- geometries.
pattern $bBUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR :: BuildAccelerationStructureModeKHR
$mBUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR :: forall r.
BuildAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR  = BuildAccelerationStructureModeKHR 0
-- | 'BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR' specifies that the
-- destination acceleration structure will be built using data in a source
-- acceleration structure, updated by the specified geometries.
pattern $bBUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR :: BuildAccelerationStructureModeKHR
$mBUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR :: forall r.
BuildAccelerationStructureModeKHR
-> (Void# -> r) -> (Void# -> r) -> r
BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR = BuildAccelerationStructureModeKHR 1
{-# complete BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR,
             BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR :: BuildAccelerationStructureModeKHR #-}

conNameBuildAccelerationStructureModeKHR :: String
conNameBuildAccelerationStructureModeKHR :: String
conNameBuildAccelerationStructureModeKHR = "BuildAccelerationStructureModeKHR"

enumPrefixBuildAccelerationStructureModeKHR :: String
enumPrefixBuildAccelerationStructureModeKHR :: String
enumPrefixBuildAccelerationStructureModeKHR = "BUILD_ACCELERATION_STRUCTURE_MODE_"

showTableBuildAccelerationStructureModeKHR :: [(BuildAccelerationStructureModeKHR, String)]
showTableBuildAccelerationStructureModeKHR :: [(BuildAccelerationStructureModeKHR, String)]
showTableBuildAccelerationStructureModeKHR =
  [ (BuildAccelerationStructureModeKHR
BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR , "BUILD_KHR")
  , (BuildAccelerationStructureModeKHR
BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, "UPDATE_KHR")
  ]

instance Show BuildAccelerationStructureModeKHR where
  showsPrec :: Int -> BuildAccelerationStructureModeKHR -> ShowS
showsPrec = String
-> [(BuildAccelerationStructureModeKHR, String)]
-> String
-> (BuildAccelerationStructureModeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> BuildAccelerationStructureModeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixBuildAccelerationStructureModeKHR
                            [(BuildAccelerationStructureModeKHR, String)]
showTableBuildAccelerationStructureModeKHR
                            String
conNameBuildAccelerationStructureModeKHR
                            (\(BuildAccelerationStructureModeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read BuildAccelerationStructureModeKHR where
  readPrec :: ReadPrec BuildAccelerationStructureModeKHR
readPrec = String
-> [(BuildAccelerationStructureModeKHR, String)]
-> String
-> (Int32 -> BuildAccelerationStructureModeKHR)
-> ReadPrec BuildAccelerationStructureModeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixBuildAccelerationStructureModeKHR
                          [(BuildAccelerationStructureModeKHR, String)]
showTableBuildAccelerationStructureModeKHR
                          String
conNameBuildAccelerationStructureModeKHR
                          Int32 -> BuildAccelerationStructureModeKHR
BuildAccelerationStructureModeKHR


-- | VkAccelerationStructureTypeKHR - Type of acceleration structure
--
-- = See Also
--
-- 'AccelerationStructureBuildGeometryInfoKHR',
-- 'AccelerationStructureCreateInfoKHR'
newtype AccelerationStructureTypeKHR = AccelerationStructureTypeKHR Int32
  deriving newtype (AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
(AccelerationStructureTypeKHR
 -> AccelerationStructureTypeKHR -> Bool)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> Bool)
-> Eq AccelerationStructureTypeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c/= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
== :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c== :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
Eq, Eq AccelerationStructureTypeKHR
Eq AccelerationStructureTypeKHR =>
(AccelerationStructureTypeKHR
 -> AccelerationStructureTypeKHR -> Ordering)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> Bool)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> Bool)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> Bool)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> Bool)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR)
-> (AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR)
-> Ord AccelerationStructureTypeKHR
AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Ordering
AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR
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 :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR
$cmin :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR
max :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR
$cmax :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> AccelerationStructureTypeKHR
>= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c>= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
> :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c> :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
<= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c<= :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
< :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
$c< :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Bool
compare :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Ordering
$ccompare :: AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> Ordering
$cp1Ord :: Eq AccelerationStructureTypeKHR
Ord, Ptr b -> Int -> IO AccelerationStructureTypeKHR
Ptr b -> Int -> AccelerationStructureTypeKHR -> IO ()
Ptr AccelerationStructureTypeKHR -> IO AccelerationStructureTypeKHR
Ptr AccelerationStructureTypeKHR
-> Int -> IO AccelerationStructureTypeKHR
Ptr AccelerationStructureTypeKHR
-> Int -> AccelerationStructureTypeKHR -> IO ()
Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
AccelerationStructureTypeKHR -> Int
(AccelerationStructureTypeKHR -> Int)
-> (AccelerationStructureTypeKHR -> Int)
-> (Ptr AccelerationStructureTypeKHR
    -> Int -> IO AccelerationStructureTypeKHR)
-> (Ptr AccelerationStructureTypeKHR
    -> Int -> AccelerationStructureTypeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO AccelerationStructureTypeKHR)
-> (forall b.
    Ptr b -> Int -> AccelerationStructureTypeKHR -> IO ())
-> (Ptr AccelerationStructureTypeKHR
    -> IO AccelerationStructureTypeKHR)
-> (Ptr AccelerationStructureTypeKHR
    -> AccelerationStructureTypeKHR -> IO ())
-> Storable AccelerationStructureTypeKHR
forall b. Ptr b -> Int -> IO AccelerationStructureTypeKHR
forall b. Ptr b -> Int -> AccelerationStructureTypeKHR -> 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 AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
$cpoke :: Ptr AccelerationStructureTypeKHR
-> AccelerationStructureTypeKHR -> IO ()
peek :: Ptr AccelerationStructureTypeKHR -> IO AccelerationStructureTypeKHR
$cpeek :: Ptr AccelerationStructureTypeKHR -> IO AccelerationStructureTypeKHR
pokeByteOff :: Ptr b -> Int -> AccelerationStructureTypeKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> AccelerationStructureTypeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO AccelerationStructureTypeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AccelerationStructureTypeKHR
pokeElemOff :: Ptr AccelerationStructureTypeKHR
-> Int -> AccelerationStructureTypeKHR -> IO ()
$cpokeElemOff :: Ptr AccelerationStructureTypeKHR
-> Int -> AccelerationStructureTypeKHR -> IO ()
peekElemOff :: Ptr AccelerationStructureTypeKHR
-> Int -> IO AccelerationStructureTypeKHR
$cpeekElemOff :: Ptr AccelerationStructureTypeKHR
-> Int -> IO AccelerationStructureTypeKHR
alignment :: AccelerationStructureTypeKHR -> Int
$calignment :: AccelerationStructureTypeKHR -> Int
sizeOf :: AccelerationStructureTypeKHR -> Int
$csizeOf :: AccelerationStructureTypeKHR -> Int
Storable, AccelerationStructureTypeKHR
AccelerationStructureTypeKHR -> Zero AccelerationStructureTypeKHR
forall a. a -> Zero a
zero :: AccelerationStructureTypeKHR
$czero :: AccelerationStructureTypeKHR
Zero)

-- | 'ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR' is a top-level acceleration
-- structure containing instance data referring to bottom-level
-- acceleration structures.
pattern $bACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR :: AccelerationStructureTypeKHR
$mACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR :: forall r.
AccelerationStructureTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR    = AccelerationStructureTypeKHR 0
-- | 'ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR' is a bottom-level
-- acceleration structure containing the AABBs or geometry to be
-- intersected.
pattern $bACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR :: AccelerationStructureTypeKHR
$mACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR :: forall r.
AccelerationStructureTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR = AccelerationStructureTypeKHR 1
-- | 'ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR' is an acceleration structure
-- whose type is determined at build time used for special circumstances.
pattern $bACCELERATION_STRUCTURE_TYPE_GENERIC_KHR :: AccelerationStructureTypeKHR
$mACCELERATION_STRUCTURE_TYPE_GENERIC_KHR :: forall r.
AccelerationStructureTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR      = AccelerationStructureTypeKHR 2
{-# complete ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR,
             ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR,
             ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR :: AccelerationStructureTypeKHR #-}

conNameAccelerationStructureTypeKHR :: String
conNameAccelerationStructureTypeKHR :: String
conNameAccelerationStructureTypeKHR = "AccelerationStructureTypeKHR"

enumPrefixAccelerationStructureTypeKHR :: String
enumPrefixAccelerationStructureTypeKHR :: String
enumPrefixAccelerationStructureTypeKHR = "ACCELERATION_STRUCTURE_TYPE_"

showTableAccelerationStructureTypeKHR :: [(AccelerationStructureTypeKHR, String)]
showTableAccelerationStructureTypeKHR :: [(AccelerationStructureTypeKHR, String)]
showTableAccelerationStructureTypeKHR =
  [ (AccelerationStructureTypeKHR
ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR   , "TOP_LEVEL_KHR")
  , (AccelerationStructureTypeKHR
ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, "BOTTOM_LEVEL_KHR")
  , (AccelerationStructureTypeKHR
ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR     , "GENERIC_KHR")
  ]

instance Show AccelerationStructureTypeKHR where
  showsPrec :: Int -> AccelerationStructureTypeKHR -> ShowS
showsPrec = String
-> [(AccelerationStructureTypeKHR, String)]
-> String
-> (AccelerationStructureTypeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> AccelerationStructureTypeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixAccelerationStructureTypeKHR
                            [(AccelerationStructureTypeKHR, String)]
showTableAccelerationStructureTypeKHR
                            String
conNameAccelerationStructureTypeKHR
                            (\(AccelerationStructureTypeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read AccelerationStructureTypeKHR where
  readPrec :: ReadPrec AccelerationStructureTypeKHR
readPrec = String
-> [(AccelerationStructureTypeKHR, String)]
-> String
-> (Int32 -> AccelerationStructureTypeKHR)
-> ReadPrec AccelerationStructureTypeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixAccelerationStructureTypeKHR
                          [(AccelerationStructureTypeKHR, String)]
showTableAccelerationStructureTypeKHR
                          String
conNameAccelerationStructureTypeKHR
                          Int32 -> AccelerationStructureTypeKHR
AccelerationStructureTypeKHR


-- | VkGeometryTypeKHR - Enum specifying which type of geometry is provided
--
-- = See Also
--
-- 'AccelerationStructureGeometryKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.GeometryNV'
newtype GeometryTypeKHR = GeometryTypeKHR Int32
  deriving newtype (GeometryTypeKHR -> GeometryTypeKHR -> Bool
(GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> (GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> Eq GeometryTypeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c/= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
== :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c== :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
Eq, Eq GeometryTypeKHR
Eq GeometryTypeKHR =>
(GeometryTypeKHR -> GeometryTypeKHR -> Ordering)
-> (GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> (GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> (GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> (GeometryTypeKHR -> GeometryTypeKHR -> Bool)
-> (GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR)
-> (GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR)
-> Ord GeometryTypeKHR
GeometryTypeKHR -> GeometryTypeKHR -> Bool
GeometryTypeKHR -> GeometryTypeKHR -> Ordering
GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR
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 :: GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR
$cmin :: GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR
max :: GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR
$cmax :: GeometryTypeKHR -> GeometryTypeKHR -> GeometryTypeKHR
>= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c>= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
> :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c> :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
<= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c<= :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
< :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
$c< :: GeometryTypeKHR -> GeometryTypeKHR -> Bool
compare :: GeometryTypeKHR -> GeometryTypeKHR -> Ordering
$ccompare :: GeometryTypeKHR -> GeometryTypeKHR -> Ordering
$cp1Ord :: Eq GeometryTypeKHR
Ord, Ptr b -> Int -> IO GeometryTypeKHR
Ptr b -> Int -> GeometryTypeKHR -> IO ()
Ptr GeometryTypeKHR -> IO GeometryTypeKHR
Ptr GeometryTypeKHR -> Int -> IO GeometryTypeKHR
Ptr GeometryTypeKHR -> Int -> GeometryTypeKHR -> IO ()
Ptr GeometryTypeKHR -> GeometryTypeKHR -> IO ()
GeometryTypeKHR -> Int
(GeometryTypeKHR -> Int)
-> (GeometryTypeKHR -> Int)
-> (Ptr GeometryTypeKHR -> Int -> IO GeometryTypeKHR)
-> (Ptr GeometryTypeKHR -> Int -> GeometryTypeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO GeometryTypeKHR)
-> (forall b. Ptr b -> Int -> GeometryTypeKHR -> IO ())
-> (Ptr GeometryTypeKHR -> IO GeometryTypeKHR)
-> (Ptr GeometryTypeKHR -> GeometryTypeKHR -> IO ())
-> Storable GeometryTypeKHR
forall b. Ptr b -> Int -> IO GeometryTypeKHR
forall b. Ptr b -> Int -> GeometryTypeKHR -> 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 GeometryTypeKHR -> GeometryTypeKHR -> IO ()
$cpoke :: Ptr GeometryTypeKHR -> GeometryTypeKHR -> IO ()
peek :: Ptr GeometryTypeKHR -> IO GeometryTypeKHR
$cpeek :: Ptr GeometryTypeKHR -> IO GeometryTypeKHR
pokeByteOff :: Ptr b -> Int -> GeometryTypeKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> GeometryTypeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO GeometryTypeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO GeometryTypeKHR
pokeElemOff :: Ptr GeometryTypeKHR -> Int -> GeometryTypeKHR -> IO ()
$cpokeElemOff :: Ptr GeometryTypeKHR -> Int -> GeometryTypeKHR -> IO ()
peekElemOff :: Ptr GeometryTypeKHR -> Int -> IO GeometryTypeKHR
$cpeekElemOff :: Ptr GeometryTypeKHR -> Int -> IO GeometryTypeKHR
alignment :: GeometryTypeKHR -> Int
$calignment :: GeometryTypeKHR -> Int
sizeOf :: GeometryTypeKHR -> Int
$csizeOf :: GeometryTypeKHR -> Int
Storable, GeometryTypeKHR
GeometryTypeKHR -> Zero GeometryTypeKHR
forall a. a -> Zero a
zero :: GeometryTypeKHR
$czero :: GeometryTypeKHR
Zero)

-- | 'GEOMETRY_TYPE_TRIANGLES_KHR' specifies a geometry type consisting of
-- triangles.
pattern $bGEOMETRY_TYPE_TRIANGLES_KHR :: GeometryTypeKHR
$mGEOMETRY_TYPE_TRIANGLES_KHR :: forall r. GeometryTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_TYPE_TRIANGLES_KHR = GeometryTypeKHR 0
-- | 'GEOMETRY_TYPE_AABBS_KHR' specifies a geometry type consisting of
-- axis-aligned bounding boxes.
pattern $bGEOMETRY_TYPE_AABBS_KHR :: GeometryTypeKHR
$mGEOMETRY_TYPE_AABBS_KHR :: forall r. GeometryTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_TYPE_AABBS_KHR     = GeometryTypeKHR 1
-- | 'GEOMETRY_TYPE_INSTANCES_KHR' specifies a geometry type consisting of
-- acceleration structure instances.
pattern $bGEOMETRY_TYPE_INSTANCES_KHR :: GeometryTypeKHR
$mGEOMETRY_TYPE_INSTANCES_KHR :: forall r. GeometryTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
GEOMETRY_TYPE_INSTANCES_KHR = GeometryTypeKHR 2
{-# complete GEOMETRY_TYPE_TRIANGLES_KHR,
             GEOMETRY_TYPE_AABBS_KHR,
             GEOMETRY_TYPE_INSTANCES_KHR :: GeometryTypeKHR #-}

conNameGeometryTypeKHR :: String
conNameGeometryTypeKHR :: String
conNameGeometryTypeKHR = "GeometryTypeKHR"

enumPrefixGeometryTypeKHR :: String
enumPrefixGeometryTypeKHR :: String
enumPrefixGeometryTypeKHR = "GEOMETRY_TYPE_"

showTableGeometryTypeKHR :: [(GeometryTypeKHR, String)]
showTableGeometryTypeKHR :: [(GeometryTypeKHR, String)]
showTableGeometryTypeKHR =
  [ (GeometryTypeKHR
GEOMETRY_TYPE_TRIANGLES_KHR, "TRIANGLES_KHR")
  , (GeometryTypeKHR
GEOMETRY_TYPE_AABBS_KHR    , "AABBS_KHR")
  , (GeometryTypeKHR
GEOMETRY_TYPE_INSTANCES_KHR, "INSTANCES_KHR")
  ]

instance Show GeometryTypeKHR where
  showsPrec :: Int -> GeometryTypeKHR -> ShowS
showsPrec = String
-> [(GeometryTypeKHR, String)]
-> String
-> (GeometryTypeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> GeometryTypeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixGeometryTypeKHR
                            [(GeometryTypeKHR, String)]
showTableGeometryTypeKHR
                            String
conNameGeometryTypeKHR
                            (\(GeometryTypeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read GeometryTypeKHR where
  readPrec :: ReadPrec GeometryTypeKHR
readPrec = String
-> [(GeometryTypeKHR, String)]
-> String
-> (Int32 -> GeometryTypeKHR)
-> ReadPrec GeometryTypeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixGeometryTypeKHR [(GeometryTypeKHR, String)]
showTableGeometryTypeKHR String
conNameGeometryTypeKHR Int32 -> GeometryTypeKHR
GeometryTypeKHR


-- | VkAccelerationStructureBuildTypeKHR - Acceleration structure build type
--
-- = See Also
--
-- 'getAccelerationStructureBuildSizesKHR'
newtype AccelerationStructureBuildTypeKHR = AccelerationStructureBuildTypeKHR Int32
  deriving newtype (AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
(AccelerationStructureBuildTypeKHR
 -> AccelerationStructureBuildTypeKHR -> Bool)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> Bool)
-> Eq AccelerationStructureBuildTypeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c/= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
== :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c== :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
Eq, Eq AccelerationStructureBuildTypeKHR
Eq AccelerationStructureBuildTypeKHR =>
(AccelerationStructureBuildTypeKHR
 -> AccelerationStructureBuildTypeKHR -> Ordering)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> Bool)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> Bool)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> Bool)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> Bool)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR)
-> (AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR)
-> Ord AccelerationStructureBuildTypeKHR
AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Ordering
AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
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 :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
$cmin :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
max :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
$cmax :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR
>= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c>= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
> :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c> :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
<= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c<= :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
< :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
$c< :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Bool
compare :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Ordering
$ccompare :: AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> Ordering
$cp1Ord :: Eq AccelerationStructureBuildTypeKHR
Ord, Ptr b -> Int -> IO AccelerationStructureBuildTypeKHR
Ptr b -> Int -> AccelerationStructureBuildTypeKHR -> IO ()
Ptr AccelerationStructureBuildTypeKHR
-> IO AccelerationStructureBuildTypeKHR
Ptr AccelerationStructureBuildTypeKHR
-> Int -> IO AccelerationStructureBuildTypeKHR
Ptr AccelerationStructureBuildTypeKHR
-> Int -> AccelerationStructureBuildTypeKHR -> IO ()
Ptr AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> IO ()
AccelerationStructureBuildTypeKHR -> Int
(AccelerationStructureBuildTypeKHR -> Int)
-> (AccelerationStructureBuildTypeKHR -> Int)
-> (Ptr AccelerationStructureBuildTypeKHR
    -> Int -> IO AccelerationStructureBuildTypeKHR)
-> (Ptr AccelerationStructureBuildTypeKHR
    -> Int -> AccelerationStructureBuildTypeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO AccelerationStructureBuildTypeKHR)
-> (forall b.
    Ptr b -> Int -> AccelerationStructureBuildTypeKHR -> IO ())
-> (Ptr AccelerationStructureBuildTypeKHR
    -> IO AccelerationStructureBuildTypeKHR)
-> (Ptr AccelerationStructureBuildTypeKHR
    -> AccelerationStructureBuildTypeKHR -> IO ())
-> Storable AccelerationStructureBuildTypeKHR
forall b. Ptr b -> Int -> IO AccelerationStructureBuildTypeKHR
forall b.
Ptr b -> Int -> AccelerationStructureBuildTypeKHR -> 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 AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> IO ()
$cpoke :: Ptr AccelerationStructureBuildTypeKHR
-> AccelerationStructureBuildTypeKHR -> IO ()
peek :: Ptr AccelerationStructureBuildTypeKHR
-> IO AccelerationStructureBuildTypeKHR
$cpeek :: Ptr AccelerationStructureBuildTypeKHR
-> IO AccelerationStructureBuildTypeKHR
pokeByteOff :: Ptr b -> Int -> AccelerationStructureBuildTypeKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> AccelerationStructureBuildTypeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO AccelerationStructureBuildTypeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AccelerationStructureBuildTypeKHR
pokeElemOff :: Ptr AccelerationStructureBuildTypeKHR
-> Int -> AccelerationStructureBuildTypeKHR -> IO ()
$cpokeElemOff :: Ptr AccelerationStructureBuildTypeKHR
-> Int -> AccelerationStructureBuildTypeKHR -> IO ()
peekElemOff :: Ptr AccelerationStructureBuildTypeKHR
-> Int -> IO AccelerationStructureBuildTypeKHR
$cpeekElemOff :: Ptr AccelerationStructureBuildTypeKHR
-> Int -> IO AccelerationStructureBuildTypeKHR
alignment :: AccelerationStructureBuildTypeKHR -> Int
$calignment :: AccelerationStructureBuildTypeKHR -> Int
sizeOf :: AccelerationStructureBuildTypeKHR -> Int
$csizeOf :: AccelerationStructureBuildTypeKHR -> Int
Storable, AccelerationStructureBuildTypeKHR
AccelerationStructureBuildTypeKHR
-> Zero AccelerationStructureBuildTypeKHR
forall a. a -> Zero a
zero :: AccelerationStructureBuildTypeKHR
$czero :: AccelerationStructureBuildTypeKHR
Zero)

-- | 'ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR' requests the memory
-- requirement for operations performed by the host.
pattern $bACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR :: AccelerationStructureBuildTypeKHR
$mACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR :: forall r.
AccelerationStructureBuildTypeKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR           = AccelerationStructureBuildTypeKHR 0
-- | 'ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR' requests the memory
-- requirement for operations performed by the device.
pattern $bACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR :: AccelerationStructureBuildTypeKHR
$mACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR :: forall r.
AccelerationStructureBuildTypeKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR         = AccelerationStructureBuildTypeKHR 1
-- | 'ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR' requests the
-- memory requirement for operations performed by either the host, or the
-- device.
pattern $bACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR :: AccelerationStructureBuildTypeKHR
$mACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR :: forall r.
AccelerationStructureBuildTypeKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = AccelerationStructureBuildTypeKHR 2
{-# complete ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR,
             ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR,
             ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR :: AccelerationStructureBuildTypeKHR #-}

conNameAccelerationStructureBuildTypeKHR :: String
conNameAccelerationStructureBuildTypeKHR :: String
conNameAccelerationStructureBuildTypeKHR = "AccelerationStructureBuildTypeKHR"

enumPrefixAccelerationStructureBuildTypeKHR :: String
enumPrefixAccelerationStructureBuildTypeKHR :: String
enumPrefixAccelerationStructureBuildTypeKHR = "ACCELERATION_STRUCTURE_BUILD_TYPE_"

showTableAccelerationStructureBuildTypeKHR :: [(AccelerationStructureBuildTypeKHR, String)]
showTableAccelerationStructureBuildTypeKHR :: [(AccelerationStructureBuildTypeKHR, String)]
showTableAccelerationStructureBuildTypeKHR =
  [ (AccelerationStructureBuildTypeKHR
ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR          , "HOST_KHR")
  , (AccelerationStructureBuildTypeKHR
ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR        , "DEVICE_KHR")
  , (AccelerationStructureBuildTypeKHR
ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR, "HOST_OR_DEVICE_KHR")
  ]

instance Show AccelerationStructureBuildTypeKHR where
  showsPrec :: Int -> AccelerationStructureBuildTypeKHR -> ShowS
showsPrec = String
-> [(AccelerationStructureBuildTypeKHR, String)]
-> String
-> (AccelerationStructureBuildTypeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> AccelerationStructureBuildTypeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixAccelerationStructureBuildTypeKHR
                            [(AccelerationStructureBuildTypeKHR, String)]
showTableAccelerationStructureBuildTypeKHR
                            String
conNameAccelerationStructureBuildTypeKHR
                            (\(AccelerationStructureBuildTypeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read AccelerationStructureBuildTypeKHR where
  readPrec :: ReadPrec AccelerationStructureBuildTypeKHR
readPrec = String
-> [(AccelerationStructureBuildTypeKHR, String)]
-> String
-> (Int32 -> AccelerationStructureBuildTypeKHR)
-> ReadPrec AccelerationStructureBuildTypeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixAccelerationStructureBuildTypeKHR
                          [(AccelerationStructureBuildTypeKHR, String)]
showTableAccelerationStructureBuildTypeKHR
                          String
conNameAccelerationStructureBuildTypeKHR
                          Int32 -> AccelerationStructureBuildTypeKHR
AccelerationStructureBuildTypeKHR


-- | VkAccelerationStructureCompatibilityKHR - Acceleration structure
-- compatibility
--
-- = See Also
--
-- 'getDeviceAccelerationStructureCompatibilityKHR'
newtype AccelerationStructureCompatibilityKHR = AccelerationStructureCompatibilityKHR Int32
  deriving newtype (AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
(AccelerationStructureCompatibilityKHR
 -> AccelerationStructureCompatibilityKHR -> Bool)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR -> Bool)
-> Eq AccelerationStructureCompatibilityKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c/= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
== :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c== :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
Eq, Eq AccelerationStructureCompatibilityKHR
Eq AccelerationStructureCompatibilityKHR =>
(AccelerationStructureCompatibilityKHR
 -> AccelerationStructureCompatibilityKHR -> Ordering)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR -> Bool)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR -> Bool)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR -> Bool)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR -> Bool)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR)
-> (AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR
    -> AccelerationStructureCompatibilityKHR)
-> Ord AccelerationStructureCompatibilityKHR
AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Ordering
AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
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 :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
$cmin :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
max :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
$cmax :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR
>= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c>= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
> :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c> :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
<= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c<= :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
< :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
$c< :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Bool
compare :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Ordering
$ccompare :: AccelerationStructureCompatibilityKHR
-> AccelerationStructureCompatibilityKHR -> Ordering
$cp1Ord :: Eq AccelerationStructureCompatibilityKHR
Ord, Ptr b -> Int -> IO AccelerationStructureCompatibilityKHR
Ptr b -> Int -> AccelerationStructureCompatibilityKHR -> IO ()
("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> IO AccelerationStructureCompatibilityKHR
("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> AccelerationStructureCompatibilityKHR -> IO ()
("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> AccelerationStructureCompatibilityKHR -> IO ()
AccelerationStructureCompatibilityKHR -> Int
(AccelerationStructureCompatibilityKHR -> Int)
-> (AccelerationStructureCompatibilityKHR -> Int)
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> Int -> IO AccelerationStructureCompatibilityKHR)
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> Int -> AccelerationStructureCompatibilityKHR -> IO ())
-> (forall b.
    Ptr b -> Int -> IO AccelerationStructureCompatibilityKHR)
-> (forall b.
    Ptr b -> Int -> AccelerationStructureCompatibilityKHR -> IO ())
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> IO AccelerationStructureCompatibilityKHR)
-> (("pCompatibility"
     ::: Ptr AccelerationStructureCompatibilityKHR)
    -> AccelerationStructureCompatibilityKHR -> IO ())
-> Storable AccelerationStructureCompatibilityKHR
forall b. Ptr b -> Int -> IO AccelerationStructureCompatibilityKHR
forall b.
Ptr b -> Int -> AccelerationStructureCompatibilityKHR -> 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 :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> AccelerationStructureCompatibilityKHR -> IO ()
$cpoke :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> AccelerationStructureCompatibilityKHR -> IO ()
peek :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
$cpeek :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> IO AccelerationStructureCompatibilityKHR
pokeByteOff :: Ptr b -> Int -> AccelerationStructureCompatibilityKHR -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> AccelerationStructureCompatibilityKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO AccelerationStructureCompatibilityKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AccelerationStructureCompatibilityKHR
pokeElemOff :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> AccelerationStructureCompatibilityKHR -> IO ()
$cpokeElemOff :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> AccelerationStructureCompatibilityKHR -> IO ()
peekElemOff :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> IO AccelerationStructureCompatibilityKHR
$cpeekElemOff :: ("pCompatibility" ::: Ptr AccelerationStructureCompatibilityKHR)
-> Int -> IO AccelerationStructureCompatibilityKHR
alignment :: AccelerationStructureCompatibilityKHR -> Int
$calignment :: AccelerationStructureCompatibilityKHR -> Int
sizeOf :: AccelerationStructureCompatibilityKHR -> Int
$csizeOf :: AccelerationStructureCompatibilityKHR -> Int
Storable, AccelerationStructureCompatibilityKHR
AccelerationStructureCompatibilityKHR
-> Zero AccelerationStructureCompatibilityKHR
forall a. a -> Zero a
zero :: AccelerationStructureCompatibilityKHR
$czero :: AccelerationStructureCompatibilityKHR
Zero)

-- | 'ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR' when the
-- @pVersion@ version acceleration structure is compatibile with @device@.
pattern $bACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR :: AccelerationStructureCompatibilityKHR
$mACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR :: forall r.
AccelerationStructureCompatibilityKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR   = AccelerationStructureCompatibilityKHR 0
-- | 'ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR' when the
-- @pVersion@ version acceleration structure is not compatibile with
-- @device@.
pattern $bACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR :: AccelerationStructureCompatibilityKHR
$mACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR :: forall r.
AccelerationStructureCompatibilityKHR
-> (Void# -> r) -> (Void# -> r) -> r
ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = AccelerationStructureCompatibilityKHR 1
{-# complete ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR,
             ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR :: AccelerationStructureCompatibilityKHR #-}

conNameAccelerationStructureCompatibilityKHR :: String
conNameAccelerationStructureCompatibilityKHR :: String
conNameAccelerationStructureCompatibilityKHR = "AccelerationStructureCompatibilityKHR"

enumPrefixAccelerationStructureCompatibilityKHR :: String
enumPrefixAccelerationStructureCompatibilityKHR :: String
enumPrefixAccelerationStructureCompatibilityKHR = "ACCELERATION_STRUCTURE_COMPATIBILITY_"

showTableAccelerationStructureCompatibilityKHR :: [(AccelerationStructureCompatibilityKHR, String)]
showTableAccelerationStructureCompatibilityKHR :: [(AccelerationStructureCompatibilityKHR, String)]
showTableAccelerationStructureCompatibilityKHR =
  [ (AccelerationStructureCompatibilityKHR
ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR  , "COMPATIBLE_KHR")
  , (AccelerationStructureCompatibilityKHR
ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR, "INCOMPATIBLE_KHR")
  ]

instance Show AccelerationStructureCompatibilityKHR where
  showsPrec :: Int -> AccelerationStructureCompatibilityKHR -> ShowS
showsPrec = String
-> [(AccelerationStructureCompatibilityKHR, String)]
-> String
-> (AccelerationStructureCompatibilityKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> AccelerationStructureCompatibilityKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixAccelerationStructureCompatibilityKHR
                            [(AccelerationStructureCompatibilityKHR, String)]
showTableAccelerationStructureCompatibilityKHR
                            String
conNameAccelerationStructureCompatibilityKHR
                            (\(AccelerationStructureCompatibilityKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read AccelerationStructureCompatibilityKHR where
  readPrec :: ReadPrec AccelerationStructureCompatibilityKHR
readPrec = String
-> [(AccelerationStructureCompatibilityKHR, String)]
-> String
-> (Int32 -> AccelerationStructureCompatibilityKHR)
-> ReadPrec AccelerationStructureCompatibilityKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixAccelerationStructureCompatibilityKHR
                          [(AccelerationStructureCompatibilityKHR, String)]
showTableAccelerationStructureCompatibilityKHR
                          String
conNameAccelerationStructureCompatibilityKHR
                          Int32 -> AccelerationStructureCompatibilityKHR
AccelerationStructureCompatibilityKHR


type KHR_ACCELERATION_STRUCTURE_SPEC_VERSION = 11

-- No documentation found for TopLevel "VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION"
pattern KHR_ACCELERATION_STRUCTURE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_ACCELERATION_STRUCTURE_SPEC_VERSION :: a
$mKHR_ACCELERATION_STRUCTURE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_ACCELERATION_STRUCTURE_SPEC_VERSION = 11


type KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME = "VK_KHR_acceleration_structure"

-- No documentation found for TopLevel "VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME"
pattern KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_ACCELERATION_STRUCTURE_EXTENSION_NAME :: a
$mKHR_ACCELERATION_STRUCTURE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME = "VK_KHR_acceleration_structure"