Skip to content

add asyncify into gl_in_pthread.cpp #12572

@spoon-vertiv

Description

@spoon-vertiv

So the gl_in_pthread.cpp never worked for me. it would always SNAP instantly to red instead of fade to red. It was only recently when I examined gl_in_proxy_pthread.cpp did I realize why. calls like this

while(emscripten_get_now() - now < 16) /no-op/;

were basically blocking the opengl updates from occuring? at least i think that's the reason. In order to fix this example for me you would only need to add the asyncify reference similar to the gl_in_proxy_pthread.cpp example... so

replace on line 55
double now = emscripten_get_now();
while(emscripten_get_now() - now < 16) /no-op/;

with this.
#if ASYNCIFY
emscripten_sleep(16);
#else
double now = emscripten_get_now();
while(emscripten_get_now() - now < 16) /no-op/;
#endif

and of course add the appropriate asyncify options to the test_browser.py .
-s ASYNCIFY -DASYNCIFY
somewhere....

This would fix the example for me and maybe help others?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions