From the OptiX 7 guide:
and also from chapter 6.1 “Program Input”.
I have a hard time unterstanding, what a ray switching lanes would involve in regards to the memory.
In my example, rays have some sort of identity, which I’m storing in global memory, which I access with a threadIndex:
const int ix = optixGetLaunchIndex().x; const int iy = optixGetLaunchIndex().y; const cuuint32_t threadIndex = ix + iy * optixLaunchParams.simConstants.size.x; rayData = optixLaunchParams.perThreadData.currentRayData[threadIndex]; //global memory, each thread/launch index has their own
In my raygeneration program I sometimes fetch this data, use it as PRD. For the post-processing/shading step I have global counting structures, which I increment with atomic instructions. I also save e.g. new starting positions again in the global memory.
My main goal is to load data from location A and save it back to location A.
Now I wonder how the memory really is effected in case a lane/thread switch happens. Which of the data can I assume is safe? What could be a problematic scenario?