Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkAccelerationStructureCreateInfoKHR

extends Struct<VkAccelerationStructureCreateInfoKHR>
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 parameters of a newly created acceleration structure object.
Description

If deviceAddress is zero, no specific address is requested.

If deviceAddress is not zero, deviceAddress must be an address retrieved from an identically created acceleration structure on the same implementation. The acceleration structure must also be placed on an identically created buffer and at the same offset.

Applications should avoid creating acceleration structures with application-provided addresses and implementation-provided addresses in the same process, to reduce the likelihood of ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR errors.

Note

The expected usage for this is that a trace capture/replay tool will add the BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT flag to all buffers that use BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, and will add BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT to all buffers used as storage for an acceleration structure where deviceAddress is not zero. This also means that the tool will need to add MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT to memory allocations to allow the flag to be set where the application may not have otherwise required it. During capture the tool will save the queried opaque device addresses in the trace. During replay, the buffers will be created specifying the original address so any address values stored in the trace data will remain valid.

Implementations are expected to separate such buffers in the GPU address space so normal allocations will avoid using these addresses. Apps/tools should avoid mixing app-provided and implementation-provided addresses for buffers created with BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, to avoid address space allocation conflicts.

Applications should create an acceleration structure with a specific VkAccelerationStructureTypeKHR other than ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR.

Note

ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR is intended to be used by API translation layers. This can be used at acceleration structure creation time in cases where the actual acceleration structure type (top or bottom) is not yet known. The actual acceleration structure type must be specified as ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR or ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR when the build is performed.

If the acceleration structure will be the target of a build operation, the required size for an acceleration structure can be queried with GetAccelerationStructureBuildSizesKHR. If the acceleration structure is going to be the target of a compacting copy, CmdWriteAccelerationStructuresPropertiesKHR or WriteAccelerationStructuresPropertiesKHR can be used to obtain the compacted size required.

If the acceleration structure will be the target of a build operation with BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV it must include ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV in createFlags and include VkAccelerationStructureMotionInfoNV as an extension structure in pNext with the number of instances as metadata for the object.

Valid Usage
Valid Usage (Implicit)
See Also

CreateAccelerationStructureKHR

Layout


struct VkAccelerationStructureCreateInfoKHR {
    VkStructureType sType;
    void const * pNext;
    VkAccelerationStructureCreateFlagsKHR createFlags;
    VkBuffer buffer;
    VkDeviceSize offset;
    VkDeviceSize size;
    VkAccelerationStructureTypeKHR type;
    VkDeviceAddress deviceAddress;
}

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
BUFFER

The struct member offsets.

public static final int
CREATEFLAGS

The struct member offsets.

public static final int
DEVICEADDRESS

The struct member offsets.

public static final int
OFFSET

The struct member offsets.

public static final int
PNEXT

The struct member offsets.

public static final int
SIZE

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

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
VkAccelerationStructureCreateInfoKHR(ByteBuffer container)

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

Method Summary

Modifier and TypeMethod and Description
public long
buffer()

the buffer on which the acceleration structure will be stored.

public VkAccelerationStructureCreateInfoKHR
buffer(long value)

Sets the specified value to the buffer field.

public static VkAccelerationStructureCreateInfoKHR
calloc()

Returns a new VkAccelerationStructureCreateInfoKHR instance allocated with memCalloc.

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

Returns a new VkAccelerationStructureCreateInfoKHR.Buffer instance allocated with memCalloc.

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

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

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

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

protected VkAccelerationStructureCreateInfoKHR
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 VkAccelerationStructureCreateInfoKHR
create()

Returns a new VkAccelerationStructureCreateInfoKHR instance allocated with BufferUtils.

public static VkAccelerationStructureCreateInfoKHR
create(long address)

Returns a new VkAccelerationStructureCreateInfoKHR instance for the specified memory address.

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

Returns a new VkAccelerationStructureCreateInfoKHR.Buffer instance allocated with BufferUtils.

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

Create a VkAccelerationStructureCreateInfoKHR.Buffer instance at the specified memory.

public int
createFlags()

a bitmask of VkAccelerationStructureCreateFlagBitsKHR specifying additional creation parameters of the acceleration structure.

public VkAccelerationStructureCreateInfoKHR
createFlags(int value)

Sets the specified value to the createFlags field.

public static VkAccelerationStructureCreateInfoKHR
createSafe(long address)

Like create, but returns null if address is NULL.

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

Like create, but returns null if address is NULL.

public long
deviceAddress()

the device address requested for the acceleration structure if the accelerationStructureCaptureReplay feature is being used.

public VkAccelerationStructureCreateInfoKHR
deviceAddress(long value)

Sets the specified value to the deviceAddress field.

public static VkAccelerationStructureCreateInfoKHR
malloc()

Returns a new VkAccelerationStructureCreateInfoKHR instance allocated with memAlloc.

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

Returns a new VkAccelerationStructureCreateInfoKHR.Buffer instance allocated with memAlloc.

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

Returns a new VkAccelerationStructureCreateInfoKHR instance allocated on the specified MemoryStack.

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

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

public static long
nbuffer(long struct)

Unsafe version of buffer.

public static void
nbuffer(long struct, long value)

Unsafe version of buffer.

public static int
ncreateFlags(long struct)

Unsafe version of createFlags.

public static void
ncreateFlags(long struct, int value)

Unsafe version of createFlags.

public static long
ndeviceAddress(long struct)

Unsafe version of deviceAddress.

public static void
ndeviceAddress(long struct, long value)

Unsafe version of deviceAddress.

public static long
noffset(long struct)

Unsafe version of offset.

public static void
noffset(long struct, long value)

Unsafe version of offset.

public static long
npNext(long struct)

Unsafe version of pNext.

public static void
npNext(long struct, long value)

Unsafe version of pNext.

public static long
nsize(long struct)

Unsafe version of size.

public static void
nsize(long struct, long value)

Unsafe version of size.

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 long
offset()

an offset in bytes from the base address of the buffer at which the acceleration structure will be stored, and must be a multiple of 256.

public VkAccelerationStructureCreateInfoKHR
offset(long value)

Sets the specified value to the offset field.

public long
pNext()

NULL or a pointer to a structure extending this structure.

public VkAccelerationStructureCreateInfoKHR
pNext(long value)

Sets the specified value to the pNext field.

public VkAccelerationStructureCreateInfoKHR
pNext(VkAccelerationStructureMotionInfoNV value)

Prepends the specified VkAccelerationStructureMotionInfoNV value to the pNext chain.

public VkAccelerationStructureCreateInfoKHR
public VkAccelerationStructureCreateInfoKHR
set(int sType, long pNext, int createFlags, long buffer, long offset, long size, int type, long deviceAddress)

Initializes this struct with the specified values.

public VkAccelerationStructureCreateInfoKHR

Returns:

this struct
set
(VkAccelerationStructureCreateInfoKHR
the source struct
src
)

Copies the specified struct data to this struct.

public long
size()

the size required for the acceleration structure.

public VkAccelerationStructureCreateInfoKHR
size(long value)

Sets the specified value to the size field.

public int
sizeof()

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

Returns sizeof(struct).
public int
sType()

a VkStructureType value identifying this structure.

public VkAccelerationStructureCreateInfoKHR
sType(int value)

Sets the specified value to the sType field.

public VkAccelerationStructureCreateInfoKHR
public int
type()

a VkAccelerationStructureTypeKHR value specifying the type of acceleration structure that will be created.

public VkAccelerationStructureCreateInfoKHR
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