Hi, I’m working on accelerating 2D vector graphics using OpenGL ES.
You can think that of CairoGL, QPainterGL, SkiaGL.
Our off-screen rendering surface should meet following conditions.
- Support OpenGL ES rendering
- Can be bound to OpenGL ES texture with zero copy overhead
- Render target switch must be fast
- Support multi-thread OpenGL ES rendering
What can be render target of OpenGL ES are…
- EGL Window, PBuffer, NativePixmap Surface
For off-screen rendering, candidates are PBuffer, FBO.
- Render : eglCreateContext and then eglMakeCurrent
- Texture : eglBindTexture
- Render : FBO
- Texture : glBindTexture
PBuffer meets condition 1,2, 4 but not 3
So I tested some example for FBO.
- There is one EGL context per thread.
- All EGL context is shared.
- There are one compositor thread and several client thread.
- Create textures from context of compositor thread.
- Each client thread generate FBO and attach texture(from compositor thread) to it.
- Each client thread renders something on that texture.
- Compositor thread map the textures on 3D geometry periodically.
In step 5, glCheckFramebufferStatus report errors.
I concluded that textures which are shared across multiple contexts cannot be bound to FBO.
Thus, FBO meets condition 1, 2, 3 but not 4
Is this true?
Does anyone have better idea on this problem?
Please help me