GLES 2.0 and context sharing

182 views
Skip to first unread message

Louise Cypher

unread,
Jul 24, 2011, 4:30:17 PM7/24/11
to andro...@googlegroups.com
Hi

Do the gles (2.0) context sharing works on most of the devices that
support gles 2.0 ?
I could not get this to work, i'v digged little in the group archives
- and some users complain about it too, but that was with older
android versions - so meybe any progres there ?

For now (Im still on android 2.3.4 - so no egl calls from native (?)):
my first context is created inside (java) GLSurfaceView and bound to
GLSurfaceView.Renderer rendering thread,
this thread then calls rendering procedure (say its 'RENDER') witch is
in native (c++) and renders the whole frame
-- that part works fine.

Now on the other thread spawned by me (also in java land) i'v created
PBuffer (eglCreatePbufferSurface)
and then called eglCreateContext(... CONTEXT_FROM_GLSurfaceView ...)
... config gets created just fine, i'v
made it current, and called my native (c++) method (say its 'LOADER')
from this thread.

the LOADER consumes some commands and one of those is 'load gles texture'
so in native its gen texture name, glTexImage2D ... etc. no error
here, but then, uppon binding this texture
id to the 'GLSurfaceView.Renderer' context ... glError is raised ...
that the texture id is invalid ...

seems like resources generated on one context are not seen by another
:/ any ideas why ?

I'v tested this so far only on Nexus One.

Anyone succesfully shared resources between two gles contexts (on device) ?

I'm porting some big iOS app to android and i badly need background
resource streaming (on the iOS land they are streamed this way).


--
Code it black!

Olivier Chatry

unread,
Jul 30, 2011, 4:50:16 AM7/30/11
to andro...@googlegroups.com
Hello,

I'm also developing a 3D app that does streaming. What I'm doing is I'm
loading the resources ( meaning uncompressing data, textures, etc ) on
another thread, and 'activating' them ( uploading to the GPU on the
mainthread ). It works really fine, and avoid sharing contexts.


On Sun, 24 Jul 2011 22:30:17 +0200, Louise Cypher <szatan...@gmail.com>
wrote:


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Reply all
Reply to author
Forward
0 new messages