All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.KHRAccelerationStructure Maven / Gradle / Ivy

Go to download

A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.vulkan;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;

/**
 * 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
  • *
* *
VK_KHR_acceleration_structure
* *
*
Name String
*
{@code VK_KHR_acceleration_structure}
*
Extension Type
*
Device extension
*
Registered Extension Number
*
151
*
Revision
*
13
*
Extension and Version Dependencies
*
    *
  • Requires Vulkan 1.1
  • *
  • Requires {@link EXTDescriptorIndexing VK_EXT_descriptor_indexing}
  • *
  • Requires {@link KHRBufferDeviceAddress VK_KHR_buffer_device_address}
  • *
  • Requires {@link KHRDeferredHostOperations VK_KHR_deferred_host_operations}
  • *
*
Contact
*
*
* *
Other Extension Metadata
* *
*
Last Modified Date
*
2021-09-30
*
Contributors
*
    *
  • Samuel Bourasseau, Adobe
  • *
  • 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
  • *
*
*/ public class KHRAccelerationStructure { /** The extension specification version. */ public static final int VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION = 13; /** The extension name. */ public static final String VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME = "VK_KHR_acceleration_structure"; /** * Extends {@code VkStructureType}. * *
Enum values:
* *
    *
  • {@link #VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR}
  • *
*/ public static final int VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR = 1000150007, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR = 1000150000, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR = 1000150002, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR = 1000150003, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR = 1000150004, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR = 1000150005, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR = 1000150006, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR = 1000150009, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR = 1000150010, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR = 1000150011, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR = 1000150012, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR = 1000150013, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR = 1000150014, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = 1000150017, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR = 1000150020; /** Extends {@code VkPipelineStageFlagBits}. */ public static final int VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x2000000; /** Extends {@code VkDescriptorType}. */ public static final int VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000; /** * Extends {@code VkAccessFlagBits}. * *
Enum values:
* *
    *
  • {@link #VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR}
  • *
  • {@link #VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR}
  • *
*/ public static final int VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x200000, VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x400000; /** * Extends {@code VkQueryType}. * *
Enum values:
* *
    *
  • {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}
  • *
  • {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}
  • *
*/ public static final int VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR = 1000150000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR = 1000150001; /** Extends {@code VkObjectType}. */ public static final int VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000; /** Extends {@code VkDebugReportObjectTypeEXT}. */ public static final int VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000; /** Extends {@code VkIndexType}. */ public static final int VK_INDEX_TYPE_NONE_KHR = 1000165000; /** Extends {@code VkFormatFeatureFlagBits}. */ public static final int VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000; /** * Extends {@code VkBufferUsageFlagBits}. * *
Enum values:
* *
    *
  • {@link #VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR}
  • *
  • {@link #VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR}
  • *
*/ public static final int VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x80000, VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x100000; /** Extends {@code VkFormatFeatureFlagBits2KHR}. */ public static final long VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000L; /** * VkAccelerationStructureTypeKHR - Type of acceleration structure * *
Description
* *
    *
  • {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR} is a top-level acceleration structure containing instance data referring to bottom-level acceleration structures.
  • *
  • {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR} is a bottom-level acceleration structure containing the AABBs or geometry to be intersected.
  • *
  • {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR} is an acceleration structure whose type is determined at build time used for special circumstances.
  • *
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}, {@link VkAccelerationStructureCreateInfoKHR}, {@link VkAccelerationStructureInfoNV}

*/ public static final int VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR = 0, VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR = 1, VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR = 2; /** * VkBuildAccelerationStructureFlagBitsKHR - Bitmask specifying additional parameters for acceleration structure builds * *
Description
* *
    *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR} indicates that the specified acceleration structure can be updated with a {@code mode} of {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} in {@link VkAccelerationStructureBuildGeometryInfoKHR} or an {@code update} of {@link VK10#VK_TRUE TRUE} in {@link NVRayTracing#vkCmdBuildAccelerationStructureNV CmdBuildAccelerationStructureNV} .
  • *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR 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 {@code mode} of {@link #VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR} to produce a compacted acceleration structure.
  • *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR} indicates that the given acceleration structure build should prioritize trace performance over build time.
  • *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR} indicates that the given acceleration structure build should prioritize build time over trace performance.
  • *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR} indicates that this acceleration structure should minimize the size of the scratch memory and the final result acceleration structure, potentially at the expense of build time or trace performance.
  • *
* *
Note
* *

{@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR} and {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR 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.

*
*/ public static final int VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR = 0x1, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR = 0x2, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR = 0x4, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = 0x8, VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR = 0x10; /** * VkBuildAccelerationStructureModeKHR - Enum specifying the type of build operation to perform * *
Description
* *
    *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR} specifies that the destination acceleration structure will be built using the specified geometries.
  • *
  • {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR 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.
  • *
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}

*/ public static final int VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR = 0, VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR = 1; /** * VkGeometryTypeKHR - Enum specifying which type of geometry is provided * *
Description
* *
    *
  • {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR} specifies a geometry type consisting of triangles.
  • *
  • {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR} specifies a geometry type consisting of axis-aligned bounding boxes.
  • *
  • {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} specifies a geometry type consisting of acceleration structure instances.
  • *
* *
See Also
* *

{@link VkAccelerationStructureGeometryKHR}, {@link VkGeometryNV}

*/ public static final int VK_GEOMETRY_TYPE_TRIANGLES_KHR = 0, VK_GEOMETRY_TYPE_AABBS_KHR = 1, VK_GEOMETRY_TYPE_INSTANCES_KHR = 2; /** * VkGeometryFlagBitsKHR - Bitmask specifying additional parameters for a geometry * *
Description
* *
    *
  • {@link #VK_GEOMETRY_OPAQUE_BIT_KHR GEOMETRY_OPAQUE_BIT_KHR} indicates that this geometry does not invoke the any-hit shaders even if present in a hit group.
  • *
  • {@link #VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR 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.
  • *
*/ public static final int VK_GEOMETRY_OPAQUE_BIT_KHR = 0x1, VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = 0x2; /** * VkAccelerationStructureBuildTypeKHR - Acceleration structure build type * *
Description
* *
    *
  • {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR} requests the memory requirement for operations performed by the host.
  • *
  • {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR} requests the memory requirement for operations performed by the device.
  • *
  • {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR} requests the memory requirement for operations performed by either the host, or the device.
  • *
* *
See Also
* *

{@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR}

*/ public static final int VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0, VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1, VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2; /** * VkGeometryInstanceFlagBitsKHR - Instance flag bits * *
Description
* *
    *
  • {@link #VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR} disables face culling for this instance.
  • *
  • {@link #VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR} indicates that the facing determination for geometry in this instance is inverted. Because the facing is determined in object space, an instance transform does not change the winding, but a geometry transform does.
  • *
  • {@link #VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR} causes this instance to act as though {@link #VK_GEOMETRY_OPAQUE_BIT_KHR GEOMETRY_OPAQUE_BIT_KHR} were specified on all geometries referenced by this instance. This behavior can be overridden by the SPIR-V {@code NoOpaqueKHR} ray flag.
  • *
  • {@link #VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR} causes this instance to act as though {@link #VK_GEOMETRY_OPAQUE_BIT_KHR GEOMETRY_OPAQUE_BIT_KHR} were not specified on all geometries referenced by this instance. This behavior can be overridden by the SPIR-V {@code OpaqueKHR} ray flag.
  • *
* *

{@link #VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR} and {@link #VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR} must not be used in the same flag.

* *
Enum values:
* *
    *
  • {@link #VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR}
  • *
*/ public static final int VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR = 0x1, VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR = 0x2, VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR = 0x4, VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0x8, VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = 0x2; /** * VkAccelerationStructureCreateFlagBitsKHR - Bitmask specifying additional creation parameters for acceleration structure * *
Description
* *
    *
  • {@link #VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR 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.
  • *
*/ public static final int VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x1; /** * VkCopyAccelerationStructureModeKHR - Acceleration structure copy mode * *
Description
* *
    *
  • {@link #VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR} creates a direct copy of the acceleration structure specified in {@code src} into the one specified by {@code dst}. The {@code dst} acceleration structure must have been created with the same parameters as {@code src}. If {@code src} contains references to other acceleration structures, {@code dst} will reference the same acceleration structures.
  • *
  • {@link #VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR} creates a more compact version of an acceleration structure {@code src} into {@code dst}. The acceleration structure {@code dst} must have been created with a size at least as large as that returned by {@link #vkCmdWriteAccelerationStructuresPropertiesKHR CmdWriteAccelerationStructuresPropertiesKHR} or {@link #vkWriteAccelerationStructuresPropertiesKHR WriteAccelerationStructuresPropertiesKHR} after the build of the acceleration structure specified by {@code src}. If {@code src} contains references to other acceleration structures, {@code dst} will reference the same acceleration structures.
  • *
  • {@link #VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR} serializes the acceleration structure to a semi-opaque format which can be reloaded on a compatible implementation.
  • *
  • {@link #VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR} deserializes the semi-opaque serialization format in the buffer to the acceleration structure.
  • *
* *
See Also
* *

{@link VkCopyAccelerationStructureInfoKHR}, {@link VkCopyAccelerationStructureToMemoryInfoKHR}, {@link VkCopyMemoryToAccelerationStructureInfoKHR}, {@link NVRayTracing#vkCmdCopyAccelerationStructureNV CmdCopyAccelerationStructureNV}

*/ public static final int VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR = 0, VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR = 1, VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR = 2, VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR = 3; /** * VkAccelerationStructureCompatibilityKHR - Acceleration structure compatibility * *
Description
* *
    *
  • {@link #VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR} if the {@code pVersionData} version acceleration structure is compatible with {@code device}.
  • *
  • {@link #VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR} if the {@code pVersionData} version acceleration structure is not compatible with {@code device}.
  • *
* *
See Also
* *

{@link #vkGetDeviceAccelerationStructureCompatibilityKHR GetDeviceAccelerationStructureCompatibilityKHR}

*/ public static final int VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0, VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1; protected KHRAccelerationStructure() { throw new UnsupportedOperationException(); } // --- [ vkCreateAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkCreateAccelerationStructureKHR CreateAccelerationStructureKHR} */ public static int nvkCreateAccelerationStructureKHR(VkDevice device, long pCreateInfo, long pAllocator, long pAccelerationStructure) { long __functionAddress = device.getCapabilities().vkCreateAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); } } return callPPPPI(device.address(), pCreateInfo, pAllocator, pAccelerationStructure, __functionAddress); } /** * Create a new acceleration structure object. * *
C Specification
* *

To create an acceleration structure, call:

* *

     * VkResult vkCreateAccelerationStructureKHR(
     *     VkDevice                                    device,
     *     const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
     *     const VkAllocationCallbacks*                pAllocator,
     *     VkAccelerationStructureKHR*                 pAccelerationStructure);
* *
Description
* *

Similar to other objects in Vulkan, the acceleration structure creation merely creates an object with a specific “{@code shape}”. The type and quantity of geometry that can be built into an acceleration structure is determined by the parameters of {@link VkAccelerationStructureCreateInfoKHR}.

* *

Populating the data in the object after allocating and binding memory is done with commands such as {@link #vkCmdBuildAccelerationStructuresKHR CmdBuildAccelerationStructuresKHR}, {@link #vkBuildAccelerationStructuresKHR BuildAccelerationStructuresKHR}, {@link #vkCmdCopyAccelerationStructureKHR CmdCopyAccelerationStructureKHR}, and {@link #vkCopyAccelerationStructureKHR 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
* * * *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pCreateInfo} must be a valid pointer to a valid {@link VkAccelerationStructureCreateInfoKHR} structure
  • *
  • If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
  • *
  • {@code pAccelerationStructure} must be a valid pointer to a {@code VkAccelerationStructureKHR} handle
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link KHRBufferDeviceAddress#VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR}
  • *
*
* *
See Also
* *

{@link VkAccelerationStructureCreateInfoKHR}, {@link VkAllocationCallbacks}

* * @param device the logical device that creates the acceleration structure object. * @param pCreateInfo a pointer to a {@link VkAccelerationStructureCreateInfoKHR} structure containing parameters affecting creation of the acceleration structure. * @param pAllocator controls host memory allocation as described in the Memory Allocation chapter. * @param pAccelerationStructure a pointer to a {@code VkAccelerationStructureKHR} handle in which the resulting acceleration structure object is returned. */ @NativeType("VkResult") public static int vkCreateAccelerationStructureKHR(VkDevice device, @NativeType("VkAccelerationStructureCreateInfoKHR const *") VkAccelerationStructureCreateInfoKHR pCreateInfo, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkAccelerationStructureKHR *") LongBuffer pAccelerationStructure) { if (CHECKS) { check(pAccelerationStructure, 1); } return nvkCreateAccelerationStructureKHR(device, pCreateInfo.address(), memAddressSafe(pAllocator), memAddress(pAccelerationStructure)); } // --- [ vkDestroyAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkDestroyAccelerationStructureKHR DestroyAccelerationStructureKHR} */ public static void nvkDestroyAccelerationStructureKHR(VkDevice device, long accelerationStructure, long pAllocator) { long __functionAddress = device.getCapabilities().vkDestroyAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); } } callPJPV(device.address(), accelerationStructure, pAllocator, __functionAddress); } /** * Destroy an acceleration structure object. * *
C Specification
* *

To destroy an acceleration structure, call:

* *

     * void vkDestroyAccelerationStructureKHR(
     *     VkDevice                                    device,
     *     VkAccelerationStructureKHR                  accelerationStructure,
     *     const VkAllocationCallbacks*                pAllocator);
* *
Valid Usage
* *
    *
  • All submitted commands that refer to {@code accelerationStructure} must have completed execution
  • *
  • If {@link VkAllocationCallbacks} were provided when {@code accelerationStructure} was created, a compatible set of callbacks must be provided here
  • *
  • If no {@link VkAllocationCallbacks} were provided when {@code accelerationStructure} was created, {@code pAllocator} must be {@code NULL}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • If {@code accelerationStructure} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code accelerationStructure} must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
  • *
  • If {@code accelerationStructure} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code accelerationStructure} must be externally synchronized
  • *
* *
See Also
* *

{@link VkAllocationCallbacks}

* * @param device the logical device that destroys the acceleration structure. * @param accelerationStructure the acceleration structure to destroy. * @param pAllocator controls host memory allocation as described in the Memory Allocation chapter. */ public static void vkDestroyAccelerationStructureKHR(VkDevice device, @NativeType("VkAccelerationStructureKHR") long accelerationStructure, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator) { nvkDestroyAccelerationStructureKHR(device, accelerationStructure, memAddressSafe(pAllocator)); } // --- [ vkCmdBuildAccelerationStructuresKHR ] --- /** * Unsafe version of: {@link #vkCmdBuildAccelerationStructuresKHR CmdBuildAccelerationStructuresKHR} * * @param infoCount the number of acceleration structures to build. It specifies the number of the {@code pInfos} structures and {@code ppBuildRangeInfos} pointers that must be provided. */ public static void nvkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, int infoCount, long pInfos, long ppBuildRangeInfos) { long __functionAddress = commandBuffer.getCapabilities().vkCmdBuildAccelerationStructuresKHR; if (CHECKS) { check(__functionAddress); } callPPPV(commandBuffer.address(), infoCount, pInfos, ppBuildRangeInfos, __functionAddress); } /** * Build an acceleration structure. * *
C Specification
* *

To build acceleration structures call:

* *

     * void vkCmdBuildAccelerationStructuresKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     uint32_t                                    infoCount,
     *     const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
     *     const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos);
* *
Description
* *

