use render thread methods for all async gltf loading

This commit is contained in:
Nick Fisher
2025-04-16 19:07:55 +08:00
parent 4002425c0d
commit 426d6c4ed6

View File

@@ -1008,6 +1008,28 @@ EMSCRIPTEN_KEEPALIVE void SceneAsset_createFromFilamentAssetRenderThread(
});
auto fut = _renderThread->add_task(lambda);
}
EMSCRIPTEN_KEEPALIVE void GltfResourceLoader_asyncUpdateLoadRenderThread(
TGltfResourceLoader *tGltfResourceLoader) {
std::packaged_task<void()> lambda(
[=]() mutable
{
GltfResourceLoader_asyncUpdateLoad(tGltfResourceLoader);
});
auto fut = _renderThread->add_task(lambda);
}
EMSCRIPTEN_KEEPALIVE void GltfResourceLoader_asyncGetLoadProgressRenderThread(
TGltfResourceLoader *tGltfResourceLoader,
void (*callback)(float)) {
std::packaged_task<void()> lambda(
[=]() mutable
{
auto result = GltfResourceLoader_asyncGetLoadProgress(tGltfResourceLoader);
callback(result);
});
auto fut = _renderThread->add_task(lambda);
}
EMSCRIPTEN_KEEPALIVE void GltfAssetLoader_loadRenderThread(
TEngine *tEngine,