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

Method RecreateAccelStructs

Rtxpt/Sample.cpp:1127–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127void Sample::RecreateAccelStructs(nvrhi::ICommandList* commandList)
1128{
1129 // If the subInstanceData or BLAS build input data changes we trigger a full update here
1130 // could be made more efficient by only rebuilding the geometry in question,
1131 // or split the BLAS and subInstanceData updates
1132 if (m_ui.AccelerationStructRebuildRequested)
1133 {
1134 m_ui.AccelerationStructRebuildRequested = false;
1135 m_ui.ResetAccumulation = true;
1136
1137 GetDevice()->waitForIdle();
1138
1139 m_bindingSet = nullptr;
1140 m_topLevelAS = nullptr;
1141
1142 for (const std::shared_ptr<MeshInfo>& _mesh : m_scene->GetSceneGraph()->GetMeshes())
1143 {
1144 assert(std::dynamic_pointer_cast<MeshInfoEx>(_mesh) != nullptr);
1145 const std::shared_ptr<MeshInfoEx>& mesh = std::static_pointer_cast<MeshInfoEx>(_mesh);
1146 mesh->accelStruct = nullptr;
1147 mesh->AccelStructOMM = nullptr;
1148 mesh->OpacityMicroMaps.clear();
1149 mesh->DebugData = nullptr;
1150 mesh->DebugDataDirty = true;
1151 }
1152
1153 // raytracing acceleration structures
1154 commandList->open();
1155 CreateAccelStructs(commandList);
1156 commandList->close();
1157 GetDevice()->executeCommandList(commandList);
1158 GetDevice()->waitForIdle();
1159 }
1160}
1161
1162void Sample::TransitionMeshBuffersToReadOnly(nvrhi::ICommandList* commandList)
1163{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected