MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / LoadModelAsync

Method LoadModelAsync

src/engine/Scene.cpp:187–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void Scene::LoadModelAsync(
188 uint32_t index,
189 const std::filesystem::path& fileName,
190 ThreadPool* threadPool)
191{
192 if (threadPool)
193 {
194 threadPool->AddTask([this, index, threadPool, fileName]()
195 {
196 SceneImportResult result;
197 m_GltfImporter->Load(fileName, *m_TextureCache, g_LoadingStats, threadPool, result);
198 ++g_LoadingStats.ObjectsLoaded;
199 m_Models[index] = result;
200 });
201 }
202 else
203 {
204 SceneImportResult result;
205 m_GltfImporter->Load(fileName, *m_TextureCache, g_LoadingStats, threadPool, result);
206 ++g_LoadingStats.ObjectsLoaded;
207 m_Models[index] = result;
208 }
209}
210
211void Scene::LoadModels(
212 const Json::Value& modelList,

Callers

nothing calls this directly

Calls 2

AddTaskMethod · 0.80
LoadMethod · 0.45

Tested by

no test coverage detected