| 411 | } |
| 412 | |
| 413 | void Scene::raytrace(RenderContext* pRenderContext, Program* pProgram, const ref<RtProgramVars>& pVars, uint3 dispatchDims) |
| 414 | { |
| 415 | FALCOR_PROFILE(pRenderContext, "raytraceScene"); |
| 416 | |
| 417 | FALCOR_ASSERT(pRenderContext && pProgram && pVars); |
| 418 | // Check for valid number of geometries. |
| 419 | // We either expect a single geometry (used for "dummy shared binding tables") or matching the number of geometries in the scene. |
| 420 | if (pVars->getRayTypeCount() > 0 && pVars->getGeometryCount() != 1 && pVars->getGeometryCount() != getGeometryCount()) |
| 421 | { |
| 422 | logWarning("RtProgramVars geometry count mismatch"); |
| 423 | } |
| 424 | |
| 425 | uint32_t rayTypeCount = pVars->getRayTypeCount(); |
| 426 | bindShaderDataForRaytracing(pRenderContext, pVars->getRootVar()[kParameterBlockName], rayTypeCount); |
| 427 | |
| 428 | // Set ray type constant. |
| 429 | pVars->getRootVar()["DxrPerFrame"]["rayTypeCount"] = rayTypeCount; |
| 430 | |
| 431 | pRenderContext->raytrace(pProgram, pVars.get(), dispatchDims.x, dispatchDims.y, dispatchDims.z); |
| 432 | } |
| 433 | |
| 434 | void Scene::createMeshVao(uint32_t drawCount, const std::vector<SkinningVertexData>& skinningData) |
| 435 | { |