My small ray tracing application has a very weird behaviour / bug. Calling rtContextValidate after setting up everything, either directly or indirectly via rtContextLaunch, results in a RT_ERROR_TYPE_MISMATCH.
However, if I add a call to rtContextValidate at any location in the code before calling rtContextSetRayGenerationProgram, the error goes away and the code produces the expected result!
I have no idea what could be causing this. According to what I have read in the docs so far, a call to rtContextValidate that did not encounter any problems should never change the outcome of a subsequent call to rtContextValidate, right?
Right now, I have only two potential explanations for this: either I did something nasty with buffers or something that causes undefinded behaviour, or there is a bug in OptiX. Unfortunately, I have no idea how to find out what exactly is going on here.
Btw: I am using OptiX 4.0.1 with CUDA 8.0 on Windows 10 (VS 2015)