Only one of pGeometries or ppGeometries can be a valid pointer, the other must be NULL. Each element of the non-NULL array describes the data used to build each acceleration structure geometry.
The index of each element of the pGeometries or ppGeometries members of VkAccelerationStructureBuildGeometryInfoKHR is used as the geometry index during ray traversal. The geometry index is available in ray shaders via the RayGeometryIndexKHR built-in, and is used to determine hit and intersection shaders executed during traversal. The geometry index is available to ray queries via the OpRayQueryGetIntersectionGeometryIndexKHR instruction.
Setting BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in flags indicates that this build is a motion top level acceleration structure. A motion top level uses instances of format VkAccelerationStructureMotionInstanceNV if VkAccelerationStructureGeometryInstancesDataKHR::arrayOfPointers is FALSE.
If VkAccelerationStructureGeometryInstancesDataKHR::arrayOfPointers is TRUE, the pointer for each element of the array of instance pointers consists of 4 bits of VkAccelerationStructureMotionInstanceTypeNV in the low 4 bits of the pointer identifying the type of structure at the pointer. The device address accessed is the value in the array with the low 4 bits set to zero. The structure at the pointer is one of VkAccelerationStructureInstanceKHR, VkAccelerationStructureMatrixMotionInstanceNV or VkAccelerationStructureSRTMotionInstanceNV, depending on the type value encoded in the low 4 bits.
A top level acceleration structure with either motion instances or vertex motion in its instances must set BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in flags.
Members srcAccelerationStructure and dstAccelerationStructure may be the same or different for an update operation (when mode is BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR). If they are the same, the update happens in-place. Otherwise, the target acceleration structure is updated and the source is not modified.
type must not be ACCELERATION_STRUCTURE_TYPE_GENERIC_KHRpGeometries or ppGeometries can be a valid pointer, the other must be NULLtype is ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, the geometryType member of elements of either pGeometries or ppGeometries must be GEOMETRY_TYPE_INSTANCES_KHRtype is ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, geometryCount must be 1type is ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR the geometryType member of elements of either pGeometries or ppGeometries must not be GEOMETRY_TYPE_INSTANCES_KHRtype is ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR then the geometryType member of each geometry in either pGeometries or ppGeometries must be the sametype is ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR then geometryCount must be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxGeometryCounttype is ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR and the geometryType member of either pGeometries or ppGeometries is GEOMETRY_TYPE_AABBS_KHR, the total number of AABBs in all geometries must be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxPrimitiveCounttype is ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR and the geometryType member of either pGeometries or ppGeometries is GEOMETRY_TYPE_TRIANGLES_KHR, the total number of triangles in all geometries must be less than or equal to VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxPrimitiveCountflags has the BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR bit set, then it must not have the BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR bit setdstAccelerationStructure was created with ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV set in VkAccelerationStructureCreateInfoKHR::flags, BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV must be set in flagsBUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV is set in flags, dstAccelerationStructure must have been created with ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV set in VkAccelerationStructureCreateInfoKHR::flagsBUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV is set in flags, type must not be ACCELERATION_STRUCTURE_TYPE_GENERIC_KHRflags has the BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT bit set then it must not have the BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT bit setsType must be STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHRpNext must be NULLtype must be a valid VkAccelerationStructureTypeKHR valueflags must be a valid combination of VkBuildAccelerationStructureFlagBitsKHR valuesgeometryCount is not 0, and pGeometries is not NULL, pGeometries must be a valid pointer to an array of geometryCount valid VkAccelerationStructureGeometryKHR structuresgeometryCount is not 0, and ppGeometries is not NULL, ppGeometries must be a valid pointer to an array of geometryCount valid pointers to valid VkAccelerationStructureGeometryKHR structuresdstAccelerationStructure, and srcAccelerationStructure that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDeviceVkAccelerationStructureGeometryKHR, VkDeviceOrHostAddressKHR, BuildAccelerationStructuresKHR, CmdBuildAccelerationStructuresIndirectKHR, CmdBuildAccelerationStructuresKHR, GetAccelerationStructureBuildSizesKHR
struct VkAccelerationStructureBuildGeometryInfoKHR {
VkStructureType sType;
void const * pNext;
VkAccelerationStructureTypeKHR type;
VkBuildAccelerationStructureFlagsKHR flags;
VkBuildAccelerationStructureModeKHR mode;
VkAccelerationStructureKHR srcAccelerationStructure;
VkAccelerationStructureKHR dstAccelerationStructure;
uint32_t geometryCount;
VkAccelerationStructureGeometryKHR const * pGeometries;
VkAccelerationStructureGeometryKHR const * const * ppGeometries;
VkDeviceOrHostAddressKHR scratchData;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | DSTACCELERATIONSTRUCTURE
The struct member offsets. |
| public static final int | FLAGS
The struct member offsets. |
| public static final int | GEOMETRYCOUNT
The struct member offsets. |
| public static final int | MODE
The struct member offsets. |
| public static final int | PGEOMETRIES
The struct member offsets. |
| public static final int | PNEXT
The struct member offsets. |
| public static final int | PPGEOMETRIES
The struct member offsets. |
| public static final int | SCRATCHDATA
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | SRCACCELERATIONSTRUCTURE
The struct member offsets. |
| public static final int | STYPE
The struct member offsets. |
| public static final int | TYPE
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkAccelerationStructureBuildGeometryInfoKHR(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkAccelerationStructureBuildGeometryInfoKHR | |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| protected VkAccelerationStructureBuildGeometryInfoKHR | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkAccelerationStructureBuildGeometryInfoKHR | create()
Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR | create(long address)
Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | create(int
the buffer capacity capacity)Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkAccelerationStructureBuildGeometryInfoKHR | |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | |
| public long | |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public int | flags()
a bitmask of |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public int | |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public static VkAccelerationStructureBuildGeometryInfoKHR | |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAccelerationStructureBuildGeometryInfoKHR. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public int | |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public static long | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | ngeometryCount(long struct, int value)
Sets the specified value to the |
| public static int | |
| public static void | |
| public static VkAccelerationStructureGeometryKHR. | |
| public static void | npGeometries(long struct, VkAccelerationStructureGeometryKHR.
Unsafe version of |
| public static long | |
| public static void | |
| public static PointerBuffer | |
| public static void | |
| public static VkDeviceOrHostAddressKHR | |
| public static void | |
| public static long | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public VkAccelerationStructureGeometryKHR. | |
| public VkAccelerationStructureBuildGeometryInfoKHR | pGeometries(VkAccelerationStructureGeometryKHR.
Sets the address of the specified |
| public long | |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public PointerBuffer | |
| public VkAccelerationStructureBuildGeometryInfoKHR | ppGeometries(PointerBuffer value)
Sets the address of the specified |
| public VkDeviceOrHostAddressKHR | scratchData()
the device or host address to memory that will be used as scratch memory for the build. |
| public VkAccelerationStructureBuildGeometryInfoKHR | scratchData(VkDeviceOrHostAddressKHR value)
Copies the specified |
| public VkAccelerationStructureBuildGeometryInfoKHR | scratchData(Consumer<VkDeviceOrHostAddressKHR> consumer)
Passes the |
| public VkAccelerationStructureBuildGeometryInfoKHR | set(int sType, long pNext, int type, int flags, int mode, long srcAccelerationStructure, long dstAccelerationStructure, int geometryCount, VkAccelerationStructureGeometryKHR.
Initializes this struct with the specified values. |
| public VkAccelerationStructureBuildGeometryInfoKHR | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public long | srcAccelerationStructure()
a pointer to an existing acceleration structure that is to be used to update the |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public int | |
| public VkAccelerationStructureBuildGeometryInfoKHR | |
| public VkAccelerationStructureBuildGeometryInfoKHR | sType$Default()
Sets the |
| public int | type()
a |
| public VkAccelerationStructureBuildGeometryInfoKHR |