Package org.lwjgl.vulkan
Class VkAccelerationStructureMatrixMotionInstanceNV
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAccelerationStructureMatrixMotionInstanceNV
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkAccelerationStructureMatrixMotionInstanceNV extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying a single acceleration structure matrix motion instance for building into an acceleration structure geometry.Description
The C language specification does not define the ordering of bit-fields, but in practice, this struct produces the correct layout with existing compilers. The intended bit pattern is for the following:
instanceCustomIndexandmaskoccupy the same memory as if a singleuint32_twas specified in their placeinstanceCustomIndexoccupies the 24 least significant bits of that memorymaskoccupies the 8 most significant bits of that memory
instanceShaderBindingTableRecordOffsetandflagsoccupy the same memory as if a singleuint32_twas specified in their placeinstanceShaderBindingTableRecordOffsetoccupies the 24 least significant bits of that memoryflagsoccupies the 8 most significant bits of that memory
If a compiler produces code that diverges from that pattern, applications must employ another method to set values according to the correct bit pattern.
The transform for a matrix motion instance at a point in time is derived by component-wise linear interpolation of the two transforms. That is, for a
timein [0,1] the resulting transform istransformT0 × (1 - time) + transformT1 × time
Valid Usage (Implicit)
flagsmust be a valid combination ofVkGeometryInstanceFlagBitsKHRvalues
See Also
VkAccelerationStructureMotionInstanceDataNV,VkTransformMatrixKHRLayout
struct VkAccelerationStructureMatrixMotionInstanceNV {VkTransformMatrixKHRtransformT0();VkTransformMatrixKHRtransformT1(); uint32_tinstanceCustomIndex(): 24; uint32_tmask(): 8; uint32_tinstanceShaderBindingTableRecordOffset(): 24; VkGeometryInstanceFlagsKHRflags(): 8; uint64_taccelerationStructureReference(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkAccelerationStructureMatrixMotionInstanceNV.BufferAn array ofVkAccelerationStructureMatrixMotionInstanceNVstructs.
-
Field Summary
Fields Modifier and Type Field Description static intACCELERATIONSTRUCTUREREFERENCEThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intBITFIELD0
BITFIELD1The struct member offsets.static intSIZEOFThe struct size in bytes.static intTRANSFORMT0
TRANSFORMT1The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkAccelerationStructureMatrixMotionInstanceNV(java.nio.ByteBuffer container)Creates aVkAccelerationStructureMatrixMotionInstanceNVinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longaccelerationStructureReference()either: a device address containing the value obtained fromGetAccelerationStructureDeviceAddressKHRorGetAccelerationStructureHandleNV(used by device operations which reference acceleration structures) or, aVkAccelerationStructureKHRobject (used by host operations which reference acceleration structures).VkAccelerationStructureMatrixMotionInstanceNVaccelerationStructureReference(long value)Sets the specified value to theaccelerationStructureReference()field.static VkAccelerationStructureMatrixMotionInstanceNVcalloc()Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withmemCalloc.static VkAccelerationStructureMatrixMotionInstanceNV.Buffercalloc(int capacity)Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withmemCalloc.static VkAccelerationStructureMatrixMotionInstanceNV.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureMatrixMotionInstanceNVcalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureMatrixMotionInstanceNVcreate()Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withBufferUtils.static VkAccelerationStructureMatrixMotionInstanceNV.Buffercreate(int capacity)Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withBufferUtils.static VkAccelerationStructureMatrixMotionInstanceNVcreate(long address)Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance for the specified memory address.static VkAccelerationStructureMatrixMotionInstanceNV.Buffercreate(long address, int capacity)Create aVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance at the specified memory.static VkAccelerationStructureMatrixMotionInstanceNVcreateSafe(long address)static VkAccelerationStructureMatrixMotionInstanceNV.BuffercreateSafe(long address, int capacity)intflags()an 8-bit mask ofVkGeometryInstanceFlagBitsKHRvalues to apply to this instance.VkAccelerationStructureMatrixMotionInstanceNVflags(int value)Sets the specified value to theflags()field.intinstanceCustomIndex()a 24-bit user-specified index value accessible to ray shaders in theInstanceCustomIndexKHRbuilt-in.VkAccelerationStructureMatrixMotionInstanceNVinstanceCustomIndex(int value)Sets the specified value to theinstanceCustomIndex()field.intinstanceShaderBindingTableRecordOffset()a 24-bit offset used in calculating the hit shader binding table index.VkAccelerationStructureMatrixMotionInstanceNVinstanceShaderBindingTableRecordOffset(int value)Sets the specified value to theinstanceShaderBindingTableRecordOffset()field.static VkAccelerationStructureMatrixMotionInstanceNVmalloc()Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withmemAlloc.static VkAccelerationStructureMatrixMotionInstanceNV.Buffermalloc(int capacity)Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withmemAlloc.static VkAccelerationStructureMatrixMotionInstanceNV.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated on the specifiedMemoryStack.static VkAccelerationStructureMatrixMotionInstanceNVmalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated on the specifiedMemoryStack.intmask()an 8-bit visibility mask for the geometry.VkAccelerationStructureMatrixMotionInstanceNVmask(int value)Sets the specified value to themask()field.static longnaccelerationStructureReference(long struct)Unsafe version ofaccelerationStructureReference().static voidnaccelerationStructureReference(long struct, long value)Unsafe version ofaccelerationStructureReference.static intnbitfield0(long struct)static voidnbitfield0(long struct, int value)static intnbitfield1(long struct)static voidnbitfield1(long struct, int value)static intnflags(long struct)Unsafe version offlags().static voidnflags(long struct, int value)Unsafe version offlags.static intninstanceCustomIndex(long struct)Unsafe version ofinstanceCustomIndex().static voidninstanceCustomIndex(long struct, int value)Unsafe version ofinstanceCustomIndex.static intninstanceShaderBindingTableRecordOffset(long struct)Unsafe version ofinstanceShaderBindingTableRecordOffset().static voidninstanceShaderBindingTableRecordOffset(long struct, int value)Unsafe version ofinstanceShaderBindingTableRecordOffset.static intnmask(long struct)Unsafe version ofmask().static voidnmask(long struct, int value)Unsafe version ofmask.static VkTransformMatrixKHRntransformT0(long struct)Unsafe version oftransformT0().static voidntransformT0(long struct, VkTransformMatrixKHR value)Unsafe version oftransformT0.static VkTransformMatrixKHRntransformT1(long struct)Unsafe version oftransformT1().static voidntransformT1(long struct, VkTransformMatrixKHR value)Unsafe version oftransformT1.VkAccelerationStructureMatrixMotionInstanceNVset(VkAccelerationStructureMatrixMotionInstanceNV src)Copies the specified struct data to this struct.VkAccelerationStructureMatrixMotionInstanceNVset(VkTransformMatrixKHR transformT0, VkTransformMatrixKHR transformT1, int instanceCustomIndex, int mask, int instanceShaderBindingTableRecordOffset, int flags, long accelerationStructureReference)Initializes this struct with the specified values.intsizeof()VkTransformMatrixKHRtransformT0()aVkTransformMatrixKHRstructure describing a transformation to be applied to the acceleration structure at time 0.VkAccelerationStructureMatrixMotionInstanceNVtransformT0(java.util.function.Consumer<VkTransformMatrixKHR> consumer)Passes thetransformT0()field to the specifiedConsumer.VkAccelerationStructureMatrixMotionInstanceNVtransformT0(VkTransformMatrixKHR value)Copies the specifiedVkTransformMatrixKHRto thetransformT0()field.VkTransformMatrixKHRtransformT1()aVkTransformMatrixKHRstructure describing a transformation to be applied to the acceleration structure at time 1.VkAccelerationStructureMatrixMotionInstanceNVtransformT1(java.util.function.Consumer<VkTransformMatrixKHR> consumer)Passes thetransformT1()field to the specifiedConsumer.VkAccelerationStructureMatrixMotionInstanceNVtransformT1(VkTransformMatrixKHR value)Copies the specifiedVkTransformMatrixKHRto thetransformT1()field.
-
-
-
Constructor Detail
-
VkAccelerationStructureMatrixMotionInstanceNV
public VkAccelerationStructureMatrixMotionInstanceNV(java.nio.ByteBuffer container)
Creates aVkAccelerationStructureMatrixMotionInstanceNVinstance 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
-
transformT0
public VkTransformMatrixKHR transformT0()
aVkTransformMatrixKHRstructure describing a transformation to be applied to the acceleration structure at time 0.
-
transformT1
public VkTransformMatrixKHR transformT1()
aVkTransformMatrixKHRstructure describing a transformation to be applied to the acceleration structure at time 1.
-
instanceCustomIndex
public int instanceCustomIndex()
a 24-bit user-specified index value accessible to ray shaders in theInstanceCustomIndexKHRbuilt-in.
-
mask
public int mask()
an 8-bit visibility mask for the geometry. The instance may only be hit ifCull Mask & instance.mask != 0
-
instanceShaderBindingTableRecordOffset
public int instanceShaderBindingTableRecordOffset()
a 24-bit offset used in calculating the hit shader binding table index.
-
flags
public int flags()
an 8-bit mask ofVkGeometryInstanceFlagBitsKHRvalues to apply to this instance.
-
accelerationStructureReference
public long accelerationStructureReference()
either:- a device address containing the value obtained from
GetAccelerationStructureDeviceAddressKHRorGetAccelerationStructureHandleNV(used by device operations which reference acceleration structures) or, - a
VkAccelerationStructureKHRobject (used by host operations which reference acceleration structures).
- a device address containing the value obtained from
-
transformT0
public VkAccelerationStructureMatrixMotionInstanceNV transformT0(VkTransformMatrixKHR value)
Copies the specifiedVkTransformMatrixKHRto thetransformT0()field.
-
transformT0
public VkAccelerationStructureMatrixMotionInstanceNV transformT0(java.util.function.Consumer<VkTransformMatrixKHR> consumer)
Passes thetransformT0()field to the specifiedConsumer.
-
transformT1
public VkAccelerationStructureMatrixMotionInstanceNV transformT1(VkTransformMatrixKHR value)
Copies the specifiedVkTransformMatrixKHRto thetransformT1()field.
-
transformT1
public VkAccelerationStructureMatrixMotionInstanceNV transformT1(java.util.function.Consumer<VkTransformMatrixKHR> consumer)
Passes thetransformT1()field to the specifiedConsumer.
-
instanceCustomIndex
public VkAccelerationStructureMatrixMotionInstanceNV instanceCustomIndex(int value)
Sets the specified value to theinstanceCustomIndex()field.
-
mask
public VkAccelerationStructureMatrixMotionInstanceNV mask(int value)
Sets the specified value to themask()field.
-
instanceShaderBindingTableRecordOffset
public VkAccelerationStructureMatrixMotionInstanceNV instanceShaderBindingTableRecordOffset(int value)
Sets the specified value to theinstanceShaderBindingTableRecordOffset()field.
-
flags
public VkAccelerationStructureMatrixMotionInstanceNV flags(int value)
Sets the specified value to theflags()field.
-
accelerationStructureReference
public VkAccelerationStructureMatrixMotionInstanceNV accelerationStructureReference(long value)
Sets the specified value to theaccelerationStructureReference()field.
-
set
public VkAccelerationStructureMatrixMotionInstanceNV set(VkTransformMatrixKHR transformT0, VkTransformMatrixKHR transformT1, int instanceCustomIndex, int mask, int instanceShaderBindingTableRecordOffset, int flags, long accelerationStructureReference)
Initializes this struct with the specified values.
-
set
public VkAccelerationStructureMatrixMotionInstanceNV set(VkAccelerationStructureMatrixMotionInstanceNV src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkAccelerationStructureMatrixMotionInstanceNV malloc()
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkAccelerationStructureMatrixMotionInstanceNV calloc()
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkAccelerationStructureMatrixMotionInstanceNV create()
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated withBufferUtils.
-
create
public static VkAccelerationStructureMatrixMotionInstanceNV create(long address)
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance for the specified memory address.
-
createSafe
@Nullable public static VkAccelerationStructureMatrixMotionInstanceNV createSafe(long address)
-
malloc
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer malloc(int capacity)
Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer calloc(int capacity)
Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer create(int capacity)
Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer create(long address, int capacity)
Create aVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer createSafe(long address, int capacity)
-
malloc
public static VkAccelerationStructureMatrixMotionInstanceNV malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureMatrixMotionInstanceNV calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureMatrixMotionInstanceNVinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VkAccelerationStructureMatrixMotionInstanceNV.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureMatrixMotionInstanceNV.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ntransformT0
public static VkTransformMatrixKHR ntransformT0(long struct)
Unsafe version oftransformT0().
-
ntransformT1
public static VkTransformMatrixKHR ntransformT1(long struct)
Unsafe version oftransformT1().
-
nbitfield0
public static int nbitfield0(long struct)
-
ninstanceCustomIndex
public static int ninstanceCustomIndex(long struct)
Unsafe version ofinstanceCustomIndex().
-
nmask
public static int nmask(long struct)
Unsafe version ofmask().
-
nbitfield1
public static int nbitfield1(long struct)
-
ninstanceShaderBindingTableRecordOffset
public static int ninstanceShaderBindingTableRecordOffset(long struct)
Unsafe version ofinstanceShaderBindingTableRecordOffset().
-
nflags
public static int nflags(long struct)
Unsafe version offlags().
-
naccelerationStructureReference
public static long naccelerationStructureReference(long struct)
Unsafe version ofaccelerationStructureReference().
-
ntransformT0
public static void ntransformT0(long struct, VkTransformMatrixKHR value)Unsafe version oftransformT0.
-
ntransformT1
public static void ntransformT1(long struct, VkTransformMatrixKHR value)Unsafe version oftransformT1.
-
nbitfield0
public static void nbitfield0(long struct, int value)
-
ninstanceCustomIndex
public static void ninstanceCustomIndex(long struct, int value)Unsafe version ofinstanceCustomIndex.
-
nmask
public static void nmask(long struct, int value)Unsafe version ofmask.
-
nbitfield1
public static void nbitfield1(long struct, int value)
-
ninstanceShaderBindingTableRecordOffset
public static void ninstanceShaderBindingTableRecordOffset(long struct, int value)Unsafe version ofinstanceShaderBindingTableRecordOffset.
-
nflags
public static void nflags(long struct, int value)Unsafe version offlags.
-
naccelerationStructureReference
public static void naccelerationStructureReference(long struct, long value)Unsafe version ofaccelerationStructureReference.
-
-