Is possible to enable OFFSCREENCANVAS_SUPPORT=1 on web worker with pthreads disabled?

31 views
Skip to first unread message

raytrace

unread,
Jan 29, 2020, 7:13:34 AM1/29/20
to emscripten-discuss

// If set to 1, enables support for transferring canvases to pthreads and
// creating WebGL contexts in them, as well as explicit swap control for GL
// contexts. This needs browser support for the OffscreenCanvas specification.
var OFFSCREENCANVAS_SUPPORT = 0;

It sounds OFFSCREENCANVAS_SUPPORT only works with pthread enabled. is it possible to enable it without pthread on web worker using webgl2 rendering?


Thanks,



Alon Zakai

unread,
Jan 30, 2020, 12:40:46 PM1/30/20
to emscripte...@googlegroups.com
I believe that's not supported currently. I guess the use case is the emscripten program runs in a worker, and you have JS on the main thread that sends it the context, which it needs to render to as an OffscreeCanvas? That does sound potentially useful.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/f5cb1e0e-aa27-48cd-a242-423f41251503%40googlegroups.com.

raytrace

unread,
Jan 30, 2020, 8:59:26 PM1/30/20
to emscripten-discuss
Exactly. I would like to run emscripten wasm in a worker with webgl2 and a offscreen canvas. Currently proxy-to-worker (webgl1 only) doesn't support offscreen canvas.


On Friday, 31 January 2020 01:40:46 UTC+8, Alon Zakai wrote:
I believe that's not supported currently. I guess the use case is the emscripten program runs in a worker, and you have JS on the main thread that sends it the context, which it needs to render to as an OffscreeCanvas? That does sound potentially useful.

On Wed, Jan 29, 2020 at 4:13 AM raytrace <dawe...@gmail.com> wrote:

// If set to 1, enables support for transferring canvases to pthreads and
// creating WebGL contexts in them, as well as explicit swap control for GL
// contexts. This needs browser support for the OffscreenCanvas specification.
var OFFSCREENCANVAS_SUPPORT = 0;

It sounds OFFSCREENCANVAS_SUPPORT only works with pthread enabled. is it possible to enable it without pthread on web worker using webgl2 rendering?


Thanks,



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Alon Zakai

unread,
Feb 3, 2020, 1:01:11 PM2/3/20
to emscripte...@googlegroups.com
Sounds interesting. I'm not aware of anyone working on that, but this sounds like a useful feature to me - maybe you want to try to implement it?

On Thu, Jan 30, 2020 at 5:59 PM raytrace <dawe...@gmail.com> wrote:
Exactly. I would like to run emscripten wasm in a worker with webgl2 and a offscreen canvas. Currently proxy-to-worker (webgl1 only) doesn't support offscreen canvas.

On Friday, 31 January 2020 01:40:46 UTC+8, Alon Zakai wrote:
I believe that's not supported currently. I guess the use case is the emscripten program runs in a worker, and you have JS on the main thread that sends it the context, which it needs to render to as an OffscreeCanvas? That does sound potentially useful.

On Wed, Jan 29, 2020 at 4:13 AM raytrace <dawe...@gmail.com> wrote:

// If set to 1, enables support for transferring canvases to pthreads and
// creating WebGL contexts in them, as well as explicit swap control for GL
// contexts. This needs browser support for the OffscreenCanvas specification.
var OFFSCREENCANVAS_SUPPORT = 0;

It sounds OFFSCREENCANVAS_SUPPORT only works with pthread enabled. is it possible to enable it without pthread on web worker using webgl2 rendering?


Thanks,



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/a329887b-f1ad-4313-993f-c4b3278def84%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages