PDA

View Full Version : FBO with shared texture



podain
08-19-2010, 10:53 PM
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.
1. Support OpenGL ES rendering
2. Can be bound to OpenGL ES texture with zero copy overhead
3. Render target switch must be fast
4. Support multi-thread OpenGL ES rendering

What can be render target of OpenGL ES are...
- EGL Window, PBuffer, NativePixmap Surface
- FBO

For off-screen rendering, candidates are PBuffer, FBO.

PBuffer
- Render : eglCreateContext and then eglMakeCurrent
- Texture : eglBindTexImage

FBO
- Render : FBO
- Texture : glBindTexture

PBuffer meets condition 1,2, 4 but not 3
So I tested some example for FBO.

1. There is one EGL context per thread.
2. All EGL context is shared.
3. There are one compositor thread and several client thread.
4. Create textures from context of compositor thread.
5. Each client thread generate FBO and attach texture(from compositor thread) to it.
6. Each client thread renders something on that texture.
7. Compositor thread map the textures on 3D geometry periodically.

This works very fine on MS windows XP with my 9500GT nVidia driver. But do not work on OpenGL ES 2.0, EGL 1.4 on SGX5XX.
In step 5, glCheckFramebufferStatus report errors.
I concluded that textures which are shared across multiple contexts cannot be bound to FBO on embedded platforms.
Thus, FBO meets condition 1, 2, 3 but not 4
Is this true?
Does anyone have better idea on this problem?

Please help me
Thank you!!

Alfonse Reinheart
08-20-2010, 12:15 AM
This is not really an OpenGL ES forum. You should probably ask this question on the Khronos forum. But if ES works like regular GL, the specification does not require implementations to thread rendering.


In step 5, glCheckFramebufferStatus report errors.
I concluded that textures which are shared across multiple contexts cannot be bound to FBO on embedded platforms.

On the basis of what did you conclude this? Did glCheckFramebufferStatus return GL_FRAMEBUFFER_UNSUPPORTED, or did it return an error code that you could fix? (http://www.opengl.org/wiki/Framebuffer_Object#Completeness_Rules)

podain
08-20-2010, 03:57 AM
My EGL implementation does not support context sharing at all...
It's not a problem of FBO with shared texture.
Sorry for the confusion.
Anyway thanks for your reply Alfonse!!