Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.42 (6ede0b8)
clang version 17.0.0 (https://github.com/llvm/llvm-project f3b64887de61020c09404bfee97b2fadd30df10a)
Target: wasm32-unknown-emscripten
Thread model: posix
Functions in library_egl.js do have the attribute __proxy: 'sync' on all methods. I had to add the OFFSCREEN_FRAMEBUFFER=1 to make the GLctx variable have a value. But after fixing the initial issue, I realized that the methods in library_webgl.js needed the same logic, to have the suffix __proxy: 'sync' in order to work and have a valid GLctx too. After manually changing all symbols, the application I'm building found the GLctx variables correctly.
Is there a reason not to follow the same approach as other GL/EGL symbols?
Still, my application needs to access other GL/EGL symbols like glClear, which are proxied directly to the C function and no js definition is found, so I can not do the __proxy: 'sync' trick. Can you advise how to proceed?
The application I'm building, in theory, proxies all calls to GL/EGL to a single thread, the same as what OFFSCREEN_FRAMEBUFFER=1 is doing so I guess I wouldn't need it, but still, I had to force it. Maybe is a problem on my side on how the multiple threads detect if they are on the GL thread or not, but in the meantime I was wondering in the above questions. Thanks for your help.
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.42 (6ede0b8)
clang version 17.0.0 (https://github.com/llvm/llvm-project f3b64887de61020c09404bfee97b2fadd30df10a)
Target: wasm32-unknown-emscripten
Thread model: posix
Functions in library_egl.js do have the attribute __proxy: 'sync' on all methods. I had to add the OFFSCREEN_FRAMEBUFFER=1 to make the GLctx variable have a value. But after fixing the initial issue, I realized that the methods in library_webgl.js needed the same logic, to have the suffix __proxy: 'sync' in order to work and have a valid GLctx too. After manually changing all symbols, the application I'm building found the GLctx variables correctly.
Is there a reason not to follow the same approach as other GL/EGL symbols?
Still, my application needs to access other GL/EGL symbols like glClear, which are proxied directly to the C function and no js definition is found, so I can not do the __proxy: 'sync' trick. Can you advise how to proceed?
The application I'm building, in theory, proxies all calls to GL/EGL to a single thread, the same as what OFFSCREEN_FRAMEBUFFER=1 is doing so I guess I wouldn't need it, but still, I had to force it. Maybe is a problem on my side on how the multiple threads detect if they are on the GL thread or not, but in the meantime I was wondering in the above questions. Thanks for your help.