The {@code vkCmdBuildAccelerationStructuresKHR} 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 {@link #vkCmdBuildAccelerationStructuresKHR 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 {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::scratchData} buffer device addresses must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link #VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR} or {@link #VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR}. Similarly for accesses to each {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::srcAccelerationStructure} and {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::dstAccelerationStructure}.

* *

Accesses to other input buffers as identified by any used values of {@link VkAccelerationStructureGeometryMotionTrianglesDataNV}{@code ::vertexData}, {@link VkAccelerationStructureGeometryTrianglesDataKHR}{@code ::vertexData}, {@link VkAccelerationStructureGeometryTrianglesDataKHR}{@code ::indexData}, {@link VkAccelerationStructureGeometryTrianglesDataKHR}{@code ::transformData}, {@link VkAccelerationStructureGeometryAabbsDataKHR}{@code ::data}, and {@link VkAccelerationStructureGeometryInstancesDataKHR}{@code ::data} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link VK10#VK_ACCESS_SHADER_READ_BIT ACCESS_SHADER_READ_BIT}.

* *
Valid Usage
* *
    *
  • The {@code mode} member of each element of {@code pInfos} must be a valid {@code VkBuildAccelerationStructureModeKHR} value
  • *
  • If the {@code srcAccelerationStructure} member of any element of {@code pInfos} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, the {@code srcAccelerationStructure} member must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must not be {@link VK10#VK_NULL_HANDLE NULL_HANDLE}
  • *
  • The {@code srcAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, inactive primitives in its {@code srcAccelerationStructure} member must not be made active
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, active primitives in its {@code srcAccelerationStructure} member must not be made inactive
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any other element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code dstAccelerationStructure} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any element of {@code pInfos} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing any acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}, which is accessed by this command
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must have previously been constructed with {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR} set in {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::flags} in the build
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} and {@code dstAccelerationStructure} members must either be the same {@code VkAccelerationStructureKHR}, or not have any memory aliasing
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code geometryCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code type} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code geometryType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.vertexFormat} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.maxVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.indexType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was {@code NULL} when {@code srcAccelerationStructure} was last built, then it must be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was not {@code NULL} when {@code srcAccelerationStructure} was last built, then it must not be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, and {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, then the value of each index referenced must be the same as the corresponding index value when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, its {@code primitiveCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, if the corresponding geometry uses indices, its {@code firstVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, the corresponding {@code ppBuildRangeInfos}[i][j].{@code primitiveCount} must be less than or equal to {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::maxInstanceCount}
  • *
* *
    *
  • For each element of {@code pInfos}, the {@code buffer} used to create its {@code dstAccelerationStructure} member must be bound to device memory
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} the {@code buffer} used to create its {@code srcAccelerationStructure} member must be bound to device memory
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create each acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} must be bound to device memory
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.deviceAddress} and {@code pInfos}[i].{@code scratchData.deviceAddress} + N - 1 must be in the buffer device address range of the same buffer, where N is given by the {@code buildScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.deviceAddress} and {@code pInfos}[i].{@code scratchData.deviceAddress} + N - 1 must be in the buffer device address range of the same buffer, where N is given by the {@code updateScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • The buffers from which the buffer device addresses for all of the {@code geometry.triangles.vertexData}, {@code geometry.triangles.indexData}, {@code geometry.triangles.transformData}, {@code geometry.aabbs.data}, and {@code geometry.instances.data} members of all {@code pInfos}[i].{@code pGeometries} and {@code pInfos}[i].{@code ppGeometries} are queried must have been created with the {@link #VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR} usage flag
  • *
  • The buffer from which the buffer device address {@code pInfos}[i].{@code scratchData.deviceAddress} is queried must have been created with {@link VK10#VK_BUFFER_USAGE_STORAGE_BUFFER_BIT BUFFER_USAGE_STORAGE_BUFFER_BIT} usage flag
  • *
  • For each element of {@code pInfos}, its {@code scratchData.deviceAddress} member must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For each element of {@code pInfos}, if {@code scratchData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For each element of {@code pInfos}, its {@code scratchData.deviceAddress} member must be a multiple of {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::minAccelerationStructureScratchOffsetAlignment}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, {@code geometry.triangles.vertexData.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.vertexData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, {@code geometry.triangles.vertexData.deviceAddress} must be aligned to the size in bytes of the smallest component of the format in {@code vertexFormat}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, {@code geometry.triangles.indexData.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, if {@code geometry.triangles.indexData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, and with {@code geometry.triangles.indexType} not equal to {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, {@code geometry.triangles.indexData.deviceAddress} must be aligned to the size in bytes of the type in {@code indexType}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is not 0, it must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is not 0, it must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, {@code geometry.aabbs.data.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, if {@code geometry.aabbs.data.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, {@code geometry.aabbs.data.deviceAddress} must be aligned to 8 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_FALSE FALSE}, {@code geometry.instances.data.deviceAddress} must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_TRUE TRUE}, {@code geometry.instances.data.deviceAddress} must be aligned to 8 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_TRUE TRUE}, each element of {@code geometry.instances.data.deviceAddress} in device memory must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, {@code geometry.instances.data.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.instances.data.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, each {@link VkAccelerationStructureInstanceKHR}{@code ::accelerationStructureReference} value in {@code geometry.instances.data.deviceAddress} must be a valid device address containing a value obtained from {@link #vkGetAccelerationStructureDeviceAddressKHR GetAccelerationStructureDeviceAddressKHR}
  • *
* *
    *
  • For each {@code pInfos}[i], {@code dstAccelerationStructure} must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::size} greater than or equal to the memory size required by the build operation, as returned by {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with pBuildInfo = pInfos[i] and with each element of the {@code pMaxPrimitiveCounts} array greater than or equal to the equivalent {@code ppBuildRangeInfos}[i][j].{@code primitiveCount} values for {@code j} in [0,pInfos[i].geometryCount)
  • *
  • Each element of {@code ppBuildRangeInfos}[i] must be a valid pointer to an array of {@code pInfos}[i].{@code geometryCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pInfos} must be a valid pointer to an array of {@code infoCount} valid {@link VkAccelerationStructureBuildGeometryInfoKHR} structures
  • *
  • {@code ppBuildRangeInfos} must be a valid pointer to an array of {@code infoCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
  • {@code infoCount} must be greater than 0
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}, {@link VkAccelerationStructureBuildRangeInfoKHR}

* * @param commandBuffer the command buffer into which the command will be recorded. * @param pInfos a pointer to an array of {@code infoCount} {@link VkAccelerationStructureBuildGeometryInfoKHR} structures defining the geometry used to build each acceleration structure. * @param ppBuildRangeInfos a pointer to an array of {@code infoCount} pointers to arrays of {@link VkAccelerationStructureBuildRangeInfoKHR} structures. Each {@code ppBuildRangeInfos}[i] is a pointer to an array of {@code pInfos}[i].{@code geometryCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures defining dynamic offsets to the addresses where geometry data is stored, as defined by {@code pInfos}[i]. */ public static void vkCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR.Buffer pInfos, @NativeType("VkAccelerationStructureBuildRangeInfoKHR const * const *") PointerBuffer ppBuildRangeInfos) { if (CHECKS) { check(ppBuildRangeInfos, pInfos.remaining()); } nvkCmdBuildAccelerationStructuresKHR(commandBuffer, pInfos.remaining(), pInfos.address(), memAddress(ppBuildRangeInfos)); } // --- [ vkCmdBuildAccelerationStructuresIndirectKHR ] --- /** * Unsafe version of: {@link #vkCmdBuildAccelerationStructuresIndirectKHR CmdBuildAccelerationStructuresIndirectKHR} * * @param infoCount the number of acceleration structures to build. */ public static void nvkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, int infoCount, long pInfos, long pIndirectDeviceAddresses, long pIndirectStrides, long ppMaxPrimitiveCounts) { long __functionAddress = commandBuffer.getCapabilities().vkCmdBuildAccelerationStructuresIndirectKHR; if (CHECKS) { check(__functionAddress); } callPPPPPV(commandBuffer.address(), infoCount, pInfos, pIndirectDeviceAddresses, pIndirectStrides, ppMaxPrimitiveCounts, __functionAddress); } /** * Build an acceleration structure with some parameters provided on the device. * *
C Specification
* *

To build acceleration structures with some parameters sourced on the device call:

* *

     * void vkCmdBuildAccelerationStructuresIndirectKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     uint32_t                                    infoCount,
     *     const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
     *     const VkDeviceAddress*                      pIndirectDeviceAddresses,
     *     const uint32_t*                             pIndirectStrides,
     *     const uint32_t* const*                      ppMaxPrimitiveCounts);
* *
Description
* *

Accesses to acceleration structures, scratch buffers, vertex buffers, index buffers, and instance buffers must be synchronized as with vkCmdBuildAccelerationStructuresKHR.

* *

Accesses to any element of {@code pIndirectDeviceAddresses} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link VK10#VK_ACCESS_INDIRECT_COMMAND_READ_BIT ACCESS_INDIRECT_COMMAND_READ_BIT}.

* *
Valid Usage
* *
    *
  • The {@code mode} member of each element of {@code pInfos} must be a valid {@code VkBuildAccelerationStructureModeKHR} value
  • *
  • If the {@code srcAccelerationStructure} member of any element of {@code pInfos} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, the {@code srcAccelerationStructure} member must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must not be {@link VK10#VK_NULL_HANDLE NULL_HANDLE}
  • *
  • The {@code srcAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, inactive primitives in its {@code srcAccelerationStructure} member must not be made active
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, active primitives in its {@code srcAccelerationStructure} member must not be made inactive
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any other element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code dstAccelerationStructure} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any element of {@code pInfos} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing any acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}, which is accessed by this command
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must have previously been constructed with {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR} set in {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::flags} in the build
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} and {@code dstAccelerationStructure} members must either be the same {@code VkAccelerationStructureKHR}, or not have any memory aliasing
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code geometryCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code type} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code geometryType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.vertexFormat} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.maxVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.indexType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was {@code NULL} when {@code srcAccelerationStructure} was last built, then it must be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was not {@code NULL} when {@code srcAccelerationStructure} was last built, then it must not be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, and {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, then the value of each index referenced must be the same as the corresponding index value when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, its {@code primitiveCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, if the corresponding geometry uses indices, its {@code firstVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, the corresponding {@code ppMaxPrimitiveCounts}[i][j] must be less than or equal to {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::maxInstanceCount}
  • *
* *
    *
  • For each element of {@code pInfos}, the {@code buffer} used to create its {@code dstAccelerationStructure} member must be bound to device memory
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} the {@code buffer} used to create its {@code srcAccelerationStructure} member must be bound to device memory
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create each acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} must be bound to device memory
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.deviceAddress} and {@code pInfos}[i].{@code scratchData.deviceAddress} + N - 1 must be in the buffer device address range of the same buffer, where N is given by the {@code buildScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.deviceAddress} and {@code pInfos}[i].{@code scratchData.deviceAddress} + N - 1 must be in the buffer device address range of the same buffer, where N is given by the {@code updateScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • The buffers from which the buffer device addresses for all of the {@code geometry.triangles.vertexData}, {@code geometry.triangles.indexData}, {@code geometry.triangles.transformData}, {@code geometry.aabbs.data}, and {@code geometry.instances.data} members of all {@code pInfos}[i].{@code pGeometries} and {@code pInfos}[i].{@code ppGeometries} are queried must have been created with the {@link #VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR} usage flag
  • *
  • The buffer from which the buffer device address {@code pInfos}[i].{@code scratchData.deviceAddress} is queried must have been created with {@link VK10#VK_BUFFER_USAGE_STORAGE_BUFFER_BIT BUFFER_USAGE_STORAGE_BUFFER_BIT} usage flag
  • *
  • For each element of {@code pInfos}, its {@code scratchData.deviceAddress} member must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For each element of {@code pInfos}, if {@code scratchData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For each element of {@code pInfos}, its {@code scratchData.deviceAddress} member must be a multiple of {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::minAccelerationStructureScratchOffsetAlignment}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, {@code geometry.triangles.vertexData.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.vertexData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, {@code geometry.triangles.vertexData.deviceAddress} must be aligned to the size in bytes of the smallest component of the format in {@code vertexFormat}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, {@code geometry.triangles.indexData.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, if {@code geometry.triangles.indexData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, and with {@code geometry.triangles.indexType} not equal to {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, {@code geometry.triangles.indexData.deviceAddress} must be aligned to the size in bytes of the type in {@code indexType}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is not 0, it must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.deviceAddress} is not 0, it must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, {@code geometry.aabbs.data.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, if {@code geometry.aabbs.data.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, {@code geometry.aabbs.data.deviceAddress} must be aligned to 8 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_FALSE FALSE}, {@code geometry.instances.data.deviceAddress} must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_TRUE TRUE}, {@code geometry.instances.data.deviceAddress} must be aligned to 8 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.arrayOfPointers} is {@link VK10#VK_TRUE TRUE}, each element of {@code geometry.instances.data.deviceAddress} in device memory must be aligned to 16 bytes
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, {@code geometry.instances.data.deviceAddress} must be a valid device address obtained from {@link VK12#vkGetBufferDeviceAddress GetBufferDeviceAddress}
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, if {@code geometry.instances.data.deviceAddress} is the address of a non-sparse buffer then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, each {@link VkAccelerationStructureInstanceKHR}{@code ::accelerationStructureReference} value in {@code geometry.instances.data.deviceAddress} must be a valid device address containing a value obtained from {@link #vkGetAccelerationStructureDeviceAddressKHR GetAccelerationStructureDeviceAddressKHR}
  • *
  • For any element of {@code pIndirectDeviceAddresses}, if the buffer from which it was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • For any element of {@code pIndirectDeviceAddresses}[i], all device addresses between {@code pIndirectDeviceAddresses}[i] and pIndirectDeviceAddresses[i] + (pInfos[i].geometryCount × pIndirectStrides[i]) - 1 must be in the buffer device address range of the same buffer
  • *
  • For any element of {@code pIndirectDeviceAddresses}, the buffer from which it was queried must have been created with the {@link VK10#VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT BUFFER_USAGE_INDIRECT_BUFFER_BIT} bit set
  • *
  • Each element of {@code pIndirectDeviceAddresses} must be a multiple of 4
  • *
  • Each element of {@code pIndirectStrides} must be a multiple of 4
  • *
  • {@code commandBuffer} must not be a protected command buffer
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureIndirectBuild} feature must be enabled
  • *
  • Each {@link VkAccelerationStructureBuildRangeInfoKHR} structure referenced by any element of {@code pIndirectDeviceAddresses} must be a valid {@link VkAccelerationStructureBuildRangeInfoKHR} structure
  • *
  • {@code pInfos}[i].{@code dstAccelerationStructure} must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::size} greater than or equal to the memory size required by the build operation, as returned by {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with pBuildInfo = pInfos[i] and pMaxPrimitiveCounts = ppMaxPrimitiveCounts[i]
  • *
  • Each {@code ppMaxPrimitiveCounts}[i][j] must be greater than or equal to the the {@code primitiveCount} value specified by the {@link VkAccelerationStructureBuildRangeInfoKHR} structure located at pIndirectDeviceAddresses[i] + (j × pIndirectStrides[i])
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pInfos} must be a valid pointer to an array of {@code infoCount} valid {@link VkAccelerationStructureBuildGeometryInfoKHR} structures
  • *
  • {@code pIndirectDeviceAddresses} must be a valid pointer to an array of {@code infoCount} {@code VkDeviceAddress} values
  • *
  • {@code pIndirectStrides} must be a valid pointer to an array of {@code infoCount} {@code uint32_t} values
  • *
  • {@code ppMaxPrimitiveCounts} must be a valid pointer to an array of {@code infoCount} {@code uint32_t} values
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
  • {@code infoCount} must be greater than 0
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}

* * @param commandBuffer the command buffer into which the command will be recorded. * @param pInfos a pointer to an array of {@code infoCount} {@link VkAccelerationStructureBuildGeometryInfoKHR} structures defining the geometry used to build each acceleration structure. * @param pIndirectDeviceAddresses a pointer to an array of {@code infoCount} buffer device addresses which point to {@code pInfos}[i].{@code geometryCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures defining dynamic offsets to the addresses where geometry data is stored, as defined by {@code pInfos}[i]. * @param pIndirectStrides a pointer to an array of {@code infoCount} byte strides between elements of {@code pIndirectDeviceAddresses}. * @param ppMaxPrimitiveCounts a pointer to an array of {@code infoCount} pointers to arrays of {@code pInfos}[i].{@code geometryCount} values indicating the maximum number of primitives that will be built by this command for each geometry. */ public static void vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR.Buffer pInfos, @NativeType("VkDeviceAddress const *") LongBuffer pIndirectDeviceAddresses, @NativeType("uint32_t const *") IntBuffer pIndirectStrides, @NativeType("uint32_t const * const *") PointerBuffer ppMaxPrimitiveCounts) { if (CHECKS) { check(pIndirectDeviceAddresses, pInfos.remaining()); check(pIndirectStrides, pInfos.remaining()); check(ppMaxPrimitiveCounts, pInfos.remaining()); } nvkCmdBuildAccelerationStructuresIndirectKHR(commandBuffer, pInfos.remaining(), pInfos.address(), memAddress(pIndirectDeviceAddresses), memAddress(pIndirectStrides), memAddress(ppMaxPrimitiveCounts)); } // --- [ vkBuildAccelerationStructuresKHR ] --- /** * Unsafe version of: {@link #vkBuildAccelerationStructuresKHR BuildAccelerationStructuresKHR} * * @param infoCount the number of acceleration structures to build. It specifies the number of the {@code pInfos} structures and {@code ppBuildRangeInfos} pointers that must be provided. */ public static int nvkBuildAccelerationStructuresKHR(VkDevice device, long deferredOperation, int infoCount, long pInfos, long ppBuildRangeInfos) { long __functionAddress = device.getCapabilities().vkBuildAccelerationStructuresKHR; if (CHECKS) { check(__functionAddress); } return callPJPPI(device.address(), deferredOperation, infoCount, pInfos, ppBuildRangeInfos, __functionAddress); } /** * Build an acceleration structure on the host. * *
C Specification
* *

To build acceleration structures on the host, call:

* *

     * VkResult vkBuildAccelerationStructuresKHR(
     *     VkDevice                                    device,
     *     VkDeferredOperationKHR                      deferredOperation,
     *     uint32_t                                    infoCount,
     *     const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
     *     const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos);
* *
Description
* *

This command fulfills the same task as {@link #vkCmdBuildAccelerationStructuresKHR CmdBuildAccelerationStructuresKHR} but is executed by the host.

* *

The {@code vkBuildAccelerationStructuresKHR} 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 {@link #vkBuildAccelerationStructuresKHR 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
* *
    *
  • The {@code mode} member of each element of {@code pInfos} must be a valid {@code VkBuildAccelerationStructureModeKHR} value
  • *
  • If the {@code srcAccelerationStructure} member of any element of {@code pInfos} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, the {@code srcAccelerationStructure} member must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must not be {@link VK10#VK_NULL_HANDLE NULL_HANDLE}
  • *
  • The {@code srcAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be the same acceleration structure as the {@code dstAccelerationStructure} member of any other element of {@code pInfos}
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must be a valid {@code VkAccelerationStructureKHR} handle
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code type} member is {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR}, its {@code dstAccelerationStructure} member must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::type} equal to either {@link #VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR} or {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, inactive primitives in its {@code srcAccelerationStructure} member must not be made active
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, active primitives in its {@code srcAccelerationStructure} member must not be made inactive
  • *
  • The {@code dstAccelerationStructure} member of any element of {@code pInfos} must not be referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any other element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code dstAccelerationStructure} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any element of {@code pInfos} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code scratchData} member of any other element of {@code pInfos}, which is accessed by this command
  • *
  • The range of memory backing the {@code scratchData} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing the {@code srcAccelerationStructure} member of any element of {@code pInfos} with a {@code mode} equal to {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} (including the same element), which is accessed by this command
  • *
  • The range of memory backing the {@code dstAccelerationStructure} member of any element of {@code pInfos} that is accessed by this command must not overlap the memory backing any acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} in any other element of {@code pInfos}, which is accessed by this command
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} member must have previously been constructed with {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR} set in {@link VkAccelerationStructureBuildGeometryInfoKHR}{@code ::flags} in the build
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code srcAccelerationStructure} and {@code dstAccelerationStructure} members must either be the same {@code VkAccelerationStructureKHR}, or not have any memory aliasing
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code geometryCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, its {@code type} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code geometryType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, its {@code flags} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.vertexFormat} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.maxVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, its {@code geometry.triangles.indexType} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was {@code NULL} when {@code srcAccelerationStructure} was last built, then it must be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if its {@code geometry.triangles.transformData} address was not {@code NULL} when {@code srcAccelerationStructure} was last built, then it must not be {@code NULL}
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, then for each {@link VkAccelerationStructureGeometryKHR} structure referred to by its {@code pGeometries} or {@code ppGeometries} members, if {@code geometryType} is {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, and {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, then the value of each index referenced must be the same as the corresponding index value when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, its {@code primitiveCount} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} referenced by this command, if the corresponding geometry uses indices, its {@code firstVertex} member must have the same value which was specified when {@code srcAccelerationStructure} was last built
  • *
  • For each element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, the corresponding {@code ppBuildRangeInfos}[i][j].{@code primitiveCount} must be less than or equal to {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::maxInstanceCount}
  • *
* *
    *
  • For each {@code pInfos}[i], {@code dstAccelerationStructure} must have been created with a value of {@link VkAccelerationStructureCreateInfoKHR}{@code ::size} greater than or equal to the memory size required by the build operation, as returned by {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with pBuildInfo = pInfos[i] and with each element of the {@code pMaxPrimitiveCounts} array greater than or equal to the equivalent {@code ppBuildRangeInfos}[i][j].{@code primitiveCount} values for {@code j} in [0,pInfos[i].geometryCount)
  • *
  • Each element of {@code ppBuildRangeInfos}[i] must be a valid pointer to an array of {@code pInfos}[i].{@code geometryCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures
  • *
* *
    *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, it must be a valid {@code VkDeferredOperationKHR} object
  • *
  • Any previous deferred operation that was associated with {@code deferredOperation} must be complete
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create its {@code dstAccelerationStructure} member must be bound to host-visible device memory
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} the {@code buffer} used to create its {@code srcAccelerationStructure} member must be bound to host-visible device memory
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create each acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} must be bound to host-visible device memory
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureHostCommands} feature must be enabled
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.hostAddress} and {@code pInfos}[i].{@code scratchData.hostAddress} + N - 1 must be valid host memory, where N is given by the {@code buildScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • If {@code pInfos}[i].{@code mode} is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR}, all addresses between {@code pInfos}[i].{@code scratchData.hostAddress} and {@code pInfos}[i].{@code scratchData.hostAddress} + N - 1 must be valid host memory, where N is given by the {@code updateScratchSize} member of the {@link VkAccelerationStructureBuildSizesInfoKHR} structure returned from a call to {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} with an identical {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and primitive count
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, {@code geometry.triangles.vertexData.hostAddress} must be a valid host address
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.indexType} is not {@link #VK_INDEX_TYPE_NONE_KHR INDEX_TYPE_NONE_KHR}, {@code geometry.triangles.indexData.hostAddress} must be a valid host address
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if {@code geometry.triangles.transformData.hostAddress} is not 0, it must be a valid host address
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR}, {@code geometry.aabbs.data.hostAddress} must be a valid host address
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create its {@code dstAccelerationStructure} member must be bound to memory that was not allocated with multiple instances
  • *
  • For each element of {@code pInfos}, if its {@code mode} member is {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} the {@code buffer} used to create its {@code srcAccelerationStructure} member must be bound to memory that was not allocated with multiple instances
  • *
  • For each element of {@code pInfos}, the {@code buffer} used to create each acceleration structure referenced by the {@code geometry.instances.data} member of any element of {@code pGeometries} or {@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} must be bound to memory that was not allocated with multiple instances
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, {@code geometry.instances.data.hostAddress} must be a valid host address
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, each {@link VkAccelerationStructureInstanceKHR}{@code ::accelerationStructureReference} value in {@code geometry.instances.data.hostAddress} must be a valid {@code VkAccelerationStructureKHR} object
  • *
  • For any element of {@code pInfos}[i].{@code pGeometries} or {@code pInfos}[i].{@code ppGeometries} with a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR} with {@link NVRayTracingMotionBlur#VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV} set, each {@code accelerationStructureReference} in any structure in {@link VkAccelerationStructureMotionInstanceNV} value in {@code geometry.instances.data.hostAddress} must be a valid {@code VkAccelerationStructureKHR} object
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code deferredOperation} must be a valid {@code VkDeferredOperationKHR} handle
  • *
  • {@code pInfos} must be a valid pointer to an array of {@code infoCount} valid {@link VkAccelerationStructureBuildGeometryInfoKHR} structures
  • *
  • {@code ppBuildRangeInfos} must be a valid pointer to an array of {@code infoCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures
  • *
  • {@code infoCount} must be greater than 0
  • *
  • If {@code deferredOperation} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_DEFERRED_KHR OPERATION_DEFERRED_KHR}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_NOT_DEFERRED_KHR OPERATION_NOT_DEFERRED_KHR}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
  • *
*
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}, {@link VkAccelerationStructureBuildRangeInfoKHR}

* * @param device the {@code VkDevice} for which the acceleration structures are being built. * @param deferredOperation an optional {@code VkDeferredOperationKHR} to request deferral for this command. * @param pInfos a pointer to an array of {@code infoCount} {@link VkAccelerationStructureBuildGeometryInfoKHR} structures defining the geometry used to build each acceleration structure. * @param ppBuildRangeInfos a pointer to an array of {@code infoCount} pointers to arrays of {@link VkAccelerationStructureBuildRangeInfoKHR} structures. Each {@code ppBuildRangeInfos}[i] is a pointer to an array of {@code pInfos}[i].{@code geometryCount} {@link VkAccelerationStructureBuildRangeInfoKHR} structures defining dynamic offsets to the addresses where geometry data is stored, as defined by {@code pInfos}[i]. */ @NativeType("VkResult") public static int vkBuildAccelerationStructuresKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR.Buffer pInfos, @NativeType("VkAccelerationStructureBuildRangeInfoKHR const * const *") PointerBuffer ppBuildRangeInfos) { if (CHECKS) { check(ppBuildRangeInfos, pInfos.remaining()); } return nvkBuildAccelerationStructuresKHR(device, deferredOperation, pInfos.remaining(), pInfos.address(), memAddress(ppBuildRangeInfos)); } // --- [ vkCopyAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkCopyAccelerationStructureKHR CopyAccelerationStructureKHR} */ public static int nvkCopyAccelerationStructureKHR(VkDevice device, long deferredOperation, long pInfo) { long __functionAddress = device.getCapabilities().vkCopyAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); } return callPJPI(device.address(), deferredOperation, pInfo, __functionAddress); } /** * Copy an acceleration structure on the host. * *
C Specification
* *

To copy or compact an acceleration structure on the host, call:

* *

     * VkResult vkCopyAccelerationStructureKHR(
     *     VkDevice                                    device,
     *     VkDeferredOperationKHR                      deferredOperation,
     *     const VkCopyAccelerationStructureInfoKHR*   pInfo);
* *
Description
* *

This command fulfills the same task as {@link #vkCmdCopyAccelerationStructureKHR CmdCopyAccelerationStructureKHR} but is executed by the host.

* *
Valid Usage
* *
    *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, it must be a valid {@code VkDeferredOperationKHR} object
  • *
  • Any previous deferred operation that was associated with {@code deferredOperation} must be complete
  • *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to host-visible device memory
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to host-visible device memory
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureHostCommands} feature must be enabled
  • *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to memory that was not allocated with multiple instances
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to memory that was not allocated with multiple instances
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code deferredOperation} must be a valid {@code VkDeferredOperationKHR} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyAccelerationStructureInfoKHR} structure
  • *
  • If {@code deferredOperation} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_DEFERRED_KHR OPERATION_DEFERRED_KHR}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_NOT_DEFERRED_KHR OPERATION_NOT_DEFERRED_KHR}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
  • *
