Just have a read through this search list of OptiX threads which mention launch parameters:
https://forums.developer.nvidia.com/search?q=launch%20parameter%20%23visualization%3Aoptix
Your questions are answered in there.
OptiX Programming Guide on launch parameters:
https://raytracing-docs.nvidia.com/optix7/guide/index.html#program_pipeline_creation#pipeline-launch-parameter
The gist is:
- Launch parameters are put into constant memory by OptiX.
- That constant memory is limited to 64 kB and it’s read-only!
- It’s a good idea to keep it small.
- OptiX identifies the single launch parameter structure via its name given to OptixPipelineCompileOptions pipelineLaunchParamsVariableName.
- Everything big you need to read (camera-, light-, material-definitions, per instance data, etc.) should be and everything you write (all output buffers of any kind) must be stored as CUdeviceptr (or typed pointers which are also just 64 bit device pointers) inside the launch parameters via which you can access the underlying data inside global memory.
More example code doing that here:
https://forums.developer.nvidia.com/t/optix-advanced-samples-on-github/48410/8
Launch parameter struct showing all of the above:
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/rtigo10/shaders/system_data.h#L65