| 381 | } |
| 382 | |
| 383 | void OmmBuildQueue::BuildBLASWithOMM(nvrhi::ICommandList& commandList, BuildTask& task, const std::vector<bvh::OmmAttachment>& ommAttachment) |
| 384 | { |
| 385 | nvrhi::rt::AccelStructDesc blasDesc = bvh::GetMeshBlasDesc(task.input.bvhCfg , *task.input.mesh, ommAttachment.data(), false); |
| 386 | // The spec says instance Id is only 24 bits, and we already take 16 for the instance index, so we only have 8 bits for the geometry. |
| 387 | // On the other side, we could completely skip this and just use DXR 1.1's GeometryIndex() directly in the shader. |
| 388 | assert((int)blasDesc.bottomLevelGeometries.size() < (1 << 8)); // we can only hold 8 bits for the geometry index in the HitInfo - see GeometryInstanceID in SceneTypes.hlsli |
| 389 | nvrhi::rt::AccelStructHandle as = m_device->createAccelStruct(blasDesc); |
| 390 | nvrhi::utils::BuildBottomLevelAccelStruct(&commandList, as, blasDesc); |
| 391 | |
| 392 | // Store results |
| 393 | std::static_pointer_cast<MeshInfoEx>(task.input.mesh)->AccelStructOMM = as; |
| 394 | } |
| 395 | |
| 396 | void OmmBuildQueue::RunBakeAndBuild(nvrhi::ICommandList& commandList, BuildTask& task) |
| 397 | { |
nothing calls this directly
no test coverage detected