*
* *
See Also
* *

{@link VkCopyAccelerationStructureInfoKHR}

* * @param device the device which owns the acceleration structures. * @param deferredOperation an optional {@code VkDeferredOperationKHR} to request deferral for this command. * @param pInfo a pointer to a {@link VkCopyAccelerationStructureInfoKHR} structure defining the copy operation. */ @NativeType("VkResult") public static int vkCopyAccelerationStructureKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkCopyAccelerationStructureInfoKHR const *") VkCopyAccelerationStructureInfoKHR pInfo) { return nvkCopyAccelerationStructureKHR(device, deferredOperation, pInfo.address()); } // --- [ vkCopyAccelerationStructureToMemoryKHR ] --- /** Unsafe version of: {@link #vkCopyAccelerationStructureToMemoryKHR CopyAccelerationStructureToMemoryKHR} */ public static int nvkCopyAccelerationStructureToMemoryKHR(VkDevice device, long deferredOperation, long pInfo) { long __functionAddress = device.getCapabilities().vkCopyAccelerationStructureToMemoryKHR; if (CHECKS) { check(__functionAddress); } return callPJPI(device.address(), deferredOperation, pInfo, __functionAddress); } /** * Serialize an acceleration structure on the host. * *
C Specification
* *

To copy an acceleration structure to host accessible memory, call:

* *

     * VkResult vkCopyAccelerationStructureToMemoryKHR(
     *     VkDevice                                    device,
     *     VkDeferredOperationKHR                      deferredOperation,
     *     const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo);
* *
Description
* *

This command fulfills the same task as {@link #vkCmdCopyAccelerationStructureToMemoryKHR CmdCopyAccelerationStructureToMemoryKHR} but is executed by the host.

* *

This command produces the same results as {@link #vkCmdCopyAccelerationStructureToMemoryKHR 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 {@link #vkCmdCopyMemoryToAccelerationStructureKHR CmdCopyMemoryToAccelerationStructureKHR} or {@link #vkCopyMemoryToAccelerationStructureKHR CopyMemoryToAccelerationStructureKHR}.

* *
Valid Usage
* *
    *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, it must be a valid {@code VkDeferredOperationKHR} object
  • *
  • Any previous deferred operation that was associated with {@code deferredOperation} must be complete
  • *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to host-visible device memory
  • *
  • {@code pInfo→dst.hostAddress} must be a valid host pointer
  • *
  • {@code pInfo→dst.hostAddress} must be aligned to 16 bytes
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureHostCommands} feature must be enabled
  • *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to memory that was not allocated with multiple instances
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code deferredOperation} must be a valid {@code VkDeferredOperationKHR} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyAccelerationStructureToMemoryInfoKHR} structure
  • *
  • If {@code deferredOperation} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_DEFERRED_KHR OPERATION_DEFERRED_KHR}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_NOT_DEFERRED_KHR OPERATION_NOT_DEFERRED_KHR}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
  • *
*
* *
See Also
* *

{@link VkCopyAccelerationStructureToMemoryInfoKHR}

* * @param device the device which owns {@code pInfo→src}. * @param deferredOperation an optional {@code VkDeferredOperationKHR} to request deferral for this command. * @param pInfo a pointer to a {@link VkCopyAccelerationStructureToMemoryInfoKHR} structure defining the copy operation. */ @NativeType("VkResult") public static int vkCopyAccelerationStructureToMemoryKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkCopyAccelerationStructureToMemoryInfoKHR const *") VkCopyAccelerationStructureToMemoryInfoKHR pInfo) { return nvkCopyAccelerationStructureToMemoryKHR(device, deferredOperation, pInfo.address()); } // --- [ vkCopyMemoryToAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkCopyMemoryToAccelerationStructureKHR CopyMemoryToAccelerationStructureKHR} */ public static int nvkCopyMemoryToAccelerationStructureKHR(VkDevice device, long deferredOperation, long pInfo) { long __functionAddress = device.getCapabilities().vkCopyMemoryToAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); } return callPJPI(device.address(), deferredOperation, pInfo, __functionAddress); } /** * Deserialize an acceleration structure on the host. * *
C Specification
* *

To copy host accessible memory to an acceleration structure, call:

* *

     * VkResult vkCopyMemoryToAccelerationStructureKHR(
     *     VkDevice                                    device,
     *     VkDeferredOperationKHR                      deferredOperation,
     *     const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo);
* *
Description
* *

