use render thread methods for all async gltf loading
This commit is contained in:
@@ -1008,6 +1008,28 @@ EMSCRIPTEN_KEEPALIVE void SceneAsset_createFromFilamentAssetRenderThread(
|
|||||||
});
|
});
|
||||||
auto fut = _renderThread->add_task(lambda);
|
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(
|
EMSCRIPTEN_KEEPALIVE void GltfAssetLoader_loadRenderThread(
|
||||||
TEngine *tEngine,
|
TEngine *tEngine,
|
||||||
|
|||||||
Reference in New Issue
Block a user