emscripten-core / emscripten-core/emscripten

Using OffscreenCanvas with Webgl

Open
#23,806 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Need a help on webgl use case. We have a cpp ui application written using opengl (backed by skia) where actual opengl calls happen in a separate thread (say rendering thread). The rendering thread actuallys run an infinite loop, receiving messages from other threads and regularly makes opengl calls accordingly. While compiling to Wasm using emscripten, we created canvas and used transferControlToOffscreen API to hand over the control to the rendering thread. But, I always see blank screen though webgl calls are made. I suspect the behavior is because webgl calls are made out of sync with the JS event loop. The reason being, if i put a break point in any of the webgl calls in inspector, the frame renders properly once it reaches break point. Can someone help me on this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.