Pass multiple launch parameter files to OptiX 7


Say I have two separate files for passing launch parameters to an OptiX 7 program (launchParams0.h and launchParams1.h).

Is it possible to pass both these files to OptiX 7 from HOST side via OptixPipelineCompileOptions struct? I can combine both launch parameter files into one file, but I would just like to know (for future reference) if one could possibly pass both files separately from HOST to a single OptiX program like rayGen.

Thanks for any answer(s).

You can only pass one launch params variable to OptiX. The way to get two separate structures into your launch params is to create a third wrapper structure you can use for launch params that contains one instance each of the first two structures.

struct LaunchParams {
  LaunchParams0 params0;
  LaunchParams1 params1;

LaunchParams params;
pipelineCompileOptions.pipelineLaunchParamsVariableName = "params";
optixLaunch(..., <CUdeviceptr>( params ), sizeof( LaunchParams ), ... );


Thanks @dhart for the reply.

That’s a good idea to wrap the two structures as one.