MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / BuildBLASWithOMM

Method BuildBLASWithOMM

Rtxpt/OpacityMicroMap/OmmBuildQueue.cpp:383–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void 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
396void OmmBuildQueue::RunBakeAndBuild(nvrhi::ICommandList& commandList, BuildTask& task)
397{

Callers

nothing calls this directly

Calls 1

GetMeshBlasDescFunction · 0.85

Tested by

no test coverage detected