C Specification

To allow constructing geometry instances with device code if desired, we need to be able to query a opaque handle for an acceleration structure. This handle is a value of 8 bytes. To get this handle, call:

// Provided by VK_NV_ray_tracing
VkResult vkGetAccelerationStructureHandleNV(
    VkDevice                                    device,
    VkAccelerationStructureKHR                  accelerationStructure,
    size_t                                      dataSize,
    void*                                       pData);


  • device is the logical device that owns the acceleration structures.

  • accelerationStructure is the acceleration structure.

  • dataSize is the size in bytes of the buffer pointed to by pData.

  • pData is a pointer to a user-allocated buffer where the results will be written.


Valid Usage
  • dataSize must be large enough to contain the result of the query, as described above

  • accelerationStructure must be bound completely and contiguously to a single VkDeviceMemory object via vkBindAccelerationStructureMemoryKHR

Valid Usage (Implicit)
  • device must be a valid VkDevice handle

  • accelerationStructure must be a valid VkAccelerationStructureKHR handle

  • pData must be a valid pointer to an array of dataSize bytes

  • dataSize must be greater than 0

  • accelerationStructure must have been created, allocated, or retrieved from device

Return Codes
On success, this command returns

On failure, this command returns


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