problem with GL commands that run in pthread and they has dependency with each other #17417
Replies: 3 comments
-
Seems like this is general GL problem maybe? See https://stackoverflow.com/questions/22574879/using-the-same-opengl-context-in-multiple-threads |
Beta Was this translation helpful? Give feedback.
-
"OpenGL is not reentrant. If you modify the same context from multiple threads simultaneously, the results are unpredictable. Your application might crash or it might render improperly." |
Beta Was this translation helpful? Give feedback.
-
the context are create for each thread by emscripten_webgl_create_context. |
Beta Was this translation helpful? Give feedback.
-
Hi,
please have a look on the following pseudo code:
it illustrate a real problem when you try to use GL in thread and main thread.
any idea how to solve it will be welcome.
possible execution:
glBindTexture(bind1)
, this command, internally, post and insert the glBindTexture to the main thread queue by emscripten_sync_run_in_main_runtime_threadusleep
that do busy waitglBindTexture(bind1)
that was inserted to the queue by step 1.glBindTexture(bind2)
;glTexImage2D(tex1),
but it is work on bind2 insted of bind 1 !!!!Beta Was this translation helpful? Give feedback.
All reactions