Package org.lwjgl.vulkan
Class VkAccelerationStructureBuildRangeInfoKHR
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAccelerationStructureBuildRangeInfoKHR
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkAccelerationStructureBuildRangeInfoKHR extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying build offsets and counts for acceleration structure builds.Description
The primitive count and primitive offset are interpreted differently depending on the
VkGeometryTypeKHRused:- 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,CmdBuildAccelerationStructuresKHRLayout
struct VkAccelerationStructureBuildRangeInfoKHR { uint32_tprimitiveCount(); uint32_tprimitiveOffset(); uint32_tfirstVertex(); uint32_ttransformOffset(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkAccelerationStructureBuildRangeInfoKHR.BufferAn array ofVkAccelerationStructureBuildRangeInfoKHRstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFIRSTVERTEX
PRIMITIVECOUNT
PRIMITIVEOFFSETThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTRANSFORMOFFSETThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkAccelerationStructureBuildRangeInfoKHR(java.nio.ByteBuffer container)Creates aVkAccelerationStructureBuildRangeInfoKHRinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkAccelerationStructureBuildRangeInfoKHRcalloc()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemCalloc.static VkAccelerationStructureBuildRangeInfoKHR.Buffercalloc(int capacity)Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemCalloc.static VkAccelerationStructureBuildRangeInfoKHR.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureBuildRangeInfoKHRcalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureBuildRangeInfoKHRcreate()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withBufferUtils.static VkAccelerationStructureBuildRangeInfoKHR.Buffercreate(int capacity)Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withBufferUtils.static VkAccelerationStructureBuildRangeInfoKHRcreate(long address)Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance for the specified memory address.static VkAccelerationStructureBuildRangeInfoKHR.Buffercreate(long address, int capacity)Create aVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance at the specified memory.static VkAccelerationStructureBuildRangeInfoKHRcreateSafe(long address)static VkAccelerationStructureBuildRangeInfoKHR.BuffercreateSafe(long address, int capacity)intfirstVertex()the index of the first vertex to build from for triangle geometry.VkAccelerationStructureBuildRangeInfoKHRfirstVertex(int value)Sets the specified value to thefirstVertex()field.static VkAccelerationStructureBuildRangeInfoKHRmalloc()Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemAlloc.static VkAccelerationStructureBuildRangeInfoKHR.Buffermalloc(int capacity)Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemAlloc.static VkAccelerationStructureBuildRangeInfoKHR.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.static VkAccelerationStructureBuildRangeInfoKHRmalloc(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.intprimitiveCount()defines the number of primitives for a corresponding acceleration structure geometry.VkAccelerationStructureBuildRangeInfoKHRprimitiveCount(int value)Sets the specified value to theprimitiveCount()field.intprimitiveOffset()defines an offset in bytes into the memory where primitive data is defined.VkAccelerationStructureBuildRangeInfoKHRprimitiveOffset(int value)Sets the specified value to theprimitiveOffset()field.VkAccelerationStructureBuildRangeInfoKHRset(int primitiveCount, int primitiveOffset, int firstVertex, int transformOffset)Initializes this struct with the specified values.VkAccelerationStructureBuildRangeInfoKHRset(VkAccelerationStructureBuildRangeInfoKHR src)Copies the specified struct data to this struct.intsizeof()inttransformOffset()defines an offset in bytes into the memory where a transform matrix is defined.VkAccelerationStructureBuildRangeInfoKHRtransformOffset(int value)Sets the specified value to thetransformOffset()field.
-
-
-
Constructor Detail
-
VkAccelerationStructureBuildRangeInfoKHR
public VkAccelerationStructureBuildRangeInfoKHR(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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
public VkAccelerationStructureBuildRangeInfoKHR primitiveCount(int value)
Sets the specified value to theprimitiveCount()field.
-
primitiveOffset
public VkAccelerationStructureBuildRangeInfoKHR primitiveOffset(int value)
Sets the specified value to theprimitiveOffset()field.
-
firstVertex
public VkAccelerationStructureBuildRangeInfoKHR firstVertex(int value)
Sets the specified value to thefirstVertex()field.
-
transformOffset
public VkAccelerationStructureBuildRangeInfoKHR transformOffset(int value)
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
public VkAccelerationStructureBuildRangeInfoKHR set(VkAccelerationStructureBuildRangeInfoKHR src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkAccelerationStructureBuildRangeInfoKHR malloc()
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkAccelerationStructureBuildRangeInfoKHR calloc()
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkAccelerationStructureBuildRangeInfoKHR create()
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated withBufferUtils.
-
create
public static VkAccelerationStructureBuildRangeInfoKHR create(long address)
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance for the specified memory address.
-
createSafe
@Nullable public static VkAccelerationStructureBuildRangeInfoKHR createSafe(long address)
-
malloc
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer malloc(int capacity)
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer calloc(int capacity)
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer create(int capacity)
Returns a newVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureBuildRangeInfoKHR.Buffer create(long address, int capacity)
Create aVkAccelerationStructureBuildRangeInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkAccelerationStructureBuildRangeInfoKHR.Buffer createSafe(long address, int capacity)
-
malloc
public static VkAccelerationStructureBuildRangeInfoKHR malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureBuildRangeInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureBuildRangeInfoKHR calloc(org.lwjgl.system.MemoryStack stack)
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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.
-
-