Functions | |
OptixResult | optixAccelComputeMemoryUsage (OptixDeviceContext context, const OptixAccelBuildOptions *accelOptions, const OptixBuildInput *buildInputs, unsigned int numBuildInputs, OptixAccelBufferSizes *bufferSizes) |
OptixResult | optixAccelBuild (OptixDeviceContext context, CUstream stream, const OptixAccelBuildOptions *accelOptions, const OptixBuildInput *buildInputs, unsigned int numBuildInputs, CUdeviceptr tempBuffer, size_t tempBufferSizeInBytes, CUdeviceptr outputBuffer, size_t outputBufferSizeInBytes, OptixTraversableHandle *outputHandle, const OptixAccelEmitDesc *emittedProperties, unsigned int numEmittedProperties) |
OptixResult | optixAccelGetRelocationInfo (OptixDeviceContext context, OptixTraversableHandle handle, OptixAccelRelocationInfo *info) |
OptixResult | optixAccelCheckRelocationCompatibility (OptixDeviceContext context, const OptixAccelRelocationInfo *info, int *compatible) |
OptixResult | optixAccelRelocate (OptixDeviceContext context, CUstream stream, const OptixAccelRelocationInfo *info, CUdeviceptr instanceTraversableHandles, size_t numInstanceTraversableHandles, CUdeviceptr targetAccel, size_t targetAccelSizeInBytes, OptixTraversableHandle *targetHandle) |
OptixResult | optixAccelCompact (OptixDeviceContext context, CUstream stream, OptixTraversableHandle inputHandle, CUdeviceptr outputBuffer, size_t outputBufferSizeInBytes, OptixTraversableHandle *outputHandle) |
OptixResult | optixConvertPointerToTraversableHandle (OptixDeviceContext onDevice, CUdeviceptr pointer, OptixTraversableType traversableType, OptixTraversableHandle *traversableHandle) |
OptixResult optixAccelBuild | ( | OptixDeviceContext | context, |
CUstream | stream, | ||
const OptixAccelBuildOptions * | accelOptions, | ||
const OptixBuildInput * | buildInputs, | ||
unsigned int | numBuildInputs, | ||
CUdeviceptr | tempBuffer, | ||
size_t | tempBufferSizeInBytes, | ||
CUdeviceptr | outputBuffer, | ||
size_t | outputBufferSizeInBytes, | ||
OptixTraversableHandle * | outputHandle, | ||
const OptixAccelEmitDesc * | emittedProperties, | ||
unsigned int | numEmittedProperties | ||
) |
[in] | context | |
[in] | stream | |
[in] | accelOptions | accel options |
[in] | buildInputs | an array of OptixBuildInput objects |
[in] | numBuildInputs | must be >= 1 for GAS, and == 1 for IAS |
[in] | tempBuffer | must be a multiple of OPTIX_ACCEL_BUFFER_BYTE_ALIGNMENT |
[in] | tempBufferSizeInBytes | |
[in] | outputBuffer | must be a multiple of OPTIX_ACCEL_BUFFER_BYTE_ALIGNMENT |
[in] | outputBufferSizeInBytes | |
[out] | outputHandle | |
[out] | emittedProperties | types of requested properties and output buffers |
[in] | numEmittedProperties | number of post-build properties to populate (may be zero) |
OptixResult optixAccelCheckRelocationCompatibility | ( | OptixDeviceContext | context, |
const OptixAccelRelocationInfo * | info, | ||
int * | compatible | ||
) |
Checks if an acceleration structure built using another OptixDeviceContext (that was used to fill in 'info') is compatible with the OptixDeviceContext specified in the 'context' parameter.
Any device is always compatible with itself.
[in] | context | |
[in] | info | |
[out] | compatible | If OPTIX_SUCCESS is returned 'compatible' will have the value of either:
|
OptixResult optixAccelCompact | ( | OptixDeviceContext | context, |
CUstream | stream, | ||
OptixTraversableHandle | inputHandle, | ||
CUdeviceptr | outputBuffer, | ||
size_t | outputBufferSizeInBytes, | ||
OptixTraversableHandle * | outputHandle | ||
) |
After building an acceleration structure, it can be copied in a compacted form to reduce memory. In order to be compacted, OPTIX_BUILD_FLAG_ALLOW_COMPACTION must be supplied in OptixAccelBuildOptions::buildFlags passed to optixAccelBuild.
'outputBuffer' is the pointer to where the compacted acceleration structure will be written. This pointer must be a multiple of OPTIX_ACCEL_BUFFER_BYTE_ALIGNMENT.
The size of the memory specified in 'outputBufferSizeInBytes' should be at least the value computed using the OPTIX_PROPERTY_TYPE_COMPACTED_SIZE that was reported during optixAccelBuild.
[in] | context | |
[in] | stream | |
[in] | inputHandle | |
[in] | outputBuffer | |
[in] | outputBufferSizeInBytes | |
[out] | outputHandle |
OptixResult optixAccelComputeMemoryUsage | ( | OptixDeviceContext | context, |
const OptixAccelBuildOptions * | accelOptions, | ||
const OptixBuildInput * | buildInputs, | ||
unsigned int | numBuildInputs, | ||
OptixAccelBufferSizes * | bufferSizes | ||
) |
[in] | context | |
[in] | accelOptions | options for the accel build |
[in] | buildInputs | an array of OptixBuildInput objects |
[in] | numBuildInputs | number of elements in buildInputs (must be at least 1) |
[out] | bufferSizes | fills in buffer sizes |
OptixResult optixAccelGetRelocationInfo | ( | OptixDeviceContext | context, |
OptixTraversableHandle | handle, | ||
OptixAccelRelocationInfo * | info | ||
) |
Obtain relocation information, stored in OptixAccelRelocationInfo, for a given context and acceleration structure's traversable handle.
The relocation information can be passed to optixAccelCheckRelocationCompatibility to determine if an acceleration structure, referenced by 'handle', can be relocated to a different device's memory space (see optixAccelCheckRelocationCompatibility).
When used with optixAccelRelocate, it provides data necessary for doing the relocation.
If the acceleration structure data associated with 'handle' is copied multiple times, the same OptixAccelRelocationInfo can also be used on all copies.
[in] | context | |
[in] | handle | |
[out] | info |
OptixResult optixAccelRelocate | ( | OptixDeviceContext | context, |
CUstream | stream, | ||
const OptixAccelRelocationInfo * | info, | ||
CUdeviceptr | instanceTraversableHandles, | ||
size_t | numInstanceTraversableHandles, | ||
CUdeviceptr | targetAccel, | ||
size_t | targetAccelSizeInBytes, | ||
OptixTraversableHandle * | targetHandle | ||
) |
optixAccelRelocate is called to update the acceleration structure after it has been relocated. Relocation is necessary when the acceleration structure's location in device memory has changed. optixAccelRelocate does not copy the memory. This function only operates on the relocated memory who's new location is specified by 'targetAccel'. optixAccelRelocate also returns the new OptixTraversableHandle associated with 'targetAccel'. The original memory (source) is not required to be valid, only the OptixAccelRelocationInfo.
Before copying the data and calling optixAccelRelocate, optixAccelCheckRelocationCompatibility should be called to ensure the copy will be compatible with the destination device context.
The memory pointed to by 'targetAccel' should be allocated with the same size as the source acceleration. Similar to the 'outputBuffer' used in optixAccelBuild, this pointer must be a multiple of OPTIX_ACCEL_BUFFER_BYTE_ALIGNMENT.
The memory in 'targetAccel' must be allocated as long as the accel is in use.
When relocating an accel that contains instances, 'instanceTraversableHandles' and 'numInstanceTraversableHandles' should be supplied. These are the traversable handles of the instances. These can be used when also relocating the instances. No updates to the bounds are performed. Use optixAccelBuild to update the bounds. 'instanceTraversableHandles' and 'numInstanceTraversableHandles' may be zero when relocating bottom level accel (i.e. an accel with no instances).
[in] | context | |
[in] | stream | |
[in] | info | |
[in] | instanceTraversableHandles | |
[in] | numInstanceTraversableHandles | |
[in] | targetAccel | |
[in] | targetAccelSizeInBytes | |
[out] | targetHandle |
OptixResult optixConvertPointerToTraversableHandle | ( | OptixDeviceContext | onDevice, |
CUdeviceptr | pointer, | ||
OptixTraversableType | traversableType, | ||
OptixTraversableHandle * | traversableHandle | ||
) |
[in] | onDevice | |
[in] | pointer | pointer to traversable allocated in OptixDeviceContext. This pointer must be a multiple of OPTIX_TRANSFORM_BYTE_ALIGNMENT |
[in] | traversableType | Type of OptixTraversableHandle to create |
[out] | traversableHandle | traversable handle. traversableHandle must be in host memory |