This command fulfills the same task as {@link #vkCmdCopyMemoryToAccelerationStructureKHR CmdCopyMemoryToAccelerationStructureKHR} but is executed by the host.

* *

This command can accept acceleration structures produced by either {@link #vkCmdCopyAccelerationStructureToMemoryKHR CmdCopyAccelerationStructureToMemoryKHR} or {@link #vkCopyAccelerationStructureToMemoryKHR CopyAccelerationStructureToMemoryKHR}.

* *
Valid Usage
* *
    *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, it must be a valid {@code VkDeferredOperationKHR} object
  • *
  • Any previous deferred operation that was associated with {@code deferredOperation} must be complete
  • *
  • {@code pInfo→src.hostAddress} must be a valid host pointer
  • *
  • {@code pInfo→src.hostAddress} must be aligned to 16 bytes
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to host-visible device memory
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureHostCommands} feature must be enabled
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to memory that was not allocated with multiple instances
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code deferredOperation} must be a valid {@code VkDeferredOperationKHR} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyMemoryToAccelerationStructureInfoKHR} structure
  • *
  • If {@code deferredOperation} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_DEFERRED_KHR OPERATION_DEFERRED_KHR}
  • *
  • {@link KHRDeferredHostOperations#VK_OPERATION_NOT_DEFERRED_KHR OPERATION_NOT_DEFERRED_KHR}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
  • *
*
* *
See Also
* *

{@link VkCopyMemoryToAccelerationStructureInfoKHR}

* * @param device the device which owns {@code pInfo→dst}. * @param deferredOperation an optional {@code VkDeferredOperationKHR} to request deferral for this command. * @param pInfo a pointer to a {@link VkCopyMemoryToAccelerationStructureInfoKHR} structure defining the copy operation. */ @NativeType("VkResult") public static int vkCopyMemoryToAccelerationStructureKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkCopyMemoryToAccelerationStructureInfoKHR const *") VkCopyMemoryToAccelerationStructureInfoKHR pInfo) { return nvkCopyMemoryToAccelerationStructureKHR(device, deferredOperation, pInfo.address()); } // --- [ vkWriteAccelerationStructuresPropertiesKHR ] --- /** * Unsafe version of: {@link #vkWriteAccelerationStructuresPropertiesKHR WriteAccelerationStructuresPropertiesKHR} * * @param accelerationStructureCount the count of acceleration structures for which to query the property. * @param dataSize the size in bytes of the buffer pointed to by {@code pData}. */ public static int nvkWriteAccelerationStructuresPropertiesKHR(VkDevice device, int accelerationStructureCount, long pAccelerationStructures, int queryType, long dataSize, long pData, long stride) { long __functionAddress = device.getCapabilities().vkWriteAccelerationStructuresPropertiesKHR; if (CHECKS) { check(__functionAddress); } return callPPPPPI(device.address(), accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData, stride, __functionAddress); } /** * Query acceleration structure meta-data on the host. * *
C Specification
* *

To query acceleration structure size parameters on the host, call:

* *

     * VkResult vkWriteAccelerationStructuresPropertiesKHR(
     *     VkDevice                                    device,
     *     uint32_t                                    accelerationStructureCount,
     *     const VkAccelerationStructureKHR*           pAccelerationStructures,
     *     VkQueryType                                 queryType,
     *     size_t                                      dataSize,
     *     void*                                       pData,
     *     size_t                                      stride);
* *
Description
* *

This command fulfills the same task as {@link #vkCmdWriteAccelerationStructuresPropertiesKHR CmdWriteAccelerationStructuresPropertiesKHR} but is executed by the host.

* *
Valid Usage
* *
    *
  • All acceleration structures in {@code pAccelerationStructures} must have been built prior to the execution of this command
  • *
  • All acceleration structures in {@code pAccelerationStructures} must have been built with {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR} if {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}
  • *
  • {@code queryType} must be {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR} or {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}
  • *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}, then {@code stride} must be a multiple of the size of {@code VkDeviceSize}
  • *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}, then {@code data} must point to a {@code VkDeviceSize}
  • *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}, then {@code stride} must be a multiple of the size of {@code VkDeviceSize}
  • *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}, then {@code data} must point to a {@code VkDeviceSize}
  • *
  • {@code dataSize} must be greater than or equal to accelerationStructureCount*stride
  • *
  • The {@code buffer} used to create each acceleration structure in {@code pAccelerationStructures} must be bound to host-visible device memory
  • *
  • The {@link VkPhysicalDeviceAccelerationStructureFeaturesKHR}{@code ::accelerationStructureHostCommands} feature must be enabled
  • *
  • The {@code buffer} used to create each acceleration structure in {@code pAccelerationStructures} must be bound to memory that was not allocated with multiple instances
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pAccelerationStructures} must be a valid pointer to an array of {@code accelerationStructureCount} valid {@code VkAccelerationStructureKHR} handles
  • *
  • {@code queryType} must be a valid {@code VkQueryType} value
  • *
  • {@code pData} must be a valid pointer to an array of {@code dataSize} bytes
  • *
  • {@code accelerationStructureCount} must be greater than 0
  • *
  • {@code dataSize} must be greater than 0
  • *
  • Each element of {@code pAccelerationStructures} must have been created, allocated, or retrieved from {@code device}
  • *
* *
Return Codes
* *
*
On success, this command returns
*
    *
  • {@link VK10#VK_SUCCESS SUCCESS}
  • *
*
On failure, this command returns
*
    *
  • {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
  • *
  • {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
  • *
*
* * @param device the device which owns the acceleration structures in {@code pAccelerationStructures}. * @param pAccelerationStructures a pointer to an array of existing previously built acceleration structures. * @param queryType a {@code VkQueryType} value specifying the property to be queried. * @param pData a pointer to a user-allocated buffer where the results will be written. * @param stride the stride in bytes between results for individual queries within {@code pData}. */ @NativeType("VkResult") public static int vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, @NativeType("VkAccelerationStructureKHR const *") LongBuffer pAccelerationStructures, @NativeType("VkQueryType") int queryType, @NativeType("void *") ByteBuffer pData, @NativeType("size_t") long stride) { return nvkWriteAccelerationStructuresPropertiesKHR(device, pAccelerationStructures.remaining(), memAddress(pAccelerationStructures), queryType, pData.remaining(), memAddress(pData), stride); } // --- [ vkCmdCopyAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkCmdCopyAccelerationStructureKHR CmdCopyAccelerationStructureKHR} */ public static void nvkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, long pInfo) { long __functionAddress = commandBuffer.getCapabilities().vkCmdCopyAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); } callPPV(commandBuffer.address(), pInfo, __functionAddress); } /** * Copy an acceleration structure. * *
C Specification
* *

To copy an acceleration structure call:

* *

     * void vkCmdCopyAccelerationStructureKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     const VkCopyAccelerationStructureInfoKHR*   pInfo);
* *
Description
* *

This command copies the {@code pInfo→src} acceleration structure to the {@code pInfo→dst} acceleration structure in the manner specified by {@code pInfo→mode}.

* *

Accesses to {@code pInfo→src} and {@code pInfo→dst} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link #VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR} or {@link #VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR} as appropriate.

* *
Valid Usage
* *
    *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to device memory
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to device memory
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyAccelerationStructureInfoKHR} structure
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* *
See Also
* *

{@link VkCopyAccelerationStructureInfoKHR}

* * @param commandBuffer the command buffer into which the command will be recorded. * @param pInfo a pointer to a {@link VkCopyAccelerationStructureInfoKHR} structure defining the copy operation. */ public static void vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, @NativeType("VkCopyAccelerationStructureInfoKHR const *") VkCopyAccelerationStructureInfoKHR pInfo) { nvkCmdCopyAccelerationStructureKHR(commandBuffer, pInfo.address()); } // --- [ vkCmdCopyAccelerationStructureToMemoryKHR ] --- /** Unsafe version of: {@link #vkCmdCopyAccelerationStructureToMemoryKHR CmdCopyAccelerationStructureToMemoryKHR} */ public static void nvkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, long pInfo) { long __functionAddress = commandBuffer.getCapabilities().vkCmdCopyAccelerationStructureToMemoryKHR; if (CHECKS) { check(__functionAddress); } callPPV(commandBuffer.address(), pInfo, __functionAddress); } /** * Copy an acceleration structure to device memory. * *
C Specification
* *

To copy an acceleration structure to device memory call:

* *

     * void vkCmdCopyAccelerationStructureToMemoryKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo);
* *
Description
* *

Accesses to {@code pInfo→src} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link #VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR}. Accesses to the buffer indicated by {@code pInfo→dst.deviceAddress} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link VK10#VK_ACCESS_TRANSFER_WRITE_BIT ACCESS_TRANSFER_WRITE_BIT}.

* *

This command produces the same results as {@link #vkCopyAccelerationStructureToMemoryKHR 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 {@link #vkCmdCopyMemoryToAccelerationStructureKHR CmdCopyMemoryToAccelerationStructureKHR} or {@link #vkCopyMemoryToAccelerationStructureKHR CopyMemoryToAccelerationStructureKHR}.

* *

The defined header structure for the serialized data consists of:

* *
    *
  • {@link VK10#VK_UUID_SIZE UUID_SIZE} bytes of data matching {@link VkPhysicalDeviceIDProperties}{@code ::driverUUID}
  • *
  • {@link VK10#VK_UUID_SIZE UUID_SIZE} bytes of data identifying the compatibility for comparison using {@link #vkGetDeviceAccelerationStructureCompatibilityKHR GetDeviceAccelerationStructureCompatibilityKHR}
  • *
  • A 64-bit integer of the total size matching the value queried using {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}
  • *
  • A 64-bit integer of the deserialized size to be passed in to {@link VkAccelerationStructureCreateInfoKHR}{@code ::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. For top-level acceleration structures this number is implementation-dependent; the number of and ordering of the handles may not match the instance descriptions which were used to build the acceleration structure.
  • *
* *

The corresponding handles matching the values returned by {@link #vkGetAccelerationStructureDeviceAddressKHR GetAccelerationStructureDeviceAddressKHR} or {@link NVRayTracing#vkGetAccelerationStructureHandleNV 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
* *
    *
  • {@code pInfo→dst.deviceAddress} must be a valid device address for a buffer bound to device memory
  • *
  • {@code pInfo→dst.deviceAddress} must be aligned to 256 bytes
  • *
  • If the buffer pointed to by {@code pInfo→dst.deviceAddress} is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • The {@code buffer} used to create {@code pInfo→src} must be bound to device memory
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyAccelerationStructureToMemoryInfoKHR} structure
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* *
See Also
* *

{@link VkCopyAccelerationStructureToMemoryInfoKHR}

* * @param commandBuffer the command buffer into which the command will be recorded. * @param pInfo an a pointer to a {@link VkCopyAccelerationStructureToMemoryInfoKHR} structure defining the copy operation. */ public static void vkCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, @NativeType("VkCopyAccelerationStructureToMemoryInfoKHR const *") VkCopyAccelerationStructureToMemoryInfoKHR pInfo) { nvkCmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo.address()); } // --- [ vkCmdCopyMemoryToAccelerationStructureKHR ] --- /** Unsafe version of: {@link #vkCmdCopyMemoryToAccelerationStructureKHR CmdCopyMemoryToAccelerationStructureKHR} */ public static void nvkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, long pInfo) { long __functionAddress = commandBuffer.getCapabilities().vkCmdCopyMemoryToAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); } callPPV(commandBuffer.address(), pInfo, __functionAddress); } /** * Copy device memory to an acceleration structure. * *
C Specification
* *

To copy device memory to an acceleration structure call:

* *

     * void vkCmdCopyMemoryToAccelerationStructureKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo);
* *
Description
* *

Accesses to {@code pInfo→dst} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link #VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR}. Accesses to the buffer indicated by {@code pInfo→src.deviceAddress} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link VK10#VK_ACCESS_TRANSFER_READ_BIT ACCESS_TRANSFER_READ_BIT}.

* *

This command can accept acceleration structures produced by either {@link #vkCmdCopyAccelerationStructureToMemoryKHR CmdCopyAccelerationStructureToMemoryKHR} or {@link #vkCopyAccelerationStructureToMemoryKHR CopyAccelerationStructureToMemoryKHR}.

* *

The structure provided as input to deserialize is as described in {@link #vkCmdCopyAccelerationStructureToMemoryKHR 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
* *
    *
  • {@code pInfo→src.deviceAddress} must be a valid device address for a buffer bound to device memory
  • *
  • {@code pInfo→src.deviceAddress} must be aligned to 256 bytes
  • *
  • If the buffer pointed to by {@code pInfo→src.deviceAddress} is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
  • *
  • The {@code buffer} used to create {@code pInfo→dst} must be bound to device memory
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkCopyMemoryToAccelerationStructureInfoKHR} structure
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* *
See Also
* *

{@link VkCopyMemoryToAccelerationStructureInfoKHR}

* * @param commandBuffer the command buffer into which the command will be recorded. * @param pInfo a pointer to a {@link VkCopyMemoryToAccelerationStructureInfoKHR} structure defining the copy operation. */ public static void vkCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, @NativeType("VkCopyMemoryToAccelerationStructureInfoKHR const *") VkCopyMemoryToAccelerationStructureInfoKHR pInfo) { nvkCmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo.address()); } // --- [ vkGetAccelerationStructureDeviceAddressKHR ] --- /** Unsafe version of: {@link #vkGetAccelerationStructureDeviceAddressKHR GetAccelerationStructureDeviceAddressKHR} */ public static long nvkGetAccelerationStructureDeviceAddressKHR(VkDevice device, long pInfo) { long __functionAddress = device.getCapabilities().vkGetAccelerationStructureDeviceAddressKHR; if (CHECKS) { check(__functionAddress); } return callPPJ(device.address(), pInfo, __functionAddress); } /** * Query an address of a acceleration structure. * *
C Specification
* *

