19#ifndef OPTIX_OPTIX_HOST_H
20#define OPTIX_OPTIX_HOST_H
25# ifdef OPTIX_ENABLE_SDK_MIXING
26# define OPTIXAPI static
29# define OPTIXAPI extern "C"
37#if !defined( OPTIX_DONT_INCLUDE_CUDA )
45#include <exp/misc/optix_nvconfig_translate.h>
139 unsigned int callbackLevel );
266 unsigned int numProgramGroups,
268 size_t* logStringSize,
297 unsigned int directCallableStackSizeFromTraversal,
298 unsigned int directCallableStackSizeFromState,
299 unsigned int continuationStackSize,
300 unsigned int maxTraversableGraphDepth );
342 size_t* logStringSize,
391 size_t* logStringSize,
443 unsigned int maxNumAdditionalTasks,
444 unsigned int* numAdditionalTasksCreated );
488 unsigned int numProgramGroups,
491 size_t* logStringSize,
531 size_t pipelineParamsSize,
535 unsigned int depth );
554 unsigned int numBuildInputs,
573 unsigned int numBuildInputs,
575 size_t tempBufferSizeInBytes,
577 size_t outputBufferSizeInBytes,
580 unsigned int numEmittedProperties );
655 size_t numRelocateInputs,
657 size_t targetAccelSizeInBytes,
681 size_t outputBufferSizeInBytes,
792 size_t targetOpacityMicromapArraySizeInBytes );
855 const void* userData,
856 size_t userDataSizeInBytes,
882 unsigned int outputWidth,
883 unsigned int outputHeight,
904 unsigned int inputWidth,
905 unsigned int inputHeight,
907 size_t denoiserStateSizeInBytes,
909 size_t scratchSizeInBytes );
980 size_t denoiserStateSizeInBytes,
983 unsigned int numLayers,
984 unsigned int inputOffsetX,
985 unsigned int inputOffsetY,
987 size_t scratchSizeInBytes );
1017 size_t scratchSizeInBytes );
1038 size_t scratchSizeInBytes );
struct OptixProgramGroup_t * OptixProgramGroup
Opaque type representing a program group.
Definition: optix_types.h:56
struct OptixDenoiser_t * OptixDenoiser
Opaque type representing a denoiser instance.
Definition: optix_types.h:62
OptixDeviceProperty
Parameters used for optixDeviceContextGetProperty()
Definition: optix_types.h:191
unsigned long long CUdeviceptr
CUDA device pointer.
Definition: optix_types.h:43
OptixResult
Result codes returned from API functions.
Definition: optix_types.h:143
OptixModuleCompileState
Module compilation state.
Definition: optix_types.h:1917
struct OptixModule_t * OptixModule
Opaque type representing a module.
Definition: optix_types.h:53
OptixDenoiserModelKind
Model kind used by the denoiser.
Definition: optix_types.h:1608
struct OptixPipeline_t * OptixPipeline
Opaque type representing a pipeline.
Definition: optix_types.h:59
unsigned long long OptixTraversableHandle
Traversable handle.
Definition: optix_types.h:68
OptixTraversableType
Traversable Handles.
Definition: optix_types.h:1555
void(* OptixLogCallback)(unsigned int level, const char *tag, const char *message, void *cbdata)
Type of the callback function used for log messages.
Definition: optix_types.h:257
struct OptixTask_t * OptixTask
Opaque type representing a work task.
Definition: optix_types.h:65
struct OptixDeviceContext_t * OptixDeviceContext
Opaque type representing a device context.
Definition: optix_types.h:50
OPTIXAPI OptixResult optixOpacityMicromapArrayBuild(OptixDeviceContext context, CUstream stream, const OptixOpacityMicromapArrayBuildInput *buildInput, const OptixMicromapBuffers *buffers)
Construct an array of Opacity Micromaps.
OPTIXAPI OptixResult optixOpacityMicromapArrayComputeMemoryUsage(OptixDeviceContext context, const OptixOpacityMicromapArrayBuildInput *buildInput, OptixMicromapBufferSizes *bufferSizes)
Determine the amount of memory necessary for a Opacity Micromap Array build.
OPTIXAPI OptixResult optixDeviceContextCreate(CUcontext fromContext, const OptixDeviceContextOptions *options, OptixDeviceContext *context)
Create a device context associated with the CUDA context specified with 'fromContext'.
OPTIXAPI OptixResult optixPipelineCreate(OptixDeviceContext context, const OptixPipelineCompileOptions *pipelineCompileOptions, const OptixPipelineLinkOptions *pipelineLinkOptions, const OptixProgramGroup *programGroups, unsigned int numProgramGroups, char *logString, size_t *logStringSize, OptixPipeline *pipeline)
logString is an optional buffer that contains compiler feedback and errors. This information is also ...
OPTIXAPI const char * optixGetErrorString(OptixResult result)
Returns the description string for an error code.
#define OPTIXAPI
Mixing multiple SDKs in a single application will result in symbol collisions. To enable different co...
Definition: optix_host.h:31
OPTIXAPI OptixResult optixDeviceContextSetLogCallback(OptixDeviceContext context, OptixLogCallback callbackFunction, void *callbackData, unsigned int callbackLevel)
Sets the current log callback method.
OPTIXAPI OptixResult optixDeviceContextDestroy(OptixDeviceContext context)
Destroys all CPU and GPU state associated with the device.
OPTIXAPI OptixResult optixAccelEmitProperty(OptixDeviceContext context, CUstream stream, OptixTraversableHandle handle, const OptixAccelEmitDesc *emittedProperty)
Emit a single property after an acceleration structure was built. The result buffer of the ' emittedP...
OPTIXAPI 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)
OPTIXAPI OptixResult optixBuiltinISModuleGet(OptixDeviceContext context, const OptixModuleCompileOptions *moduleCompileOptions, const OptixPipelineCompileOptions *pipelineCompileOptions, const OptixBuiltinISOptions *builtinISOptions, OptixModule *builtinModule)
Returns a module containing the intersection program for the built-in primitive type specified by the...
OPTIXAPI OptixResult optixDenoiserCreate(OptixDeviceContext context, OptixDenoiserModelKind modelKind, const OptixDenoiserOptions *options, OptixDenoiser *denoiser)
Creates a denoiser object with the given options, using built-in inference models.
OPTIXAPI OptixResult optixDeviceContextGetCacheLocation(OptixDeviceContext context, char *location, size_t locationSize)
Returns the location of the disk cache. If the cache has been disabled by setting the environment var...
OPTIXAPI OptixResult optixLaunch(OptixPipeline pipeline, CUstream stream, CUdeviceptr pipelineParams, size_t pipelineParamsSize, const OptixShaderBindingTable *sbt, unsigned int width, unsigned int height, unsigned int depth)
Where the magic happens.
OPTIXAPI OptixResult optixPipelineDestroy(OptixPipeline pipeline)
Thread safety: A pipeline must not be destroyed while it is still in use by concurrent API calls in o...
OPTIXAPI OptixResult optixDenoiserCreateWithUserModel(OptixDeviceContext context, const void *userData, size_t userDataSizeInBytes, OptixDenoiser *denoiser)
Creates a denoiser object with the given options, using a provided inference model.
OPTIXAPI OptixResult optixDeviceContextGetCacheEnabled(OptixDeviceContext context, int *enabled)
Indicates whether the disk cache is enabled or disabled.
OPTIXAPI OptixResult optixDisplacementMicromapArrayComputeMemoryUsage(OptixDeviceContext context, const OptixDisplacementMicromapArrayBuildInput *buildInput, OptixMicromapBufferSizes *bufferSizes)
Determine the amount of memory necessary for a Displacement Micromap Array build.
OPTIXAPI OptixResult optixDenoiserComputeAverageColor(OptixDenoiser denoiser, CUstream stream, const OptixImage2D *inputImage, CUdeviceptr outputAverageColor, CUdeviceptr scratch, size_t scratchSizeInBytes)
Compute average logarithmic for each of the first three channels for the given image....
OPTIXAPI OptixResult optixModuleCreate(OptixDeviceContext context, const OptixModuleCompileOptions *moduleCompileOptions, const OptixPipelineCompileOptions *pipelineCompileOptions, const char *input, size_t inputSize, char *logString, size_t *logStringSize, OptixModule *module)
Compiling programs into a module. These programs can be passed in as either PTX or OptiX-IR.
OPTIXAPI OptixResult optixSbtRecordPackHeader(OptixProgramGroup programGroup, void *sbtRecordHeaderHostPointer)
OPTIXAPI OptixResult optixModuleDestroy(OptixModule module)
Call for OptixModule objects created with optixModuleCreate and optixModuleDeserialize.
OPTIXAPI OptixResult optixConvertPointerToTraversableHandle(OptixDeviceContext onDevice, CUdeviceptr pointer, OptixTraversableType traversableType, OptixTraversableHandle *traversableHandle)
OPTIXAPI OptixResult optixDenoiserDestroy(OptixDenoiser denoiser)
Destroys the denoiser object and any associated host resources.
OPTIXAPI const char * optixGetErrorName(OptixResult result)
Returns a string containing the name of an error code in the enum.
OPTIXAPI OptixResult optixAccelComputeMemoryUsage(OptixDeviceContext context, const OptixAccelBuildOptions *accelOptions, const OptixBuildInput *buildInputs, unsigned int numBuildInputs, OptixAccelBufferSizes *bufferSizes)
OPTIXAPI OptixResult optixDenoiserSetup(OptixDenoiser denoiser, CUstream stream, unsigned int inputWidth, unsigned int inputHeight, CUdeviceptr denoiserState, size_t denoiserStateSizeInBytes, CUdeviceptr scratch, size_t scratchSizeInBytes)
Initializes the state required by the denoiser.
OPTIXAPI OptixResult optixAccelRelocate(OptixDeviceContext context, CUstream stream, const OptixRelocationInfo *info, const OptixRelocateInput *relocateInputs, size_t numRelocateInputs, CUdeviceptr targetAccel, size_t targetAccelSizeInBytes, OptixTraversableHandle *targetHandle)
optixAccelRelocate is called to update the acceleration structure after it has been relocated....
OPTIXAPI OptixResult optixAccelGetRelocationInfo(OptixDeviceContext context, OptixTraversableHandle handle, OptixRelocationInfo *info)
Obtain relocation information, stored in OptixRelocationInfo, for a given context and acceleration st...
OPTIXAPI OptixResult optixProgramGroupDestroy(OptixProgramGroup programGroup)
Thread safety: A program group must not be destroyed while it is still in use by concurrent API calls...
OPTIXAPI OptixResult optixDeviceContextGetProperty(OptixDeviceContext context, OptixDeviceProperty property, void *value, size_t sizeInBytes)
Query properties of a device context.
OPTIXAPI 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....
OPTIXAPI OptixResult optixProgramGroupCreate(OptixDeviceContext context, const OptixProgramGroupDesc *programDescriptions, unsigned int numProgramGroups, const OptixProgramGroupOptions *options, char *logString, size_t *logStringSize, OptixProgramGroup *programGroups)
logString is an optional buffer that contains compiler feedback and errors. This information is also ...
OPTIXAPI OptixResult optixOpacityMicromapArrayRelocate(OptixDeviceContext context, CUstream stream, const OptixRelocationInfo *info, CUdeviceptr targetOpacityMicromapArray, size_t targetOpacityMicromapArraySizeInBytes)
optixOpacityMicromapArrayRelocate is called to update the opacity micromap array after it has been re...
OPTIXAPI OptixResult optixDenoiserComputeMemoryResources(const OptixDenoiser denoiser, unsigned int outputWidth, unsigned int outputHeight, OptixDenoiserSizes *returnSizes)
Computes the GPU memory resources required to execute the denoiser.
OPTIXAPI OptixResult optixDeviceContextSetCacheLocation(OptixDeviceContext context, const char *location)
Sets the location of the disk cache.
OPTIXAPI OptixResult optixOpacityMicromapArrayGetRelocationInfo(OptixDeviceContext context, CUdeviceptr opacityMicromapArray, OptixRelocationInfo *info)
Obtain relocation information, stored in OptixRelocationInfo, for a given context and opacity microma...
OPTIXAPI OptixResult optixModuleCreateWithTasks(OptixDeviceContext context, const OptixModuleCompileOptions *moduleCompileOptions, const OptixPipelineCompileOptions *pipelineCompileOptions, const char *input, size_t inputSize, char *logString, size_t *logStringSize, OptixModule *module, OptixTask *firstTask)
This function is designed to do just enough work to create the OptixTask return parameter and is expe...
OPTIXAPI OptixResult optixProgramGroupGetStackSize(OptixProgramGroup programGroup, OptixStackSizes *stackSizes, OptixPipeline pipeline)
Returns the stack sizes for the given program group. When programs in this programGroup are relying o...
OPTIXAPI OptixResult optixModuleGetCompilationState(OptixModule module, OptixModuleCompileState *state)
When creating a module with tasks, the current state of the module can be queried using this function...
OPTIXAPI OptixResult optixDisplacementMicromapArrayBuild(OptixDeviceContext context, CUstream stream, const OptixDisplacementMicromapArrayBuildInput *buildInput, const OptixMicromapBuffers *buffers)
Construct an array of Displacement Micromaps (DMMs).
OPTIXAPI OptixResult optixDenoiserInvoke(OptixDenoiser denoiser, CUstream stream, const OptixDenoiserParams *params, CUdeviceptr denoiserState, size_t denoiserStateSizeInBytes, const OptixDenoiserGuideLayer *guideLayer, const OptixDenoiserLayer *layers, unsigned int numLayers, unsigned int inputOffsetX, unsigned int inputOffsetY, CUdeviceptr scratch, size_t scratchSizeInBytes)
Invokes denoiser on a set of input data and produces at least one output image. State memory must be ...
OPTIXAPI OptixResult optixDenoiserComputeIntensity(OptixDenoiser denoiser, CUstream stream, const OptixImage2D *inputImage, CUdeviceptr outputIntensity, CUdeviceptr scratch, size_t scratchSizeInBytes)
Computes the logarithmic average intensity of the given image. The returned value 'outputIntensity' i...
OPTIXAPI OptixResult optixDeviceContextSetCacheEnabled(OptixDeviceContext context, int enabled)
Enables or disables the disk cache.
OPTIXAPI OptixResult optixDeviceContextGetCacheDatabaseSizes(OptixDeviceContext context, size_t *lowWaterMark, size_t *highWaterMark)
Returns the low and high water marks for disk cache garbage collection. If the cache has been disable...
OPTIXAPI OptixResult optixTaskExecute(OptixTask task, OptixTask *additionalTasks, unsigned int maxNumAdditionalTasks, unsigned int *numAdditionalTasksCreated)
Each OptixTask should be executed with optixTaskExecute(). If additional parallel work is found,...
OPTIXAPI OptixResult optixCheckRelocationCompatibility(OptixDeviceContext context, const OptixRelocationInfo *info, int *compatible)
Checks if an optix data structure built using another OptixDeviceContext (that was used to fill in 'i...
OPTIXAPI OptixResult optixPipelineSetStackSize(OptixPipeline pipeline, unsigned int directCallableStackSizeFromTraversal, unsigned int directCallableStackSizeFromState, unsigned int continuationStackSize, unsigned int maxTraversableGraphDepth)
Sets the stack sizes for a pipeline.
OPTIXAPI OptixResult optixDeviceContextSetCacheDatabaseSizes(OptixDeviceContext context, size_t lowWaterMark, size_t highWaterMark)
Sets the low and high water marks for disk cache garbage collection.
Struct for querying builder allocation requirements.
Definition: optix_types.h:1352
Build options for acceleration structures.
Definition: optix_types.h:1330
Specifies a type and output destination for emitted post-build properties.
Definition: optix_types.h:1384
Specifies the options for retrieving an intersection program for a built-in primitive type....
Definition: optix_types.h:2372
Guide layer for the denoiser.
Definition: optix_types.h:1663
Input/Output layers for the denoiser.
Definition: optix_types.h:1707
Options used by the denoiser.
Definition: optix_types.h:1648
Various parameters used by the denoiser.
Definition: optix_types.h:1728
Various sizes related to the denoiser.
Definition: optix_types.h:1759
Parameters used for optixDeviceContextCreate()
Definition: optix_types.h:276
Image descriptor used by the denoiser.
Definition: optix_types.h:1586
Conservative memory requirements for building a opacity/displacement micromap array.
Definition: optix_types.h:1258
Buffer inputs for opacity/displacement micromap array builds.
Definition: optix_types.h:1265
Compilation options for module.
Definition: optix_types.h:2044
Compilation options for all modules of a pipeline.
Definition: optix_types.h:2247
Link options for a pipeline.
Definition: optix_types.h:2282
Descriptor for program groups.
Definition: optix_types.h:2155
Program group options.
Definition: optix_types.h:2181
Used to store information related to relocation of optix data structures.
Definition: optix_types.h:1397
Describes the shader binding table (SBT)
Definition: optix_types.h:2293
Describes the stack size requirements of a program group.
Definition: optix_types.h:2333