Package org.lwjgl.vulkan
Class VkAccelerationStructureBuildRangeInfoKHR
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkAccelerationStructureBuildRangeInfoKHR>
org.lwjgl.vulkan.VkAccelerationStructureBuildRangeInfoKHR
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkAccelerationStructureBuildRangeInfoKHR
extends org.lwjgl.system.Struct<VkAccelerationStructureBuildRangeInfoKHR>
implements org.lwjgl.system.NativeResource
Structure specifying build offsets and counts for acceleration structure builds.
Description
The primitive count and primitive offset are interpreted differently depending on the VkGeometryTypeKHR used:
- For geometries of type
GEOMETRY_TYPE_TRIANGLES_KHR,primitiveCountis the number of triangles to be built, where each triangle is treated as 3 vertices.- If the geometry uses indices,
primitiveCount × 3indices are consumed fromVkAccelerationStructureGeometryTrianglesDataKHR::indexData, starting at an offset ofprimitiveOffset. The value offirstVertexis added to the index values before fetching vertices. - If the geometry does not use indices,
primitiveCount × 3vertices are consumed fromVkAccelerationStructureGeometryTrianglesDataKHR::vertexData, starting at an offset ofprimitiveOffset +.VkAccelerationStructureGeometryTrianglesDataKHR::vertexStride × firstVertex - If
VkAccelerationStructureGeometryTrianglesDataKHR::transformDatais notNULL, a singleVkTransformMatrixKHRstructure is consumed fromVkAccelerationStructureGeometryTrianglesDataKHR::transformData, at an offset oftransformOffset. This matrix describes a transformation from the space in which the vertices for all triangles in this geometry are described to the space in which the acceleration structure is defined.
- If the geometry uses indices,
- For geometries of type
GEOMETRY_TYPE_AABBS_KHR,primitiveCountis the number of axis-aligned bounding boxes.primitiveCountVkAabbPositionsKHRstructures are consumed fromVkAccelerationStructureGeometryAabbsDataKHR::data, starting at an offset ofprimitiveOffset. - For geometries of type
GEOMETRY_TYPE_INSTANCES_KHR,primitiveCountis the number of acceleration structures.primitiveCountVkAccelerationStructureInstanceKHRorVkAccelerationStructureMotionInstanceNVstructures are consumed fromVkAccelerationStructureGeometryInstancesDataKHR::data, starting at an offset ofprimitiveOffset.
Valid Usage
- For geometries of type
GEOMETRY_TYPE_TRIANGLES_KHR, if the geometry uses indices, the offsetprimitiveOffsetfromVkAccelerationStructureGeometryTrianglesDataKHR::indexDatamust be a multiple of the element size ofVkAccelerationStructureGeometryTrianglesDataKHR::indexType - For geometries of type
GEOMETRY_TYPE_TRIANGLES_KHR, if the geometry does not use indices, the offsetprimitiveOffsetfromVkAccelerationStructureGeometryTrianglesDataKHR::vertexDatamust be a multiple of the component size ofVkAccelerationStructureGeometryTrianglesDataKHR::vertexFormat - For geometries of type
GEOMETRY_TYPE_TRIANGLES_KHR, the offsettransformOffsetfromVkAccelerationStructureGeometryTrianglesDataKHR::transformDatamust be a multiple of 16 - For geometries of type
GEOMETRY_TYPE_AABBS_KHR, the offsetprimitiveOffsetfromVkAccelerationStructureGeometryAabbsDataKHR::datamust be a multiple of 8 - For geometries of type
GEOMETRY_TYPE_INSTANCES_KHR, the offsetprimitiveOffsetfromVkAccelerationStructureGeometryInstancesDataKHR::datamust be a multiple of 16
See Also
BuildAccelerationStructuresKHR, CmdBuildAccelerationStructuresKHR
Layout
struct VkAccelerationStructureBuildRangeInfoKHR {
uint32_t primitiveCount();
uint32_t primitiveOffset();
uint32_t firstVertex();
uint32_t transformOffset();
}-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn array ofVkAccelerationStructureBuildRangeInfoKHRstructs.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 size in bytes.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 aVkAccelerationStructureBuildRangeInfoKHRinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptioncalloc()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.calloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.create()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withBufferUtils.create(int capacity) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withBufferUtils.create(long address) Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance for the specified memory address.create(long address, int capacity) Create aVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance at the specified memory.static @Nullable VkAccelerationStructureBuildRangeInfoKHRcreateSafe(long address) static @Nullable VkAccelerationStructureBuildRangeInfoKHR.BuffercreateSafe(long address, int capacity) intthe index of the first vertex to build from for triangle geometry.firstVertex(int value) Sets the specified value to thefirstVertex()field.malloc()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.malloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStack.static intnfirstVertex(long struct) Unsafe version offirstVertex().static voidnfirstVertex(long struct, int value) Unsafe version offirstVertex.static intnprimitiveCount(long struct) Unsafe version ofprimitiveCount().static voidnprimitiveCount(long struct, int value) Unsafe version ofprimitiveCount.static intnprimitiveOffset(long struct) Unsafe version ofprimitiveOffset().static voidnprimitiveOffset(long struct, int value) Unsafe version ofprimitiveOffset.static intntransformOffset(long struct) Unsafe version oftransformOffset().static voidntransformOffset(long struct, int value) Unsafe version oftransformOffset.intdefines the number of primitives for a corresponding acceleration structure geometry.primitiveCount(int value) Sets the specified value to theprimitiveCount()field.intdefines an offset in bytes into the memory where primitive data is defined.primitiveOffset(int value) Sets the specified value to theprimitiveOffset()field.set(int primitiveCount, int primitiveOffset, int firstVertex, int transformOffset) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intdefines an offset in bytes into the memory where a transform matrix is defined.transformOffset(int value) Sets the specified value to thetransformOffset()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. -
PRIMITIVECOUNT
public static final int PRIMITIVECOUNTThe struct member offsets. -
PRIMITIVEOFFSET
public static final int PRIMITIVEOFFSETThe struct member offsets. -
FIRSTVERTEX
public static final int FIRSTVERTEXThe struct member offsets. -
TRANSFORMOFFSET
public static final int TRANSFORMOFFSETThe struct member offsets.
-
-
Constructor Details
-
VkAccelerationStructureBuildRangeInfoKHR
Creates aVkAccelerationStructureBuildRangeInfoKHRinstance 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<VkAccelerationStructureBuildRangeInfoKHR>
-
primitiveCount
public int primitiveCount()defines the number of primitives for a corresponding acceleration structure geometry. -
primitiveOffset
public int primitiveOffset()defines an offset in bytes into the memory where primitive data is defined. -
firstVertex
public int firstVertex()the index of the first vertex to build from for triangle geometry. -
transformOffset
public int transformOffset()defines an offset in bytes into the memory where a transform matrix is defined. -
primitiveCount
Sets the specified value to theprimitiveCount()field. -
primitiveOffset
Sets the specified value to theprimitiveOffset()field. -
firstVertex
Sets the specified value to thefirstVertex()field. -
transformOffset
Sets the specified value to thetransformOffset()field. -
set
public VkAccelerationStructureBuildRangeInfoKHR set(int primitiveCount, int primitiveOffset, int firstVertex, int transformOffset) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withBufferUtils. -
create
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
public static @Nullable VkAccelerationStructureBuildRangeInfoKHR.Buffer createSafe(long address, int capacity) -
malloc
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nprimitiveCount
public static int nprimitiveCount(long struct) Unsafe version ofprimitiveCount(). -
nprimitiveOffset
public static int nprimitiveOffset(long struct) Unsafe version ofprimitiveOffset(). -
nfirstVertex
public static int nfirstVertex(long struct) Unsafe version offirstVertex(). -
ntransformOffset
public static int ntransformOffset(long struct) Unsafe version oftransformOffset(). -
nprimitiveCount
public static void nprimitiveCount(long struct, int value) Unsafe version ofprimitiveCount. -
nprimitiveOffset
public static void nprimitiveOffset(long struct, int value) Unsafe version ofprimitiveOffset. -
nfirstVertex
public static void nfirstVertex(long struct, int value) Unsafe version offirstVertex. -
ntransformOffset
public static void ntransformOffset(long struct, int value) Unsafe version oftransformOffset.
-