Class VkAccelerationStructureCreateInfoKHR
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAccelerationStructureCreateInfoKHR
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkAccelerationStructureCreateInfoKHR extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying the parameters of a newly created acceleration structure object.Description
If
deviceAddressis zero, no specific address is requested.If
deviceAddressis not zero,deviceAddressmust be an address retrieved from an identically created acceleration structure on the same implementation. The acceleration structure must also be placed on an identically createdbufferand at the sameoffset.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_KHRerrors.Note
The expected usage for this is that a trace capture/replay tool will add the
BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BITflag to all buffers that useBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, and will addBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BITto all buffers used as storage for an acceleration structure wheredeviceAddressis not zero. This also means that the tool will need to addMEMORY_ALLOCATE_DEVICE_ADDRESS_BITto 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
VkAccelerationStructureTypeKHRother thanACCELERATION_STRUCTURE_TYPE_GENERIC_KHR.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,CmdWriteAccelerationStructuresPropertiesKHRorWriteAccelerationStructuresPropertiesKHRcan 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_NVit must includeACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NVinflagsand includeVkAccelerationStructureMotionInfoNVas an extension structure inpNextwith the number of instances as metadata for the object.Valid Usage
- If
deviceAddressis not zero,createFlagsmust includeACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR - If
createFlagsincludesACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR,VkPhysicalDeviceAccelerationStructureFeaturesKHR::accelerationStructureCaptureReplaymust beTRUE buffermust have been created with ausagevalue containingBUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHRbuffermust not have been created withBUFFER_CREATE_SPARSE_RESIDENCY_BIT- The sum of
offsetandsizemust be less than the size ofbuffer offsetmust be a multiple of 256 bytes- If
ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NVis set inflagsandtypeisACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, one member of thepNextchain must be a pointer to a valid instance ofVkAccelerationStructureMotionInfoNV - If any geometry includes
VkAccelerationStructureGeometryMotionTrianglesDataNVthenflagsmust containACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHRpNextmust beNULLor a pointer to a valid instance ofVkAccelerationStructureMotionInfoNV- The
sTypevalue of each struct in thepNextchain must be unique createFlagsmust be a valid combination ofVkAccelerationStructureCreateFlagBitsKHRvaluesbuffermust be a validVkBufferhandletypemust be a validVkAccelerationStructureTypeKHRvalue
See Also
CreateAccelerationStructureKHRLayout
struct VkAccelerationStructureCreateInfoKHR { VkStructureTypesType(); void const *pNext(); VkAccelerationStructureCreateFlagsKHRcreateFlags(); VkBufferbuffer(); VkDeviceSizeoffset(); VkDeviceSizesize(); VkAccelerationStructureTypeKHRtype(); VkDeviceAddressdeviceAddress(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkAccelerationStructureCreateInfoKHR.BufferAn array ofVkAccelerationStructureCreateInfoKHRstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUFFER
CREATEFLAGS
DEVICEADDRESS
OFFSET
PNEXT
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTYPE
TYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkAccelerationStructureCreateInfoKHR(java.nio.ByteBuffer container)Creates aVkAccelerationStructureCreateInfoKHRinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longbuffer()the buffer on which the acceleration structure will be stored.VkAccelerationStructureCreateInfoKHRbuffer(long value)Sets the specified value to thebuffer()field.static VkAccelerationStructureCreateInfoKHRcalloc()Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withmemCalloc.static VkAccelerationStructureCreateInfoKHR.Buffercalloc(int capacity)Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withmemCalloc.static VkAccelerationStructureCreateInfoKHR.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureCreateInfoKHRcalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAccelerationStructureCreateInfoKHRcreate()Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withBufferUtils.static VkAccelerationStructureCreateInfoKHR.Buffercreate(int capacity)Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withBufferUtils.static VkAccelerationStructureCreateInfoKHRcreate(long address)Returns a newVkAccelerationStructureCreateInfoKHRinstance for the specified memory address.static VkAccelerationStructureCreateInfoKHR.Buffercreate(long address, int capacity)Create aVkAccelerationStructureCreateInfoKHR.Bufferinstance at the specified memory.intcreateFlags()a bitmask ofVkAccelerationStructureCreateFlagBitsKHRspecifying additional creation parameters of the acceleration structure.VkAccelerationStructureCreateInfoKHRcreateFlags(int value)Sets the specified value to thecreateFlags()field.static VkAccelerationStructureCreateInfoKHRcreateSafe(long address)static VkAccelerationStructureCreateInfoKHR.BuffercreateSafe(long address, int capacity)longdeviceAddress()the device address requested for the acceleration structure if theaccelerationStructureCaptureReplayfeature is being used.VkAccelerationStructureCreateInfoKHRdeviceAddress(long value)Sets the specified value to thedeviceAddress()field.static VkAccelerationStructureCreateInfoKHRmalloc()Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withmemAlloc.static VkAccelerationStructureCreateInfoKHR.Buffermalloc(int capacity)Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withmemAlloc.static VkAccelerationStructureCreateInfoKHR.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.static VkAccelerationStructureCreateInfoKHRmalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated on the specifiedMemoryStack.static longnbuffer(long struct)Unsafe version ofbuffer().static voidnbuffer(long struct, long value)Unsafe version ofbuffer.static intncreateFlags(long struct)Unsafe version ofcreateFlags().static voidncreateFlags(long struct, int value)Unsafe version ofcreateFlags.static longndeviceAddress(long struct)Unsafe version ofdeviceAddress().static voidndeviceAddress(long struct, long value)Unsafe version ofdeviceAddress.static longnoffset(long struct)Unsafe version ofoffset().static voidnoffset(long struct, long value)Unsafe version ofoffset.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static longnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, long value)Unsafe version ofsize.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.longoffset()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.VkAccelerationStructureCreateInfoKHRoffset(long value)Sets the specified value to theoffset()field.longpNext()NULLor a pointer to a structure extending this structure.VkAccelerationStructureCreateInfoKHRpNext(long value)Sets the specified value to thepNext()field.VkAccelerationStructureCreateInfoKHRpNext(VkAccelerationStructureMotionInfoNV value)Prepends the specifiedVkAccelerationStructureMotionInfoNVvalue to thepNextchain.VkAccelerationStructureCreateInfoKHRset(int sType, long pNext, int createFlags, long buffer, long offset, long size, int type, long deviceAddress)Initializes this struct with the specified values.VkAccelerationStructureCreateInfoKHRset(VkAccelerationStructureCreateInfoKHR src)Copies the specified struct data to this struct.longsize()the size required for the acceleration structure.VkAccelerationStructureCreateInfoKHRsize(long value)Sets the specified value to thesize()field.intsizeof()intsType()the type of this structure.VkAccelerationStructureCreateInfoKHRsType(int value)Sets the specified value to thesType()field.VkAccelerationStructureCreateInfoKHRsType$Default()Sets theSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHRvalue to thesType()field.inttype()aVkAccelerationStructureTypeKHRvalue specifying the type of acceleration structure that will be created.VkAccelerationStructureCreateInfoKHRtype(int value)Sets the specified value to thetype()field.
-
-
-
Constructor Detail
-
VkAccelerationStructureCreateInfoKHR
public VkAccelerationStructureCreateInfoKHR(java.nio.ByteBuffer container)
Creates aVkAccelerationStructureCreateInfoKHRinstance 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
-
sType
public int sType()
the type of this structure.
-
pNext
public long pNext()
NULLor a pointer to a structure extending this structure.
-
createFlags
public int createFlags()
a bitmask ofVkAccelerationStructureCreateFlagBitsKHRspecifying additional creation parameters of the acceleration structure.
-
buffer
public long buffer()
the buffer on which the acceleration structure will be stored.
-
offset
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.
-
size
public long size()
the size required for the acceleration structure.
-
type
public int type()
aVkAccelerationStructureTypeKHRvalue specifying the type of acceleration structure that will be created.
-
deviceAddress
public long deviceAddress()
the device address requested for the acceleration structure if theaccelerationStructureCaptureReplayfeature is being used.
-
sType
public VkAccelerationStructureCreateInfoKHR sType(int value)
Sets the specified value to thesType()field.
-
sType$Default
public VkAccelerationStructureCreateInfoKHR sType$Default()
Sets theSTRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHRvalue to thesType()field.
-
pNext
public VkAccelerationStructureCreateInfoKHR pNext(long value)
Sets the specified value to thepNext()field.
-
pNext
public VkAccelerationStructureCreateInfoKHR pNext(VkAccelerationStructureMotionInfoNV value)
Prepends the specifiedVkAccelerationStructureMotionInfoNVvalue to thepNextchain.
-
createFlags
public VkAccelerationStructureCreateInfoKHR createFlags(int value)
Sets the specified value to thecreateFlags()field.
-
buffer
public VkAccelerationStructureCreateInfoKHR buffer(long value)
Sets the specified value to thebuffer()field.
-
offset
public VkAccelerationStructureCreateInfoKHR offset(long value)
Sets the specified value to theoffset()field.
-
size
public VkAccelerationStructureCreateInfoKHR size(long value)
Sets the specified value to thesize()field.
-
type
public VkAccelerationStructureCreateInfoKHR type(int value)
Sets the specified value to thetype()field.
-
deviceAddress
public VkAccelerationStructureCreateInfoKHR deviceAddress(long value)
Sets the specified value to thedeviceAddress()field.
-
set
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.
-
set
public VkAccelerationStructureCreateInfoKHR set(VkAccelerationStructureCreateInfoKHR src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkAccelerationStructureCreateInfoKHR malloc()
Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkAccelerationStructureCreateInfoKHR calloc()
Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkAccelerationStructureCreateInfoKHR create()
Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated withBufferUtils.
-
create
public static VkAccelerationStructureCreateInfoKHR create(long address)
Returns a newVkAccelerationStructureCreateInfoKHRinstance for the specified memory address.
-
createSafe
@Nullable public static VkAccelerationStructureCreateInfoKHR createSafe(long address)
-
malloc
public static VkAccelerationStructureCreateInfoKHR.Buffer malloc(int capacity)
Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkAccelerationStructureCreateInfoKHR.Buffer calloc(int capacity)
Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureCreateInfoKHR.Buffer create(int capacity)
Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkAccelerationStructureCreateInfoKHR.Buffer create(long address, int capacity)
Create aVkAccelerationStructureCreateInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkAccelerationStructureCreateInfoKHR.Buffer createSafe(long address, int capacity)
-
malloc
public static VkAccelerationStructureCreateInfoKHR malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkAccelerationStructureCreateInfoKHR calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureCreateInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkAccelerationStructureCreateInfoKHR.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VkAccelerationStructureCreateInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAccelerationStructureCreateInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType().
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext().
-
ncreateFlags
public static int ncreateFlags(long struct)
Unsafe version ofcreateFlags().
-
nbuffer
public static long nbuffer(long struct)
Unsafe version ofbuffer().
-
noffset
public static long noffset(long struct)
Unsafe version ofoffset().
-
nsize
public static long nsize(long struct)
Unsafe version ofsize().
-
ntype
public static int ntype(long struct)
Unsafe version oftype().
-
ndeviceAddress
public static long ndeviceAddress(long struct)
Unsafe version ofdeviceAddress().
-
nsType
public static void nsType(long struct, int value)Unsafe version ofsType.
-
npNext
public static void npNext(long struct, long value)Unsafe version ofpNext.
-
ncreateFlags
public static void ncreateFlags(long struct, int value)Unsafe version ofcreateFlags.
-
nbuffer
public static void nbuffer(long struct, long value)Unsafe version ofbuffer.
-
noffset
public static void noffset(long struct, long value)Unsafe version ofoffset.
-
nsize
public static void nsize(long struct, long value)Unsafe version ofsize.
-
ntype
public static void ntype(long struct, int value)Unsafe version oftype.
-
ndeviceAddress
public static void ndeviceAddress(long struct, long value)Unsafe version ofdeviceAddress.
-
-