BabylonJS / BabylonNative

Build cross-platform native applications with the power of the Babylon.js JavaScript framework
MIT License
764 stars 131 forks source link

[Canvas] different JS behavior for canvas & context destruction #810

Closed CedricGuillemet closed 12 months ago

CedricGuillemet commented 3 years ago

With JSC and Chakra, canvas and context are destroyed just after the dynamicTexture is disposed. With V8, those 2 objects are not destroyed before the JS Runtime is destroyed. More and more rendertargets are created and kept in memory. After a while, bgfx can't create a new one.

CedricGuillemet commented 2 years ago

Related : https://forum.babylonjs.com/t/cant-clear-dynamictexture-to-transparent-in-babylonreactnative/28933/16

bghgary commented 1 year ago

Look at this with the shutdown scenarios.

CedricGuillemet commented 1 year ago

Issue can be mitigated by increasing the number of FrameBuffer. With a number big enough (4096+), Framebuffer are destroyed at some point. Setting it to 256 for now in the CI.

CedricGuillemet commented 12 months ago

Change done in this PR : https://github.com/BabylonJS/BabylonNative/pull/1260 Closing for now. reopen if a better solution is needed.