To query the 64-bit device address for an acceleration structure, call:

* *

     * VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR(
     *     VkDevice                                    device,
     *     const VkAccelerationStructureDeviceAddressInfoKHR* pInfo);
* *
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 {@link VkAccelerationStructureCreateInfoKHR}{@code ::deviceAddress}, the return value will be the same address.

* *

If the acceleration structure was created with a {@code type} of {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}, the returned address must be consistent with the relative offset to other acceleration structures with {@code type} {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR} allocated with the same {@code VkBuffer}. 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 {@link #VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR}.

*
* *
Valid Usage
* * * *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pInfo} must be a valid pointer to a valid {@link VkAccelerationStructureDeviceAddressInfoKHR} structure
  • *
* *
See Also
* *

{@link VkAccelerationStructureDeviceAddressInfoKHR}

* * @param device the logical device that the acceleration structure was created on. * @param pInfo a pointer to a {@link VkAccelerationStructureDeviceAddressInfoKHR} structure specifying the acceleration structure to retrieve an address for. */ @NativeType("VkDeviceAddress") public static long vkGetAccelerationStructureDeviceAddressKHR(VkDevice device, @NativeType("VkAccelerationStructureDeviceAddressInfoKHR const *") VkAccelerationStructureDeviceAddressInfoKHR pInfo) { return nvkGetAccelerationStructureDeviceAddressKHR(device, pInfo.address()); } // --- [ vkCmdWriteAccelerationStructuresPropertiesKHR ] --- /** * Unsafe version of: {@link #vkCmdWriteAccelerationStructuresPropertiesKHR CmdWriteAccelerationStructuresPropertiesKHR} * * @param accelerationStructureCount the count of acceleration structures for which to query the property. */ public static void nvkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, int accelerationStructureCount, long pAccelerationStructures, int queryType, long queryPool, int firstQuery) { long __functionAddress = commandBuffer.getCapabilities().vkCmdWriteAccelerationStructuresPropertiesKHR; if (CHECKS) { check(__functionAddress); } callPPJV(commandBuffer.address(), accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery, __functionAddress); } /** * Write acceleration structure result parameters to query results. * *
C Specification
* *

To query acceleration structure size parameters call:

* *

     * void vkCmdWriteAccelerationStructuresPropertiesKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     uint32_t                                    accelerationStructureCount,
     *     const VkAccelerationStructureKHR*           pAccelerationStructures,
     *     VkQueryType                                 queryType,
     *     VkQueryPool                                 queryPool,
     *     uint32_t                                    firstQuery);
* *
Description
* *

Accesses to any of the acceleration structures listed in {@code pAccelerationStructures} must be synchronized with the {@link #VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR} pipeline stage and an access type of {@link #VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR}.

* *
    *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}, then the value written out is the number of bytes required by a compacted acceleration structure.
  • *
  • If {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}, then the value written out is the number of bytes required by a serialized acceleration structure.
  • *
* *
Valid Usage
* *
    *
  • {@code queryPool} must have been created with a {@code queryType} matching {@code queryType}
  • *
  • The queries identified by {@code queryPool} and {@code firstQuery} must be unavailable
  • *
  • The {@code buffer} used to create each acceleration structure in {@code pAccelerationStructures} must be bound to device memory
  • *
  • The sum of {@code query} plus {@code accelerationStructureCount} must be less than or equal to the number of queries in {@code queryPool}
  • *
* *
    *
  • All acceleration structures in {@code pAccelerationStructures} must have been built prior to the execution of this command
  • *
  • All acceleration structures in {@code pAccelerationStructures} must have been built with {@link #VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR} if {@code queryType} is {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR}
  • *
  • {@code queryType} must be {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR} or {@link #VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pAccelerationStructures} must be a valid pointer to an array of {@code accelerationStructureCount} valid {@code VkAccelerationStructureKHR} handles
  • *
  • {@code queryType} must be a valid {@code VkQueryType} value
  • *
  • {@code queryPool} must be a valid {@code VkQueryPool} handle
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
  • *
  • This command must only be called outside of a render pass instance
  • *
  • {@code accelerationStructureCount} must be greater than 0
  • *
  • Each of {@code commandBuffer}, {@code queryPool}, and the elements of {@code pAccelerationStructures} must have been created, allocated, or retrieved from the same {@code VkDevice}
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue Types
Primary SecondaryOutsideCompute
* * @param commandBuffer the command buffer into which the command will be recorded. * @param pAccelerationStructures a pointer to an array of existing previously built acceleration structures. * @param queryType a {@code VkQueryType} value specifying the type of queries managed by the pool. * @param queryPool the query pool that will manage the results of the query. * @param firstQuery the first query index within the query pool that will contain the {@code accelerationStructureCount} number of results. */ public static void vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, @NativeType("VkAccelerationStructureKHR const *") LongBuffer pAccelerationStructures, @NativeType("VkQueryType") int queryType, @NativeType("VkQueryPool") long queryPool, @NativeType("uint32_t") int firstQuery) { nvkCmdWriteAccelerationStructuresPropertiesKHR(commandBuffer, pAccelerationStructures.remaining(), memAddress(pAccelerationStructures), queryType, queryPool, firstQuery); } // --- [ vkGetDeviceAccelerationStructureCompatibilityKHR ] --- /** Unsafe version of: {@link #vkGetDeviceAccelerationStructureCompatibilityKHR GetDeviceAccelerationStructureCompatibilityKHR} */ public static void nvkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, long pVersionInfo, long pCompatibility) { long __functionAddress = device.getCapabilities().vkGetDeviceAccelerationStructureCompatibilityKHR; if (CHECKS) { check(__functionAddress); VkAccelerationStructureVersionInfoKHR.validate(pVersionInfo); } callPPPV(device.address(), pVersionInfo, pCompatibility, __functionAddress); } /** * Check if a serialized acceleration structure is compatible with the current device. * *
C Specification
* *

To check if a serialized acceleration structure is compatible with the current device call:

* *

     * void vkGetDeviceAccelerationStructureCompatibilityKHR(
     *     VkDevice                                    device,
     *     const VkAccelerationStructureVersionInfoKHR* pVersionInfo,
     *     VkAccelerationStructureCompatibilityKHR*    pCompatibility);
* *
Valid Usage
* * * *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pVersionInfo} must be a valid pointer to a valid {@link VkAccelerationStructureVersionInfoKHR} structure
  • *
  • {@code pCompatibility} must be a valid pointer to a {@code VkAccelerationStructureCompatibilityKHR} value
  • *
* *
See Also
* *

{@link VkAccelerationStructureVersionInfoKHR}

* * @param device the device to check the version against. * @param pVersionInfo a pointer to a {@link VkAccelerationStructureVersionInfoKHR} structure specifying version information to check against the device. * @param pCompatibility a pointer to a {@code VkAccelerationStructureCompatibilityKHR} value in which compatibility information is returned. */ public static void vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, @NativeType("VkAccelerationStructureVersionInfoKHR const *") VkAccelerationStructureVersionInfoKHR pVersionInfo, @NativeType("VkAccelerationStructureCompatibilityKHR *") IntBuffer pCompatibility) { if (CHECKS) { check(pCompatibility, 1); } nvkGetDeviceAccelerationStructureCompatibilityKHR(device, pVersionInfo.address(), memAddress(pCompatibility)); } // --- [ vkGetAccelerationStructureBuildSizesKHR ] --- /** Unsafe version of: {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} */ public static void nvkGetAccelerationStructureBuildSizesKHR(VkDevice device, int buildType, long pBuildInfo, long pMaxPrimitiveCounts, long pSizeInfo) { long __functionAddress = device.getCapabilities().vkGetAccelerationStructureBuildSizesKHR; if (CHECKS) { check(__functionAddress); } callPPPPV(device.address(), buildType, pBuildInfo, pMaxPrimitiveCounts, pSizeInfo, __functionAddress); } /** * Retrieve the required size for an acceleration structure. * *
C Specification
* *

To get the build sizes for an acceleration structure, call:

* *

     * void vkGetAccelerationStructureBuildSizesKHR(
     *     VkDevice                                    device,
     *     VkAccelerationStructureBuildTypeKHR         buildType,
     *     const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo,
     *     const uint32_t*                             pMaxPrimitiveCounts,
     *     VkAccelerationStructureBuildSizesInfoKHR*   pSizeInfo);
* *
Description
* *

The {@code srcAccelerationStructure}, {@code dstAccelerationStructure}, and {@code mode} members of {@code pBuildInfo} are ignored. Any {@link VkDeviceOrHostAddressKHR} members of {@code pBuildInfo} are ignored by this command, except that the {@code hostAddress} member of {@link VkAccelerationStructureGeometryTrianglesDataKHR}{@code ::transformData} will be examined to check if it is {@code NULL}.

* *

An acceleration structure created with the {@code accelerationStructureSize} returned by this command supports any build or update with a {@link VkAccelerationStructureBuildGeometryInfoKHR} structure and array of {@link VkAccelerationStructureBuildRangeInfoKHR} structures subject to the following properties:

