Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkAccelerationStructureBuildGeometryInfoKHR

extends Struct<VkAccelerationStructureBuildGeometryInfoKHR>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Structure specifying the geometry data used to build an acceleration structure.
Description

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.

Valid Usage
Valid Usage (Implicit)
See Also

VkAccelerationStructureGeometryKHR, VkDeviceOrHostAddressKHR, BuildAccelerationStructuresKHR, CmdBuildAccelerationStructuresIndirectKHR, CmdBuildAccelerationStructuresKHR, GetAccelerationStructureBuildSizesKHR

Layout


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;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField 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.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
public
VkAccelerationStructureBuildGeometryInfoKHR(ByteBuffer container)

Creates a VkAccelerationStructureBuildGeometryInfoKHR instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static VkAccelerationStructureBuildGeometryInfoKHR
calloc()

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance allocated with memCalloc.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance allocated with memCalloc.

public static VkAccelerationStructureBuildGeometryInfoKHR
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

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.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VkAccelerationStructureBuildGeometryInfoKHR
create()

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance allocated with BufferUtils.

public static VkAccelerationStructureBuildGeometryInfoKHR
create(long address)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance for the specified memory address.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance allocated with BufferUtils.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance at the specified memory.

public static VkAccelerationStructureBuildGeometryInfoKHR
createSafe(long address)

Like create, but returns null if address is NULL.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public long
dstAccelerationStructure()

a pointer to the target acceleration structure for the build.

public VkAccelerationStructureBuildGeometryInfoKHR
dstAccelerationStructure(long value)

Sets the specified value to the dstAccelerationStructure field.

public int
flags()

a bitmask of VkBuildAccelerationStructureFlagBitsKHR specifying additional parameters of the acceleration structure.

public VkAccelerationStructureBuildGeometryInfoKHR
flags(int value)

Sets the specified value to the flags field.

public int
geometryCount()

specifies the number of geometries that will be built into dstAccelerationStructure.

public VkAccelerationStructureBuildGeometryInfoKHR
geometryCount(int value)

Sets the specified value to the geometryCount field.

public static VkAccelerationStructureBuildGeometryInfoKHR
malloc()

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance allocated with memAlloc.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance allocated with memAlloc.

public static VkAccelerationStructureBuildGeometryInfoKHR
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR instance allocated on the specified MemoryStack.

public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkAccelerationStructureBuildGeometryInfoKHR.Buffer instance allocated on the specified MemoryStack.

public int
mode()

a VkBuildAccelerationStructureModeKHR value specifying the type of operation to perform.

public VkAccelerationStructureBuildGeometryInfoKHR
mode(int value)

Sets the specified value to the mode field.

public static long
ndstAccelerationStructure(long struct)

Unsafe version of dstAccelerationStructure.

public static void
ndstAccelerationStructure(long struct, long value)

Unsafe version of dstAccelerationStructure.

public static int
nflags(long struct)

Unsafe version of flags.

public static void
nflags(long struct, int value)

Unsafe version of flags.

public static int
ngeometryCount(long struct)

Unsafe version of geometryCount.

public static void
ngeometryCount(long struct, int value)

Sets the specified value to the geometryCount field of the specified struct.

public static int
nmode(long struct)

Unsafe version of mode.

public static void
nmode(long struct, int value)

Unsafe version of mode.

public static VkAccelerationStructureGeometryKHR.Buffer
npGeometries(long struct)

Unsafe version of pGeometries.

public static void
npGeometries(long struct, VkAccelerationStructureGeometryKHR.Buffer value)

Unsafe version of pGeometries.

public static long
npNext(long struct)

Unsafe version of pNext.

public static void
npNext(long struct, long value)

Unsafe version of pNext.

public static PointerBuffer
nppGeometries(long struct)

Unsafe version of ppGeometries.

public static void
nppGeometries(long struct, PointerBuffer value)

Unsafe version of ppGeometries.

public static VkDeviceOrHostAddressKHR
nscratchData(long struct)

Unsafe version of scratchData.

public static void
nscratchData(long struct, VkDeviceOrHostAddressKHR value)

Unsafe version of scratchData.

public static long
nsrcAccelerationStructure(long struct)

Unsafe version of srcAccelerationStructure.

public static void
nsrcAccelerationStructure(long struct, long value)

Unsafe version of srcAccelerationStructure.

public static int
nsType(long struct)

Unsafe version of sType.

public static void
nsType(long struct, int value)

Unsafe version of sType.

public static int
ntype(long struct)

Unsafe version of type.

public static void
ntype(long struct, int value)

Unsafe version of type.

public VkAccelerationStructureGeometryKHR.Buffer
pGeometries()

a pointer to an array of VkAccelerationStructureGeometryKHR structures.

public VkAccelerationStructureBuildGeometryInfoKHR
public long
pNext()

NULL or a pointer to a structure extending this structure.

public VkAccelerationStructureBuildGeometryInfoKHR
pNext(long value)

Sets the specified value to the pNext field.

public PointerBuffer
ppGeometries()

a pointer to an array of pointers to VkAccelerationStructureGeometryKHR structures.

public VkAccelerationStructureBuildGeometryInfoKHR
ppGeometries(PointerBuffer value)

Sets the address of the specified PointerBuffer to the ppGeometries field.

public VkDeviceOrHostAddressKHR
scratchData()

the device or host address to memory that will be used as scratch memory for the build.

public VkAccelerationStructureBuildGeometryInfoKHR
public VkAccelerationStructureBuildGeometryInfoKHR
scratchData(Consumer<VkDeviceOrHostAddressKHR> consumer)

Passes the scratchData field to the specified Consumer.

public VkAccelerationStructureBuildGeometryInfoKHR
set(int sType, long pNext, int type, int flags, int mode, long srcAccelerationStructure, long dstAccelerationStructure, int geometryCount, VkAccelerationStructureGeometryKHR.Buffer pGeometries, PointerBuffer ppGeometries, VkDeviceOrHostAddressKHR scratchData)

Initializes this struct with the specified values.

public VkAccelerationStructureBuildGeometryInfoKHR

Returns:

this struct
set
(VkAccelerationStructureBuildGeometryInfoKHR
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public long
srcAccelerationStructure()

a pointer to an existing acceleration structure that is to be used to update the dst acceleration structure when mode is BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR.

public VkAccelerationStructureBuildGeometryInfoKHR
srcAccelerationStructure(long value)

Sets the specified value to the srcAccelerationStructure field.

public int
sType()

a VkStructureType value identifying this structure.

public VkAccelerationStructureBuildGeometryInfoKHR
sType(int value)

Sets the specified value to the sType field.

public VkAccelerationStructureBuildGeometryInfoKHR
public int
type()

a VkAccelerationStructureTypeKHR value specifying the type of acceleration structure being built.

public VkAccelerationStructureBuildGeometryInfoKHR
type(int value)

Sets the specified value to the type field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate