c++ - Sharing Rendering Surfaces (FrameBuffers, Pbuffers, etc.) between OpenGL ES 2 Applications/Processes -
i'm designing opengl es 2.0-enabled applications on arm-based, embedded linux system using c++ , want share rendering surface (fbo or renderbuffer generated opengles2 or pbuffer created egl) of app "a" app "b".
since i'm beginner opengl es 2 (and, more importantly, since buffers on gpu's memory on have no control nor access), first thought of mapping shared memory object (e.g. uint8_t
array of length width*height*colorcomponentcount
, using posix shm_open()
etc.) between 2 processes , periodically calling glreadpixels()
on app "a" filling uploading in app "b" as, instance, 2d texture. of course, shared synchronization mechanism, such named semaphore, used well, not point of question:
i aware downloading buffer gpu (i.e. glreadpixels()
in app "a") , uploading (i.e. texture 2d in app "b") not optimal solution sharing rendering surfaces between opengl es applications, why know if there better solution ?
the glreadpixels() approach way in portable, platform independent way opengl es 2.0 , incredibly slow. pixmaps allocated egl (not pbuffers) if platform implemented them.
i recommend either:
implement apps share common instance of opengl es somehow , use fbos texture attachments share images. if need portability.
or, customize linux platform provide support either @ kernel level or customized egl implements pixmap support. these articles fbos , egl image extension:
http://montgomery1.com/opengl/
Comments
Post a Comment