NVIDIA OptiX 7.7 nvidia_logo_transpbg.gif Up
Utilities

Classes

struct  OptixUtilDenoiserImageTile
 

Functions

OptixResult optixUtilGetPixelStride (const OptixImage2D &image, unsigned int &pixelStrideInBytes)
 
OptixResult optixUtilDenoiserSplitImage (const OptixImage2D &input, const OptixImage2D &output, unsigned int overlapWindowSizeInPixels, unsigned int tileWidth, unsigned int tileHeight, std::vector< OptixUtilDenoiserImageTile > &tiles)
 
OptixResult optixUtilDenoiserInvokeTiled (OptixDenoiser denoiser, CUstream stream, const OptixDenoiserParams *params, CUdeviceptr denoiserState, size_t denoiserStateSizeInBytes, const OptixDenoiserGuideLayer *guideLayer, const OptixDenoiserLayer *layers, unsigned int numLayers, CUdeviceptr scratch, size_t scratchSizeInBytes, unsigned int overlapWindowSizeInPixels, unsigned int tileWidth, unsigned int tileHeight)
 
OptixResult optixUtilAccumulateStackSizes (OptixProgramGroup programGroup, OptixStackSizes *stackSizes, OptixPipeline pipeline)
 
OptixResult optixUtilComputeStackSizes (const OptixStackSizes *stackSizes, unsigned int maxTraceDepth, unsigned int maxCCDepth, unsigned int maxDCDepth, unsigned int *directCallableStackSizeFromTraversal, unsigned int *directCallableStackSizeFromState, unsigned int *continuationStackSize)
 
OptixResult optixUtilComputeStackSizesDCSplit (const OptixStackSizes *stackSizes, unsigned int dssDCFromTraversal, unsigned int dssDCFromState, unsigned int maxTraceDepth, unsigned int maxCCDepth, unsigned int maxDCDepthFromTraversal, unsigned int maxDCDepthFromState, unsigned int *directCallableStackSizeFromTraversal, unsigned int *directCallableStackSizeFromState, unsigned int *continuationStackSize)
 
OptixResult optixUtilComputeStackSizesCssCCTree (const OptixStackSizes *stackSizes, unsigned int cssCCTree, unsigned int maxTraceDepth, unsigned int maxDCDepth, unsigned int *directCallableStackSizeFromTraversal, unsigned int *directCallableStackSizeFromState, unsigned int *continuationStackSize)
 
OptixResult optixUtilComputeStackSizesSimplePathTracer (OptixProgramGroup programGroupRG, OptixProgramGroup programGroupMS1, const OptixProgramGroup *programGroupCH1, unsigned int programGroupCH1Count, OptixProgramGroup programGroupMS2, const OptixProgramGroup *programGroupCH2, unsigned int programGroupCH2Count, unsigned int *directCallableStackSizeFromTraversal, unsigned int *directCallableStackSizeFromState, unsigned int *continuationStackSize, OptixPipeline pipeline)
 
OptixResult optixInitWithHandle (void **handlePtr)
 
OptixResult optixInit (void)
 
OptixResult optixUninitWithHandle (void *handle)
 

Detailed Description

OptiX Utilities.

Function Documentation

 optixInit()

OptixResult optixInit ( void  )
inline

Loads the OptiX library and initializes the function table used by the stubs below.

A variant of optixInitWithHandle() that does not make the handle to the loaded library available.

 optixInitWithHandle()

OptixResult optixInitWithHandle ( void **  handlePtr)
inline

Loads the OptiX library and initializes the function table used by the stubs below.

If handlePtr is not nullptr, an OS-specific handle to the library will be returned in *handlePtr.

See also
optixUninitWithHandle

 optixUninitWithHandle()

OptixResult optixUninitWithHandle ( void *  handle)
inline

Unloads the OptiX library and zeros the function table used by the stubs below. Takes the handle returned by optixInitWithHandle. All OptixDeviceContext objects must be destroyed before calling this function, or the behavior is undefined.

See also
optixInitWithHandle

 optixUtilAccumulateStackSizes()

OptixResult optixUtilAccumulateStackSizes ( OptixProgramGroup  programGroup,
OptixStackSizes stackSizes,
OptixPipeline  pipeline 
)
inline

Retrieves direct and continuation stack sizes for each program in the program group and accumulates the upper bounds in the correponding output variables based on the semantic type of the program. Before the first invocation of this function with a given instance of OptixStackSizes, the members of that instance should be set to 0. If the programs rely on external functions, passing the current pipeline will consider these as well. Otherwise, a null pointer can be passed instead. When external functions are present, a warning will be issued for these cases.

 optixUtilComputeStackSizes()

OptixResult optixUtilComputeStackSizes ( const OptixStackSizes stackSizes,
unsigned int  maxTraceDepth,
unsigned int  maxCCDepth,
unsigned int  maxDCDepth,
unsigned int *  directCallableStackSizeFromTraversal,
unsigned int *  directCallableStackSizeFromState,
unsigned int *  continuationStackSize 
)
inline

Computes the stack size values needed to configure a pipeline.

See the programming guide for an explanation of the formula.

Parameters
[in]stackSizesAccumulated stack sizes of all programs in the call graph.
[in]maxTraceDepthMaximum depth of optixTrace() calls.
[in]maxCCDepthMaximum depth of calls trees of continuation callables.
[in]maxDCDepthMaximum depth of calls trees of direct callables.
[out]directCallableStackSizeFromTraversalDirect stack size requirement for direct callables invoked from IS or AH.
[out]directCallableStackSizeFromStateDirect stack size requirement for direct callables invoked from RG, MS, or CH.
[out]continuationStackSizeContinuation stack requirement.

 optixUtilComputeStackSizesCssCCTree()

OptixResult optixUtilComputeStackSizesCssCCTree ( const OptixStackSizes stackSizes,
unsigned int  cssCCTree,
unsigned int  maxTraceDepth,
unsigned int  maxDCDepth,
unsigned int *  directCallableStackSizeFromTraversal,
unsigned int *  directCallableStackSizeFromState,
unsigned int *  continuationStackSize 
)
inline

Computes the stack size values needed to configure a pipeline.

This variant is similar to optixUtilComputeStackSizes(), except that it expects the value cssCCTree instead of cssCC and maxCCDepth.

See programming guide for an explanation of the formula.

Parameters
[in]stackSizesAccumulated stack sizes of all programs in the call graph.
[in]cssCCTreeMaximum stack size used by calls trees of continuation callables.
[in]maxTraceDepthMaximum depth of optixTrace() calls.
[in]maxDCDepthMaximum depth of calls trees of direct callables.
[out]directCallableStackSizeFromTraversalDirect stack size requirement for direct callables invoked from IS or AH.
[out]directCallableStackSizeFromStateDirect stack size requirement for direct callables invoked from RG, MS, or CH.
[out]continuationStackSizeContinuation stack requirement.

 optixUtilComputeStackSizesDCSplit()

OptixResult optixUtilComputeStackSizesDCSplit ( const OptixStackSizes stackSizes,
unsigned int  dssDCFromTraversal,
unsigned int  dssDCFromState,
unsigned int  maxTraceDepth,
unsigned int  maxCCDepth,
unsigned int  maxDCDepthFromTraversal,
unsigned int  maxDCDepthFromState,
unsigned int *  directCallableStackSizeFromTraversal,
unsigned int *  directCallableStackSizeFromState,
unsigned int *  continuationStackSize 
)
inline

Computes the stack size values needed to configure a pipeline.

This variant is similar to optixUtilComputeStackSizes(), except that it expects the values dssDC and maxDCDepth split by call site semantic.

See programming guide for an explanation of the formula.

Parameters
[in]stackSizesAccumulated stack sizes of all programs in the call graph.
[in]dssDCFromTraversalAccumulated direct stack size of all DC programs invoked from IS or AH.
[in]dssDCFromStateAccumulated direct stack size of all DC programs invoked from RG, MS, or CH.
[in]maxTraceDepthMaximum depth of optixTrace() calls.
[in]maxCCDepthMaximum depth of calls trees of continuation callables.
[in]maxDCDepthFromTraversalMaximum depth of calls trees of direct callables invoked from IS or AH.
[in]maxDCDepthFromStateMaximum depth of calls trees of direct callables invoked from RG, MS, or CH.
[out]directCallableStackSizeFromTraversalDirect stack size requirement for direct callables invoked from IS or AH.
[out]directCallableStackSizeFromStateDirect stack size requirement for direct callables invoked from RG, MS, or CH.
[out]continuationStackSizeContinuation stack requirement.

 optixUtilComputeStackSizesSimplePathTracer()

OptixResult optixUtilComputeStackSizesSimplePathTracer ( OptixProgramGroup  programGroupRG,
OptixProgramGroup  programGroupMS1,
const OptixProgramGroup programGroupCH1,
unsigned int  programGroupCH1Count,
OptixProgramGroup  programGroupMS2,
const OptixProgramGroup programGroupCH2,
unsigned int  programGroupCH2Count,
unsigned int *  directCallableStackSizeFromTraversal,
unsigned int *  directCallableStackSizeFromState,
unsigned int *  continuationStackSize,
OptixPipeline  pipeline 
)
inline

Computes the stack size values needed to configure a pipeline.

This variant is a specialization of optixUtilComputeStackSizes() for a simple path tracer with the following assumptions: There are only two ray types, camera rays and shadow rays. There are only RG, MS, and CH programs, and no AH, IS, CC, or DC programs. The camera rays invoke only the miss and closest hit programs MS1 and CH1, respectively. The CH1 program might trace shadow rays, which invoke only the miss and closest hit programs MS2 and CH2, respectively.

For flexibility, we allow for each of CH1 and CH2 not just one single program group, but an array of programs groups, and compute the maximas of the stack size requirements per array.

See programming guide for an explanation of the formula.

If the programs rely on external functions, passing the current pipeline will consider these as well. Otherwise, a null pointer can be passed instead. When external functions are present, a warning will be issued for these cases.

 optixUtilDenoiserInvokeTiled()

OptixResult optixUtilDenoiserInvokeTiled ( OptixDenoiser  denoiser,
CUstream  stream,
const OptixDenoiserParams params,
CUdeviceptr  denoiserState,
size_t  denoiserStateSizeInBytes,
const OptixDenoiserGuideLayer guideLayer,
const OptixDenoiserLayer layers,
unsigned int  numLayers,
CUdeviceptr  scratch,
size_t  scratchSizeInBytes,
unsigned int  overlapWindowSizeInPixels,
unsigned int  tileWidth,
unsigned int  tileHeight 
)
inline

Run denoiser on input layers see optixDenoiserInvoke additional parameters:

Runs the denoiser on the input layers on a single GPU and stream using optixDenoiserInvoke. If the input layers' dimensions are larger than the specified tile size, the image is divided into tiles using optixUtilDenoiserSplitImage, and multiple back-to-back invocations are performed in order to reuse the scratch space. Multiple tiles can be invoked concurrently if optixUtilDenoiserSplitImage is used directly and multiple scratch allocations for each concurrent invocation are used. The input parameters are the same as optixDenoiserInvoke except for the addition of the maximum tile size.

Parameters
[in]denoiser
[in]stream
[in]params
[in]denoiserState
[in]denoiserStateSizeInBytes
[in]guideLayer
[in]layers
[in]numLayers
[in]scratch
[in]scratchSizeInBytes
[in]overlapWindowSizeInPixels
[in]tileWidth
[in]tileHeight

 optixUtilDenoiserSplitImage()

OptixResult optixUtilDenoiserSplitImage ( const OptixImage2D input,
const OptixImage2D output,
unsigned int  overlapWindowSizeInPixels,
unsigned int  tileWidth,
unsigned int  tileHeight,
std::vector< OptixUtilDenoiserImageTile > &  tiles 
)
inline

Split image into 2D tiles given horizontal and vertical tile size.

Parameters
[in]inputfull resolution input image to be split
[in]outputfull resolution output image
[in]overlapWindowSizeInPixelssee OptixDenoiserSizes, optixDenoiserComputeMemoryResources
[in]tileWidthmaximum width of tiles
[in]tileHeightmaximum height of tiles
[out]tileslist of tiles covering the input image

 optixUtilGetPixelStride()

OptixResult optixUtilGetPixelStride ( const OptixImage2D image,
unsigned int &  pixelStrideInBytes 
)
inline

Return pixel stride in bytes for the given pixel format if the pixelStrideInBytes member of the image is zero. Otherwise return pixelStrideInBytes from the image.

Parameters
[in]imageImage containing the pixel stride
[in]pixelStrideInBytesPixel stride in bytes