* *
    *
  • The build command is a host build command, and {@code buildType} is {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR} or {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR}
  • *
  • The build command is a device build command, and {@code buildType} is {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR} or {@link #VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR}
  • *
  • For {@link VkAccelerationStructureBuildGeometryInfoKHR}: * *
      *
    • Its {@code type}, and {@code flags} members are equal to those specified in {@code pBuildInfo}.
    • *
    • {@code geometryCount} is less than or equal to that specified in {@code pBuildInfo}.
    • *
    • For each element of either {@code pGeometries} or {@code ppGeometries} at a given index, its {@code geometryType} member is equal to that specified in {@code pBuildInfo}.
    • *
    • For each element of either {@code pGeometries} or {@code ppGeometries} at a given index, with a {@code geometryType} member equal to {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, the {@code vertexFormat} and {@code indexType} members of {@code geometry.triangles} are equal to those specified in the same element in {@code pBuildInfo}.
    • *
    • For each element of either {@code pGeometries} or {@code ppGeometries} at a given index, with a {@code geometryType} member equal to {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, the {@code maxVertex} member of {@code geometry.triangles} is less than or equal to that specified in the same element in {@code pBuildInfo}.
    • *
    • For each element of either {@code pGeometries} or {@code ppGeometries} at a given index, with a {@code geometryType} member equal to {@link #VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR}, if the applicable address in the {@code transformData} member of {@code geometry.triangles} is not {@code NULL}, the corresponding {@code transformData.hostAddress} parameter in {@code pBuildInfo} is not {@code NULL}.
    • *
    *
  • *
  • For each {@link VkAccelerationStructureBuildRangeInfoKHR} corresponding to the {@link VkAccelerationStructureBuildGeometryInfoKHR}: * *
      *
    • Its {@code primitiveCount} member is less than or equal to the corresponding element of {@code pMaxPrimitiveCounts}.
    • *
    *
  • *
* *

Similarly, the {@code updateScratchSize} value will support any build command specifying the {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR} {@code mode} under the above conditions, and the {@code buildScratchSize} value will support any build command specifying the {@link #VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR} {@code mode} under the above conditions.

* *
Valid Usage
* *
    *
  • The {@code rayTracingPipeline} or {@code rayQuery} feature must be enabled
  • *
  • If {@code device} was created with multiple physical devices, then the bufferDeviceAddressMultiDevice feature must be enabled
  • *
  • If {@code pBuildInfo→geometryCount} is not 0, {@code pMaxPrimitiveCounts} must be a valid pointer to an array of {@code pBuildInfo→geometryCount} {@code uint32_t} values
  • *
  • If {@code pBuildInfo→pGeometries} or {@code pBuildInfo→ppGeometries} has a {@code geometryType} of {@link #VK_GEOMETRY_TYPE_INSTANCES_KHR GEOMETRY_TYPE_INSTANCES_KHR}, each {@code pMaxPrimitiveCounts}[i] must be less than or equal to {@link VkPhysicalDeviceAccelerationStructurePropertiesKHR}{@code ::maxInstanceCount}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code buildType} must be a valid {@code VkAccelerationStructureBuildTypeKHR} value
  • *
  • {@code pBuildInfo} must be a valid pointer to a valid {@link VkAccelerationStructureBuildGeometryInfoKHR} structure
  • *
  • If {@code pMaxPrimitiveCounts} is not {@code NULL}, {@code pMaxPrimitiveCounts} must be a valid pointer to an array of {@code pBuildInfo→geometryCount} {@code uint32_t} values
  • *
  • {@code pSizeInfo} must be a valid pointer to a {@link VkAccelerationStructureBuildSizesInfoKHR} structure
  • *
* *
See Also
* *

{@link VkAccelerationStructureBuildGeometryInfoKHR}, {@link VkAccelerationStructureBuildSizesInfoKHR}

* * @param device the logical device that will be used for creating the acceleration structure. * @param buildType defines whether host or device operations (or both) are being queried for. * @param pBuildInfo a pointer to a {@link VkAccelerationStructureBuildGeometryInfoKHR} structure describing parameters of a build operation. * @param pMaxPrimitiveCounts a pointer to an array of {@code pBuildInfo→geometryCount} {@code uint32_t} values defining the number of primitives built into each geometry. * @param pSizeInfo a pointer to a {@link VkAccelerationStructureBuildSizesInfoKHR} structure which returns the size required for an acceleration structure and the sizes required for the scratch buffers, given the build parameters. */ public static void vkGetAccelerationStructureBuildSizesKHR(VkDevice device, @NativeType("VkAccelerationStructureBuildTypeKHR") int buildType, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR pBuildInfo, @Nullable @NativeType("uint32_t const *") IntBuffer pMaxPrimitiveCounts, @NativeType("VkAccelerationStructureBuildSizesInfoKHR *") VkAccelerationStructureBuildSizesInfoKHR pSizeInfo) { if (CHECKS) { checkSafe(pMaxPrimitiveCounts, pBuildInfo.geometryCount()); } nvkGetAccelerationStructureBuildSizesKHR(device, buildType, pBuildInfo.address(), memAddressSafe(pMaxPrimitiveCounts), pSizeInfo.address()); } /** Array version of: {@link #vkCreateAccelerationStructureKHR CreateAccelerationStructureKHR} */ @NativeType("VkResult") public static int vkCreateAccelerationStructureKHR(VkDevice device, @NativeType("VkAccelerationStructureCreateInfoKHR const *") VkAccelerationStructureCreateInfoKHR pCreateInfo, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkAccelerationStructureKHR *") long[] pAccelerationStructure) { long __functionAddress = device.getCapabilities().vkCreateAccelerationStructureKHR; if (CHECKS) { check(__functionAddress); check(pAccelerationStructure, 1); if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); } } return callPPPPI(device.address(), pCreateInfo.address(), memAddressSafe(pAllocator), pAccelerationStructure, __functionAddress); } /** Array version of: {@link #vkCmdBuildAccelerationStructuresIndirectKHR CmdBuildAccelerationStructuresIndirectKHR} */ public static void vkCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR.Buffer pInfos, @NativeType("VkDeviceAddress const *") long[] pIndirectDeviceAddresses, @NativeType("uint32_t const *") int[] pIndirectStrides, @NativeType("uint32_t const * const *") PointerBuffer ppMaxPrimitiveCounts) { long __functionAddress = commandBuffer.getCapabilities().vkCmdBuildAccelerationStructuresIndirectKHR; if (CHECKS) { check(__functionAddress); check(pIndirectDeviceAddresses, pInfos.remaining()); check(pIndirectStrides, pInfos.remaining()); check(ppMaxPrimitiveCounts, pInfos.remaining()); } callPPPPPV(commandBuffer.address(), pInfos.remaining(), pInfos.address(), pIndirectDeviceAddresses, pIndirectStrides, memAddress(ppMaxPrimitiveCounts), __functionAddress); } /** Array version of: {@link #vkWriteAccelerationStructuresPropertiesKHR WriteAccelerationStructuresPropertiesKHR} */ @NativeType("VkResult") public static int vkWriteAccelerationStructuresPropertiesKHR(VkDevice device, @NativeType("VkAccelerationStructureKHR const *") long[] pAccelerationStructures, @NativeType("VkQueryType") int queryType, @NativeType("void *") ByteBuffer pData, @NativeType("size_t") long stride) { long __functionAddress = device.getCapabilities().vkWriteAccelerationStructuresPropertiesKHR; if (CHECKS) { check(__functionAddress); } return callPPPPPI(device.address(), pAccelerationStructures.length, pAccelerationStructures, queryType, (long)pData.remaining(), memAddress(pData), stride, __functionAddress); } /** Array version of: {@link #vkCmdWriteAccelerationStructuresPropertiesKHR CmdWriteAccelerationStructuresPropertiesKHR} */ public static void vkCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, @NativeType("VkAccelerationStructureKHR const *") long[] pAccelerationStructures, @NativeType("VkQueryType") int queryType, @NativeType("VkQueryPool") long queryPool, @NativeType("uint32_t") int firstQuery) { long __functionAddress = commandBuffer.getCapabilities().vkCmdWriteAccelerationStructuresPropertiesKHR; if (CHECKS) { check(__functionAddress); } callPPJV(commandBuffer.address(), pAccelerationStructures.length, pAccelerationStructures, queryType, queryPool, firstQuery, __functionAddress); } /** Array version of: {@link #vkGetDeviceAccelerationStructureCompatibilityKHR GetDeviceAccelerationStructureCompatibilityKHR} */ public static void vkGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, @NativeType("VkAccelerationStructureVersionInfoKHR const *") VkAccelerationStructureVersionInfoKHR pVersionInfo, @NativeType("VkAccelerationStructureCompatibilityKHR *") int[] pCompatibility) { long __functionAddress = device.getCapabilities().vkGetDeviceAccelerationStructureCompatibilityKHR; if (CHECKS) { check(__functionAddress); check(pCompatibility, 1); VkAccelerationStructureVersionInfoKHR.validate(pVersionInfo.address()); } callPPPV(device.address(), pVersionInfo.address(), pCompatibility, __functionAddress); } /** Array version of: {@link #vkGetAccelerationStructureBuildSizesKHR GetAccelerationStructureBuildSizesKHR} */ public static void vkGetAccelerationStructureBuildSizesKHR(VkDevice device, @NativeType("VkAccelerationStructureBuildTypeKHR") int buildType, @NativeType("VkAccelerationStructureBuildGeometryInfoKHR const *") VkAccelerationStructureBuildGeometryInfoKHR pBuildInfo, @Nullable @NativeType("uint32_t const *") int[] pMaxPrimitiveCounts, @NativeType("VkAccelerationStructureBuildSizesInfoKHR *") VkAccelerationStructureBuildSizesInfoKHR pSizeInfo) { long __functionAddress = device.getCapabilities().vkGetAccelerationStructureBuildSizesKHR; if (CHECKS) { check(__functionAddress); checkSafe(pMaxPrimitiveCounts, pBuildInfo.geometryCount()); } callPPPPV(device.address(), buildType, pBuildInfo.address(), pMaxPrimitiveCounts, pSizeInfo.address(), __functionAddress); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy