- January 14, 2014 at 12:46 am #31601
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 advanceJanuary 27, 2014 at 12:58 pm #38353
Apologies for the delayed response. Based on the OES_packed_depth_stencil extension spec, I believe the code should be:
fbo->stencil_buffer = 0;
fbo->z_buffer = 0;
// 24-bit Z, 8-bit stencil
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height);
// Bind it all together
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo->color_texture, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
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.
Let us know if you have any more issues after making these modifications.
JoeJanuary 27, 2014 at 1:30 pm #38354
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 replyJanuary 27, 2014 at 2:49 pm #38355
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.January 27, 2014 at 10:49 pm #38356
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)