BabylonNative icon indicating copy to clipboard operation
BabylonNative copied to clipboard

[Canvas] Texture Copy & threading

Open CedricGuillemet opened this issue 4 years ago • 2 comments

Because of threading, Canvas rendering has to be done like this:

https://github.com/BabylonJS/BabylonNative/blob/c00b503d3ab4c2809f1d0725e4bc3aa425677aad/Polyfills/Canvas/Source/Context.cpp#L534

In BabylonJS, the texture copy happens just after canvas rendering. In NativeEngine, if the texture copy happens in sync, it will be performed before the canvas rendering. Texture copy has be be done the same way as canvas rendering with tasks pushed on m_graphicsImpl.BeforeRenderScheduler().

Is there a way to improve this convoluted code? Is it possible to skip the texture copy and render the canvas to the raw texture instead ?

CedricGuillemet avatar Jun 22 '21 09:06 CedricGuillemet

#821 discusses one possible way to address this, among other considerations.

syntheticmagus avatar Jul 08 '21 20:07 syntheticmagus

Related: #969

bghgary avatar Jan 11 '22 19:01 bghgary

Duplicate of #969

bghgary avatar Dec 08 '22 19:12 bghgary