This initialization now seems verbose / excessive as CUDA and OptiX initialization has evolved. TODO: Simplify?
| 59 | // This initialization now seems verbose / excessive as CUDA and OptiX initialization |
| 60 | // has evolved. TODO: Simplify? |
| 61 | OptixDeviceContext initOptix(Falcor::Device* pDevice) |
| 62 | { |
| 63 | FALCOR_CHECK(pDevice->initCudaDevice(), "Failed to initialize CUDA device."); |
| 64 | |
| 65 | OPTIX_CHECK(optixInit()); |
| 66 | |
| 67 | FALCOR_CHECK(g_optixFunctionTable.optixDeviceContextCreate, "OptiX function table not initialized."); |
| 68 | |
| 69 | // Build our OptiX context |
| 70 | OptixDeviceContext optixContext; |
| 71 | OPTIX_CHECK(optixDeviceContextCreate(pDevice->getCudaDevice()->getContext(), 0, &optixContext)); |
| 72 | |
| 73 | // Tell Optix how to write to our Falcor log. |
| 74 | OPTIX_CHECK(optixDeviceContextSetLogCallback(optixContext, optixLogCallback, nullptr, 4)); |
| 75 | |
| 76 | return optixContext; |
| 77 | } |
no test coverage detected