FBO problem on Powervr Gpus on an android app

This topic contains 5 replies, has 2 voices, and was last updated by  Joe Davis 3 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 advance

    #38353

    Joe Davis
    Member

    Hi,

    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
    glGenRenderbuffers(1, &fbo->z_stencil_buffer);
    glBindRenderbuffer(GL_RENDERBUFFER, fbo->z_stencil_buffer);
    glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height);

    // Bind it all together
    glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
    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.

    Thanks,
    Joe

    #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 reply

    #38355

    Joe Davis
    Member

    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.

    #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)

    #38357

    Joe Davis
    Member

    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?

    Thanks.
    Joe

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.