FBO problem on Powervr Gpus on an android app

There is an app for android called PPSSPP(psp emulator)

One of it’s feautres is called buffered rendering wherein it allocates an OpenGL fbo for every Psp framebuffer location

On other gpus,it’s perfect

On all powervr gpus,many things are missing(specifically,stencil is not correctly rendered using this mode)

The error is most likely found in the fbo setup in the fbo.cpp

For detailed info, go here forums.ppsspp.org/showthread.php?tid=8479r

If you want to browse the code in fbo.cpp,go here https://github.com/hrydgard/native/blob/master/gfx_es2/fbo.cpp

If you want to make a ppsspp modified apk with fixes,download sources(including the native and ffmpeg) herehttps://github.com/hrydgard/ppsspp

If the problem is not in the fbo.cpp in the native,it is most likely in the framebuffer.cpp

THE devs of the app are very puzzled why this is happening,so I was hopinh some of you might help

Thanks in advance


Apologies for the delayed response. Based on the OES_packed_depth_stencil extension spec, I believe the code should be:

fbo->stencil_buffer = 0;<br />
fbo->z_buffer = 0;<br />
// 24-bit Z, 8-bit stencil<br />
glGenRenderbuffers(1, &fbo->z_stencil_buffer);<br />
glBindRenderbuffer(GL_RENDERBUFFER, fbo->z_stencil_buffer);<br />
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height);<br />
<br />
// Bind it all together<br />
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);<br />
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo->color_texture, 0);<br />
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);<br />
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
```<br />
<br />
Note that I've removed the 'EXT' and '_EXT' parts as the functions and most arguments are core in OpenGL ES 2.0. For best performance, you should also avoid changing framebuffer attachments or sharing attachments across FBOs.<br />
<br />
Let us know if you have any more issues after making these modifications.<br />
<br />
Thanks,<br />

THANK YOU VERY much for your reply

but errr,what was ur change?

i’m sorry cos i cant see the changes when compare here https://github.com/hrydgard/native/blob/master/gfx_es2/fbo.cpp

though i appreciate the effort

Due note that fbo.cpp is also used on windows which explains everything about the EXT

Also note that it is the second half of the code that corresponds to android while the first part(with the ext)corresponds to windows.So by removing the EXT bits,the code is now the same with the second part which in reality does not do anything to the problem.Also check out the Framebuffer.cpp and shadergenerator file in github ppsspp https://github.com/hrydgard/ppsspp/tree/master/GPU/GLES,thanks

Hope for a reply

Ah, sorry. I saw the first code block using packed depth+stencil, and didn’t think to check the rest of the file…

You’re right. The code I’ve suggested is the same as the block that’s already there.

Are attachments always unique to each FBO?

Which PowerVR devices have you reproduced the issue on? Are there any PowerVR devices where the error doesn’t occur?

I’ll clone the source now so I can take a proper look at it.

AFAIK,each fbo needa all attachments

AFAIK,it happens to all POwer vr devices

Also,its best to also make contact to the sole dev of the app(email found on the above links)

Sorry for going quiet. I haven’t had a chance to revisit this problem. Do you know if the developers are actively investigating the issue?