NVIDIA OptiX 7.1 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Utilities

Classes

struct  OptixUtilDenoiserImageTile
 

Functions

OptixResult optixUtilAccumulateStackSizes (OptixProgramGroup programGroup, OptixStackSizes *stackSizes)
 
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)
 
unsigned int optixUtilGetPixelStride (const OptixImage2D &image)
 
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 OptixImage2D *inputLayers, unsigned int numInputLayers, const OptixImage2D *outputLayer, CUdeviceptr scratch, size_t scratchSizeInBytes, unsigned int overlapWindowSizeInPixels, unsigned int tileWidth, unsigned int tileHeight)
 
OptixResult optixInitWithHandle (void **handlePtr)
 
OptixResult optixInit (void)
 

Detailed Description

OptiX Utilities.

Function Documentation

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.

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.

OptixResult optixUtilAccumulateStackSizes ( OptixProgramGroup  programGroup,
OptixStackSizes stackSizes 
)

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.

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

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.
OptixResult optixUtilComputeStackSizesCssCCTree ( const OptixStackSizes stackSizes,
unsigned int  cssCCTree,
unsigned int  maxTraceDepth,
unsigned int  maxDCDepth,
unsigned int *  directCallableStackSizeFromTraversal,
unsigned int *  directCallableStackSizeFromState,
unsigned int *  continuationStackSize 
)

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.
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 
)

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.
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 
)

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.

OptixResult optixUtilDenoiserInvokeTiled ( OptixDenoiser denoiser,
CUstream  stream,
const OptixDenoiserParams params,
CUdeviceptr  denoiserState,
size_t  denoiserStateSizeInBytes,
const OptixImage2D inputLayers,
unsigned int  numInputLayers,
const OptixImage2D outputLayer,
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]inputLayers
[in]numInputLayers
[in]inputOffsetX
[in]inputOffsetY
[in]outputLayer
[in]scratch
[in]scratchSizeInBytes
[in]overlapWindowSizeInPixels
[in]tileWidth
[in]tileHeight
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
unsigned int optixUtilGetPixelStride ( const OptixImage2D image)
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