Class VkAccelerationStructureBuildGeometryInfoKHR
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
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
typemust not beACCELERATION_STRUCTURE_TYPE_GENERIC_KHR- If
geometryCountis not 0, exactly one ofpGeometriesorppGeometriesmust be a valid pointer, the other must beNULL - If
typeisACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, thegeometryTypemember of elements of eitherpGeometriesorppGeometriesmust beGEOMETRY_TYPE_INSTANCES_KHR - If
typeisACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR,geometryCountmust be 1 - If
typeisACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRthegeometryTypemember of elements of eitherpGeometriesorppGeometriesmust not beGEOMETRY_TYPE_INSTANCES_KHR - If
typeisACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRthen thegeometryTypemember of each geometry in eitherpGeometriesorppGeometriesmust be the same - If
typeisACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRthengeometryCountmust be less than or equal toVkPhysicalDeviceAccelerationStructurePropertiesKHR::maxGeometryCount - If
typeisACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRand thegeometryTypemember of eitherpGeometriesorppGeometriesisGEOMETRY_TYPE_AABBS_KHR, the total number of AABBs in all geometries must be less than or equal toVkPhysicalDeviceAccelerationStructurePropertiesKHR::maxPrimitiveCount - If
typeisACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHRand thegeometryTypemember of eitherpGeometriesorppGeometriesisGEOMETRY_TYPE_TRIANGLES_KHR, the total number of triangles in all geometries must be less than or equal toVkPhysicalDeviceAccelerationStructurePropertiesKHR::maxPrimitiveCount - If
flagshas theBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHRbit set, then it must not have theBUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHRbit set - If
dstAccelerationStructurewas created withACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NVset inVkAccelerationStructureCreateInfoKHR::flags,BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NVmust be set inflags - If
BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NVis set inflags,dstAccelerationStructuremust have been created withACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NVset inVkAccelerationStructureCreateInfoKHR::flags - If
BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NVis set inflags,typemust not beACCELERATION_STRUCTURE_TYPE_GENERIC_KHR - If
flagshas theBUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXTbit set then it must not have theBUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXTbit set
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHRpNextmust beNULLtypemust be a validVkAccelerationStructureTypeKHRvalueflagsmust be a valid combination ofVkBuildAccelerationStructureFlagBitsKHRvalues- If
geometryCountis not 0, andpGeometriesis notNULL,pGeometriesmust be a valid pointer to an array ofgeometryCountvalidVkAccelerationStructureGeometryKHRstructures - If
geometryCountis not 0, andppGeometriesis notNULL,ppGeometriesmust be a valid pointer to an array ofgeometryCountvalid pointers to validVkAccelerationStructureGeometryKHRstructures - Both of
dstAccelerationStructure, andsrcAccelerationStructurethat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameVkDevice
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 Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn array ofVkAccelerationStructureBuildGeometryInfoKHRstructs.Nested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionCreates aVkAccelerationStructureBuildGeometryInfoKHRinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptioncalloc()Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.calloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.create()Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withBufferUtils.create(int capacity) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withBufferUtils.create(long address) Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance for the specified memory address.create(long address, int capacity) Create aVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance at the specified memory.static @Nullable VkAccelerationStructureBuildGeometryInfoKHRcreateSafe(long address) static @Nullable VkAccelerationStructureBuildGeometryInfoKHR.BuffercreateSafe(long address, int capacity) longa pointer to the target acceleration structure for the build.dstAccelerationStructure(long value) Sets the specified value to thedstAccelerationStructure()field.intflags()a bitmask ofVkBuildAccelerationStructureFlagBitsKHRspecifying additional parameters of the acceleration structure.flags(int value) Sets the specified value to theflags()field.intspecifies the number of geometries that will be built intodstAccelerationStructure.geometryCount(int value) Sets the specified value to thegeometryCount()field.malloc()Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.malloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated on the specifiedMemoryStack.intmode()aVkBuildAccelerationStructureModeKHRvalue specifying the type of operation to perform.mode(int value) Sets the specified value to themode()field.static longndstAccelerationStructure(long struct) Unsafe version ofdstAccelerationStructure().static voidndstAccelerationStructure(long struct, long value) Unsafe version ofdstAccelerationStructure.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static intngeometryCount(long struct) Unsafe version ofgeometryCount().static voidngeometryCount(long struct, int value) Sets the specified value to thegeometryCountfield of the specifiedstruct.static intnmode(long struct) Unsafe version ofmode().static voidnmode(long struct, int value) Unsafe version ofmode.static @Nullable VkAccelerationStructureGeometryKHR.BuffernpGeometries(long struct) Unsafe version ofpGeometries().static voidnpGeometries(long struct, @Nullable VkAccelerationStructureGeometryKHR.Buffer value) Unsafe version ofpGeometries.static longnpNext(long struct) Unsafe version ofpNext().static voidnpNext(long struct, long value) Unsafe version ofpNext.static @Nullable org.lwjgl.PointerBuffernppGeometries(long struct) Unsafe version ofppGeometries.static voidnppGeometries(long struct, @Nullable org.lwjgl.PointerBuffer value) Unsafe version ofppGeometries.static VkDeviceOrHostAddressKHRnscratchData(long struct) Unsafe version ofscratchData().static voidnscratchData(long struct, VkDeviceOrHostAddressKHR value) Unsafe version ofscratchData.static longnsrcAccelerationStructure(long struct) Unsafe version ofsrcAccelerationStructure().static voidnsrcAccelerationStructure(long struct, long value) Unsafe version ofsrcAccelerationStructure.static intnsType(long struct) Unsafe version ofsType().static voidnsType(long struct, int value) Unsafe version ofsType.static intntype(long struct) Unsafe version oftype().static voidntype(long struct, int value) Unsafe version oftype.a pointer to an array ofVkAccelerationStructureGeometryKHRstructures.pGeometries(@Nullable VkAccelerationStructureGeometryKHR.Buffer value) Sets the address of the specifiedVkAccelerationStructureGeometryKHR.Bufferto thepGeometries()field.longpNext()NULLor a pointer to a structure extending this structure.pNext(long value) Sets the specified value to thepNext()field.@Nullable org.lwjgl.PointerBuffera pointer to an array of pointers toVkAccelerationStructureGeometryKHRstructures.ppGeometries(@Nullable org.lwjgl.PointerBuffer value) Sets the address of the specifiedPointerBufferto theppGeometries()field.the device or host address to memory that will be used as scratch memory for the build.scratchData(Consumer<VkDeviceOrHostAddressKHR> consumer) Passes thescratchData()field to the specifiedConsumer.Copies the specifiedVkDeviceOrHostAddressKHRto thescratchData()field.set(int sType, long pNext, int type, int flags, int mode, long srcAccelerationStructure, long dstAccelerationStructure, int geometryCount, @Nullable VkAccelerationStructureGeometryKHR.Buffer pGeometries, @Nullable org.lwjgl.PointerBuffer ppGeometries, VkDeviceOrHostAddressKHR scratchData) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()longa pointer to an existing acceleration structure that is to be used to update thedstAccelerationStructureacceleration structure whenmodeisBUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR.srcAccelerationStructure(long value) Sets the specified value to thesrcAccelerationStructure()field.intsType()aVkStructureTypevalue identifying this structure.sType(int value) Sets the specified value to thesType()field.Sets theSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHRvalue to thesType()field.inttype()aVkAccelerationStructureTypeKHRvalue specifying the type of acceleration structure being built.type(int value) Sets the specified value to thetype()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
STYPE
public static final int STYPEThe struct member offsets. -
PNEXT
public static final int PNEXTThe struct member offsets. -
TYPE
public static final int TYPEThe struct member offsets. -
FLAGS
public static final int FLAGSThe struct member offsets. -
MODE
public static final int MODEThe struct member offsets. -
SRCACCELERATIONSTRUCTURE
public static final int SRCACCELERATIONSTRUCTUREThe struct member offsets. -
DSTACCELERATIONSTRUCTURE
public static final int DSTACCELERATIONSTRUCTUREThe struct member offsets. -
GEOMETRYCOUNT
public static final int GEOMETRYCOUNTThe struct member offsets. -
PGEOMETRIES
public static final int PGEOMETRIESThe struct member offsets. -
PPGEOMETRIES
public static final int PPGEOMETRIESThe struct member offsets. -
SCRATCHDATA
public static final int SCRATCHDATAThe struct member offsets.
-
-
Constructor Details
-
VkAccelerationStructureBuildGeometryInfoKHR
Creates aVkAccelerationStructureBuildGeometryInfoKHRinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkAccelerationStructureBuildGeometryInfoKHR>
-
sType
public int sType()aVkStructureTypevalue identifying this structure. -
pNext
public long pNext()NULLor a pointer to a structure extending this structure. -
type
public int type()aVkAccelerationStructureTypeKHRvalue specifying the type of acceleration structure being built. -
flags
public int flags()a bitmask ofVkBuildAccelerationStructureFlagBitsKHRspecifying additional parameters of the acceleration structure. -
mode
public int mode()aVkBuildAccelerationStructureModeKHRvalue specifying the type of operation to perform. -
srcAccelerationStructure
public long srcAccelerationStructure()a pointer to an existing acceleration structure that is to be used to update thedstAccelerationStructureacceleration structure whenmodeisBUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR. -
dstAccelerationStructure
public long dstAccelerationStructure()a pointer to the target acceleration structure for the build. -
geometryCount
public int geometryCount()specifies the number of geometries that will be built intodstAccelerationStructure. -
pGeometries
a pointer to an array ofVkAccelerationStructureGeometryKHRstructures. -
ppGeometries
public @Nullable org.lwjgl.PointerBuffer ppGeometries()a pointer to an array of pointers toVkAccelerationStructureGeometryKHRstructures. -
scratchData
the device or host address to memory that will be used as scratch memory for the build. -
sType
Sets the specified value to thesType()field. -
sType$Default
Sets theSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHRvalue to thesType()field. -
pNext
Sets the specified value to thepNext()field. -
type
Sets the specified value to thetype()field. -
flags
Sets the specified value to theflags()field. -
mode
Sets the specified value to themode()field. -
srcAccelerationStructure
Sets the specified value to thesrcAccelerationStructure()field. -
dstAccelerationStructure
Sets the specified value to thedstAccelerationStructure()field. -
geometryCount
Sets the specified value to thegeometryCount()field. -
pGeometries
public VkAccelerationStructureBuildGeometryInfoKHR pGeometries(@Nullable VkAccelerationStructureGeometryKHR.Buffer value) Sets the address of the specifiedVkAccelerationStructureGeometryKHR.Bufferto thepGeometries()field. -
ppGeometries
public VkAccelerationStructureBuildGeometryInfoKHR ppGeometries(@Nullable org.lwjgl.PointerBuffer value) Sets the address of the specifiedPointerBufferto theppGeometries()field. -
scratchData
Copies the specifiedVkDeviceOrHostAddressKHRto thescratchData()field. -
scratchData
public VkAccelerationStructureBuildGeometryInfoKHR scratchData(Consumer<VkDeviceOrHostAddressKHR> consumer) Passes thescratchData()field to the specifiedConsumer. -
set
public VkAccelerationStructureBuildGeometryInfoKHR set(int sType, long pNext, int type, int flags, int mode, long srcAccelerationStructure, long dstAccelerationStructure, int geometryCount, @Nullable VkAccelerationStructureGeometryKHR.Buffer pGeometries, @Nullable org.lwjgl.PointerBuffer ppGeometries, VkDeviceOrHostAddressKHR scratchData) Initializes this struct with the specified values. -
set
public VkAccelerationStructureBuildGeometryInfoKHR set(VkAccelerationStructureBuildGeometryInfoKHR src) Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated withBufferUtils. -
create
Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
public static @Nullable VkAccelerationStructureBuildGeometryInfoKHR.Buffer createSafe(long address, int capacity) -
malloc
public static VkAccelerationStructureBuildGeometryInfoKHR malloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureBuildGeometryInfoKHR calloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureBuildGeometryInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildGeometryInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nsType
public static int nsType(long struct) Unsafe version ofsType(). -
npNext
public static long npNext(long struct) Unsafe version ofpNext(). -
ntype
public static int ntype(long struct) Unsafe version oftype(). -
nflags
public static int nflags(long struct) Unsafe version offlags(). -
nmode
public static int nmode(long struct) Unsafe version ofmode(). -
nsrcAccelerationStructure
public static long nsrcAccelerationStructure(long struct) Unsafe version ofsrcAccelerationStructure(). -
ndstAccelerationStructure
public static long ndstAccelerationStructure(long struct) Unsafe version ofdstAccelerationStructure(). -
ngeometryCount
public static int ngeometryCount(long struct) Unsafe version ofgeometryCount(). -
npGeometries
Unsafe version ofpGeometries(). -
nppGeometries
public static @Nullable org.lwjgl.PointerBuffer nppGeometries(long struct) Unsafe version ofppGeometries. -
nscratchData
Unsafe version ofscratchData(). -
nsType
public static void nsType(long struct, int value) Unsafe version ofsType. -
npNext
public static void npNext(long struct, long value) Unsafe version ofpNext. -
ntype
public static void ntype(long struct, int value) Unsafe version oftype. -
nflags
public static void nflags(long struct, int value) Unsafe version offlags. -
nmode
public static void nmode(long struct, int value) Unsafe version ofmode. -
nsrcAccelerationStructure
public static void nsrcAccelerationStructure(long struct, long value) Unsafe version ofsrcAccelerationStructure. -
ndstAccelerationStructure
public static void ndstAccelerationStructure(long struct, long value) Unsafe version ofdstAccelerationStructure. -
ngeometryCount
public static void ngeometryCount(long struct, int value) Sets the specified value to thegeometryCountfield of the specifiedstruct. -
npGeometries
public static void npGeometries(long struct, @Nullable VkAccelerationStructureGeometryKHR.Buffer value) Unsafe version ofpGeometries. -
nppGeometries
public static void nppGeometries(long struct, @Nullable org.lwjgl.PointerBuffer value) Unsafe version ofppGeometries. -
nscratchData
Unsafe version ofscratchData.
-