The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debugging the Buffered Rendering Issue on Power VR gpus
01-12-2014, 11:48 AM (This post was last modified: 01-12-2014 12:11 PM by mckimiaklopa.)
Post: #1
Information Debugging the Buffered Rendering Issue on Power VR gpus
If this is a dupe,then I'm sorry since this post is long
This is for PPSSPP devs

As of now,there are still some issues on buffered rendering on Power Vr eg.missing objects etc....
For the last few weeks ,I"ve tried finding out the reason why it happens

The ppsspp build that got closest to fixing the issue was 0.9.1-2300-g60d0f2.It's change was an fbo setup bug fix for the native.More can be seen here

COMMIT FBO

Specifically,it added the line
glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer); to the file fbo.cpp

although it fixed some things,it caused heaps of other problems.

Through the use of logging,I thought the main culprit was the lack of "fbo sharing depthbuffer"........I even sent Henrik a document describing the whole thing.Turns out,It was because of something different(I feel ashamed)

For the past few days,I started to test different self-compiled ppsspp wherein I changed the "glFramebuffer(GL........" line

For better description of results,I attached screenshots of DISSIDIA 012.All of the images captures portrayed buffered rendering on power vr except for the pic"non buffered.png"

Results:
A.)GL_DEPTH
   
line used"glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer); }"

description:character models missing,otherwise ok

B.)GL_STENCIL
   
line used:"glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
}"

Description:Character models are now visible,but notice how the forest found at the back of the mountain overlaps the front of the mountain

C.)GL_DEPTH and GL_STENCIL(the configuration being used on currect revisions of PPSSPP)

   
line used:" glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
- glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
}"

description:Its perfect on most mobile gpus,but on power vr,the result is the same as A.).Its as if stencil is absent/not correct

D.)GL_DEPTH_STENCIL(what is used in 0.9.1-2300-g60d0f2)

   
line used:"glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);
}"
description:On all gpus including powervr,the result is the same as B.).
It's as if depth is absent/not rendered correctly

the last pic is how the scene is supposed to look like
   
Summary on testing:
It seems that character model rendering On DISSIDIA 012 is dependent on stencil (assuming that buffered rendering is used)



So for some reasons,using both GL_STENCIL_ATTCHMENT and GL_DEPTH_ATTACHMENT on powervr buffered rendering refuses to render both depth and stencil correctly at the same time leaving to only render the depth correctly

whereas using GL_DEPTH_STENCIL_ATTACHMENT refuses to render depth on all mobiles

Even though the code in fbo.cpp looks flawless,it seems that there are still a bunch of things to fix and/or to optimize.(Especially since using GL_DEPTH_STENCIL_ATTATCHMENT IS SUPPOSED TO WORK ON MOBILE PLATFORMS)



Anyways,the way I'm seeing it,the only way to the remaining buffered rendering bugs on powervr is:

1.use GL_DEPTH_STENCIL_ATTACHMENT and from then on,optimize,fix the existing code


as mentioned,using " glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer);" is supposed to work properly on mobile gpus,but of course it currently does not work on ppsspp.

I read somewhere that for GL_DEPTH_STENCIL_ATTACHMENT to work properly,the image format must be in packed_depth_stecil.I observed the fbo.cpp file numerous times,but it seems that the images are in the right format(then again,I might be wrong).I'm pretty sure that we are missing something in fbo.cpp or that something is not formatted properly in the fbo setup (such as format of image etc.).

By the way,I read somewhere that ios devices prior to iphone 4 had a specific configuration for FBO's to work and render properly.Seems to have a connection to the current problem since most ios devices use powerVR(than it again,it might just be the ios version).Therefore,another proposed solution is:
2.Write a new fbo code specifically for Powervr gpus.
Doing the two will work assuming that the culprit lies on the FBO setup
Do note that that the read framebuffers to cpu/gpu options is perfect except for minor issues and the huge slowdown(which was absent on old builds),so maybe you could try taking pointers for fixing the problem from there

the above suggestions will work only if the issue truly lies in the FBO setup
Powervr gpus can handle fbos correctly,so theoretically speaking,this issue will be solved someday

I don't have much background from OpenGL or C++ ,so info from here can either be a huge revelation or a stupid lie.


I've sent Henrilk an email about everything in this post but i decided to share it to all of you.I hope I receive a reply from him and hopefully,he'll start trying to solve th issue again but if not,I completely understand(compiling a ppsspp apk a hundred times is complete torture especially if nothing new happens)

If you have some insights,maybe you could help

You may ask Why I want buffered rendering to be fixed on power vr.Well ,bec:
1.Some games require it
2.From what I observed on my power vr device,Buffered rendering is so much faster than non buffered rendering
3.I prefer accurate graphics over upscaled graphics

writing all this,I honestly feel guilty posting nonsencial posts saying "Power Vr has blah blah blah issues" or "Fix the ****power vr issue now" and that's why I apologize
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Debugging the Buffered Rendering Issue on Power VR gpus - mckimiaklopa - 01-12-2014 11:48 AM

Forum Jump: