WebGL Shared Resources Web Workers

I'm just new to WebGL - sorry if this question is naive. I searched on the Internet but could not find the latest support from a WebGL expert.

I would like to use shared resources for WebGL using web workers - mainly loading textures and textures. What is the support status for this? What workarounds do I have?

+4
source share
2 answers

For now, you cannot share resources within the web worker. You can transfer TypedArraysto and from WebWorkers, although it really depends on what you want to do. If you decode textures in JavaScript, you can do the decoding in the workplace, and then pass the TypedArray with the data back to the main stream. This can happen with zero copy . But the call gl.texImage2dshould happen in the main thread.

As for reading textures in the workplace, you're out of luck.

+3
source

Source: https://habr.com/ru/post/1541339/


All Articles