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
  • VUID-VkAccelerationStructureCreateInfoKHR-compactedSize-03490
    If compactedSize is not 0 then maxGeometryCount must be 0

  • VUID-VkAccelerationStructureCreateInfoKHR-compactedSize-02993
    If compactedSize is 0 then maxGeometryCount must not be 0

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

  • VUID-VkAccelerationStructureCreateInfoKHR-type-03492
    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

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

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

  • VUID-VkAccelerationStructureCreateInfoKHR-type-03495
    If type is VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR and compactedSize is 0, maxGeometryCount must be 1

  • VUID-VkAccelerationStructureCreateInfoKHR-type-03496
    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

  • VUID-VkAccelerationStructureCreateInfoKHR-type-03497
    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

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

  • VUID-VkAccelerationStructureCreateInfoKHR-flags-03499
    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

  • VUID-VkAccelerationStructureCreateInfoKHR-deviceAddress-03500
    If deviceAddress is not 0, VkPhysicalDeviceRayTracingFeaturesKHR::rayTracingAccelerationStructureCaptureReplay must be VK_TRUE

Valid Usage (Implicit)
  • VUID-VkAccelerationStructureCreateInfoKHR-sType-sType
    sType must be VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR

  • VUID-VkAccelerationStructureCreateInfoKHR-pNext-pNext
    pNext must be NULL

  • VUID-VkAccelerationStructureCreateInfoKHR-type-parameter
    type must be a valid VkAccelerationStructureTypeKHR value

  • VUID-VkAccelerationStructureCreateInfoKHR-flags-parameter
    flags must be a valid combination of VkBuildAccelerationStructureFlagBitsKHR values

  • VUID-VkAccelerationStructureCreateInfoKHR-pGeometryInfos-parameter
    If maxGeometryCount is not 0, pGeometryInfos must be a valid pointer to an array of maxGeometryCount valid VkAccelerationStructureCreateGeometryTypeInfoKHR structures

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