Re: [PATCH] gl: Draw image surface to fbo gl surface using intermediate texture
Dongyeon Kim <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <2655770.241821353052310922.JavaMail.weblogic@epv6ml02> |
It is fine to set the FBO content using glTex(Sub)Image2D before the texture is bound to the framebuffer. But what the current implementation does is that after the texture has been bound to the framebuffer to be the rendering target, cairo again binds the same texture as the rendering source and uploads data. As I know this falls into a rendering feedback loop. According to the OpenGL ES spec, a feedback loop may exist when a texture object is used as both the source and destination of a GL operation, and when a feedback loop exists, undefined behavior results. I will check again whether this is the driver-specific issue. Thanks ------- Original Message ------- Sender : Eric Anholt<[email protected]> Date : 2012-11-16 15:42 (GMT+09:00) Title : Re: [cairo] [PATCH] gl: Draw image surface to fbo gl surface using intermediate texture Dongyeon Kim writes: > Hello, > > When I create an image surface from png, and use this surface as > source to paint to cairo gl surface that is created using FBO, the > resulting gl surface is just black. > > I have spent some time investigating this, and found that cairo was > uploading data to the texture that is currently being used as target > framebuffer. > > To fix this problem, image data should be uploaded to an intermediate > texture, and this texture should be rendered into the FBO. > > The following patch is a suggested fix for both gl-spans and gl-traps > compositors. Huh? Using glTexImage to set the contents of an FBO sounds perfectly legal and should have expected behavior. This sounds like a driver bug. -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo