C Specification

The VkAccelerationStructureCreateInfoKHR structure is defined as:

// Provided by VK_KHR_ray_tracing
typedef struct VkAccelerationStructureCreateInfoKHR {
    VkStructureType                                            sType;
    const void*                                                pNext;
    VkDeviceSize                                               compactedSize;
    VkAccelerationStructureTypeKHR                             type;
    VkBuildAccelerationStructureFlagsKHR                       flags;
    uint32_t                                                   maxGeometryCount;
    const VkAccelerationStructureCreateGeometryTypeInfoKHR*    pGeometryInfos;
    VkDeviceAddress                                            deviceAddress;
} VkAccelerationStructureCreateInfoKHR;

Members

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 bound to an identically created VkDeviceMemory object.

Apps should avoid creating acceleration structures with app-provided addresses and implementation-provided addresses in the same process, to reduce the likelihood of VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR errors.

Valid Usage
  • If compactedSize is not 0 then maxGeometryCount must be 0

  • If compactedSize is 0 then maxGeometryCount must not be 0

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR then maxGeometryCount must be less than or equal to VkPhysicalDeviceRayTracingPropertiesKHR::maxGeometryCount

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR then the maxPrimitiveCount member of each element of the pGeometryInfos array must be less than or equal to VkPhysicalDeviceRayTracingPropertiesKHR::maxInstanceCount

  • The total number of triangles in all geometries must be less than or equal to VkPhysicalDeviceRayTracingPropertiesKHR::maxPrimitiveCount

  • The total number of AABBs in all geometries must be less than or equal to VkPhysicalDeviceRayTracingPropertiesKHR::maxPrimitiveCount

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR and compactedSize is 0, maxGeometryCount must be 1

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR and compactedSize is 0, the geometryType member of elements of pGeometryInfos must be VK_GEOMETRY_TYPE_INSTANCES_KHR

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR and compactedSize is 0, the geometryType member of elements of pGeometryInfos must not be VK_GEOMETRY_TYPE_INSTANCES_KHR

  • If type is VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR then the geometryType member of each geometry in pGeometryInfos must be the same

  • If flags has the VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR bit set, then it must not have the VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR bit set

  • If deviceAddress is not 0, VkPhysicalDeviceRayTracingFeaturesKHR::rayTracingAccelerationStructureCaptureReplay must be VK_TRUE

Valid Usage (Implicit)

See Also

Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0