@@ -69,7 +69,7 @@ namespace Babylon::Plugins
6969 DEBUG_TRACE (" ExternalTexture [0x%p] AddToContextAsync" , m_impl.get ());
7070
7171 arcana::make_task (context.BeforeRenderScheduler (), arcana::cancellation_source::none (),
72- [&context, &runtime, deferred = std::move (deferred), impl = m_impl]() {
72+ [&context, &runtime, deferred = std::move (deferred), impl = m_impl]() mutable {
7373 // REVIEW: The bgfx texture handle probably needs to be an RAII object to make sure it gets clean up during the asynchrony.
7474 // For example, if any of the schedulers/dispatches below don't fire, then the texture handle will leak.
7575 bgfx::TextureHandle handle = bgfx::createTexture2D (impl->Width (), impl->Height (), impl->HasMips (), 1 , impl->Format (), impl->Flags ());
@@ -84,7 +84,7 @@ namespace Babylon::Plugins
8484 return ;
8585 }
8686
87- arcana::make_task (context.AfterRenderScheduler (), arcana::cancellation_source::none (), [&runtime, &context, deferred = std::move (deferred), handle, impl = std::move (impl)]() {
87+ arcana::make_task (context.AfterRenderScheduler (), arcana::cancellation_source::none (), [&runtime, &context, deferred = std::move (deferred), handle, impl = std::move (impl)]() mutable {
8888 if (bgfx::overrideInternal (handle, impl->Ptr ()) == 0 )
8989 {
9090 runtime.Dispatch ([deferred = std::move (deferred), handle](Napi::Env env) {
@@ -95,7 +95,7 @@ namespace Babylon::Plugins
9595 return ;
9696 }
9797
98- runtime.Dispatch ([deferred = std::move (deferred), handle, &context, impl = std::move (impl)](Napi::Env env) {
98+ runtime.Dispatch ([deferred = std::move (deferred), handle, &context, impl = std::move (impl)](Napi::Env env) mutable {
9999 auto * texture = new Graphics::Texture{context};
100100 DEBUG_TRACE (" ExternalTexture [0x%p] attach %d x %d %d mips. Format : %d Flags : %d. (bgfx handle id %d)" , impl.get (), int (impl->Width ()), int (impl->Height ()), int (impl->HasMips ()), int (impl->Format ()), int (impl->Flags ()), int (handle.idx ));
101101 texture->Attach (handle, true , impl->Width (), impl->Height (), impl->HasMips (), 1 , impl->Format (), impl->Flags ());
0 commit comments