Multiple threads and OpenGL/EGL

635 views
Skip to first unread message

David Given

unread,
Mar 21, 2012, 1:54:05 PM3/21/12
to android-ndk
I am curious about the state of the NDK's handling of threads and OpenGL.

According to the spec, EGL allows multiple threads to each bind to
(different) rendering contexts, and do simultaneous rendering each to
their own context.

In practice I have *never* seen a platform which did this. They either
(a) simply crash if you try to do an EGL/OpenGL operation from the wrong
thread, or (b) ignore the current thread completely and maintain a
single global context.

So far all the Android devices I've seen appear to do (b). Is this
intentional, or just a limitation in the Android common code or the
vendor's OpenGL library? Are there any Android devices which behave
differently? Are there any plans to change the behaviour?

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Parents let children ride bicycles on the street. But parents do not
│ allow children to hear vulgar words. Therefore we can deduce that
│ cursing is more dangerous than being hit by a car." --- Scott Adams

signature.asc

chinlin@tw-roc

unread,
Apr 21, 2012, 11:14:41 AM4/21/12
to andro...@googlegroups.com

In current EGL 1.4 spec, each thread can have at most one current rendering context for each supported
client API ; for example, there may be both a current OpenGL ES context and
a current OpenVG context in an implementation supporting both of these APIs.
In addition, a context can be current to only one thread at a time. The client is
responsible for creating contexts and surfaces.

David Given於 2012年3月22日星期四UTC+8上午1時54分05秒寫道:

F.Stain

unread,
Apr 27, 2012, 7:21:31 AM4/27/12
to andro...@googlegroups.com
Hi David,

Can you expand your question? Did you mean the using of shared contexts or multiple contexts of separate types (one is GL1.1 and the second is GL2.0, for example) ?
What was that Android devices you have seen?
Reply all
Reply to author
Forward
0 new messages