ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

[Android] [Vulkan] Constant FPS drop in Final Fantasy Type-0

Open kage2051 opened this issue 5 years ago • 26 comments

When using 2x or higher rendering resolution and Vulkan backend, I get constant FPS drop in the game mentioned above, even with block transfer effects set to off.

On GL though, I can run it decently as long as I use any resolution not higher than 3x.

Device tested: Redmi Note 6 Pro (SD636, 4GB RAM) Android 9 Latest development build of PPSSPP. Tried going back to stable but it just makes the issue even worse.

Other settings shown below: Screenshot_2020-09-21-21-17-55-806_org ppsspp ppsspp

kage2051 avatar Sep 22 '20 17:09 kage2051

@kage2051 Frame rate comparison for both backends?

Panderner avatar Sep 22 '20 18:09 Panderner

OpenGL, 3x rendering resolution, no texture scaling: Screenshot_2020-09-22-12-28-01-209_org ppsspp ppsspp

Vulkan, 3x rendering resolution, no texture scaling: Screenshot_2020-09-22-12-29-04-712_org ppsspp ppsspp

As you can see, the framerate difference is brutal in that game.

kage2051 avatar Sep 22 '20 18:09 kage2051

That is quite surprising but an interesting find. Needs investigation.

hrydgard avatar Sep 22 '20 20:09 hrydgard

Does by any chance the new option "clear framebuffer on first use" make any measurable difference here?

hrydgard avatar Sep 22 '20 21:09 hrydgard

Does by any chance the new option "clear framebuffer on first use" make any measurable difference here?

That option was checked during the tests to make sure.

kage2051 avatar Sep 22 '20 22:09 kage2051

Another thing that is worth mentioning here: sometimes when Ace (one of the characters) performs a one-hit KO with his card attack, framerate drops to 23 for a second, even on 1x resolution. Also that some non-FMV cutscenes tend to suffer from slight frame drops as well.

All of them reproduced on the same device, independently of the backend used.

kage2051 avatar Sep 25 '20 16:09 kage2051

This game FPS is horrible on PC as well using the Vulkan renderer and an AMD Gpu

ghost avatar Oct 10 '20 07:10 ghost

Is this all through the game? Got a savegame at some particularly bad spot?

hrydgard avatar Oct 10 '20 08:10 hrydgard

You can see it in the beginning of mission 1 so you dont need a save. If you use the OGL backend it will be ok but Vulkan will cause massive FPS drops. Tried this both on Win10 and a LInux distro I have in dual-boot.

ghost avatar Oct 10 '20 08:10 ghost

So the game does a framebuffer copy that gets converted to a readback, as part of a bloom effect. It's a VRAM to VRAM copy, which should be safe enough to convert to an on-GPU framebuffer copy.

hrydgard avatar Oct 10 '20 21:10 hrydgard

That fix will only improve performance with block transfer effects on, so there's probably more work to do.

hrydgard avatar Oct 10 '20 22:10 hrydgard

Did #13541 make any kind of difference? (I'd primarily expect it to make a difference on Mali GPUs on mobile...)

hrydgard avatar Oct 13 '20 08:10 hrydgard

Did #13541 make any kind of difference? (I'd primarily expect it to make a difference on Mali GPUs on mobile...)

No big difference to be honest. I could only play on 1x using Vulkan, while with GL I get 30fps on 3x.

kage2051 avatar Oct 13 '20 15:10 kage2051

I recently enabled the use of reduced-precision math in Vulkan fragment shaders, just like we always had on GL. Did that have any effect here?

hrydgard avatar Nov 15 '20 21:11 hrydgard

I recently enabled the use of reduced-precision math in Vulkan fragment shaders, just like we always had on GL. Did that have any effect here?

It only improved speed a bit on 2x IR, I still get 20fps at the same scene if I increase the resolution to 3x. This is one of those few cases where Vulkan drivers perform worse because they might behave differently from OGL. What's curious though is that on OGL, even with the CPU texture scaling on, I get reasonable speeds in most games as long as they aren't in the same level as GoW.

kage2051 avatar Jan 31 '21 18:01 kage2051

Ok. Could you grab a GE frame dump of a scene where you're getting a large difference between the two APIs? I'd like to take a closer look. Instructions: https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump , then zip it up and drag into a message here.

hrydgard avatar Jan 31 '21 19:01 hrydgard

Results below: OGL: recording_ogl.ppdmp.zip

Vulkan: recording_vulkan.ppdmp.zip

kage2051 avatar Jan 31 '21 19:01 kage2051

Thanks! Will be very helpful when I get back to this issue.

hrydgard avatar Jan 31 '21 20:01 hrydgard

PPSSPP latest git build Using your ge dump Screenshot_2021-05-18-17-05-33-928_org ppsspp ppsspp Vulkan backend Helio G85

ghost avatar May 18 '21 09:05 ghost

The interesting thing would be to compare Vulkan and OpenGL on your device, since the report here is about Vulkan being unexplainably slower..

hrydgard avatar May 18 '21 09:05 hrydgard

OpenGL

Screenshot_2021-05-21-19-34-29-925_org ppsspp ppsspp

Vulkan

Screenshot_2021-05-21-19-34-13-240_org ppsspp ppsspp PPSSPP v1.11.3 Redmi Note 9 Mediatek Helio G85

ghost avatar May 21 '21 11:05 ghost

If you increase the render resolution, is there a point where either slows down? if so, which one (or both)?

hrydgard avatar May 21 '21 13:05 hrydgard

OpenGL 4X Resolution

Screenshot_2021-05-22-00-56-45-047_org ppsspp ppsspp Screenshot_2021-05-22-00-56-37-885_org ppsspp ppsspp

Vulkan 4X Resolution

Screenshot_2021-05-22-00-56-15-990_org ppsspp ppsspp Screenshot_2021-05-22-00-56-07-024_org ppsspp ppsspp Redmi Note 9 default ppsspp settings

ghost avatar May 21 '21 16:05 ghost

Vulkan is stll low fps on this game using the PPSSPP v1.11.3-975

OGL

Screenshot_2021-07-29-15-42-05-589_org ppsspp ppsspp

VK

Screenshot_2021-07-29-15-39-57-679_org ppsspp ppsspp

ghost avatar Jul 29 '21 07:07 ghost

This game performance on vulkan improve now using ppsspp latest development build for android using default settings. Screenshot_2022-04-15-23-18-42-896_org ppsspp ppsspp

ghost avatar Apr 15 '22 15:04 ghost

great!

hrydgard avatar Apr 15 '22 16:04 hrydgard

sorry, is this also an issue? OpenGL 2Xpsp Screenshot_20221026-210147_PPSSPP Screenshot_20221026-210212_PPSSPP

Vulkan 2Xpsp Screenshot_20221026-210024_PPSSPP

or my device is too weak. Samsung M20

IrfanH495 avatar Oct 26 '22 14:10 IrfanH495

Looks to me that there's not much difference in VK vs OpenGL on your device, but neither runs quite fast enough. That's not really an issue on its own, it's just that the game is a little too heavy to emulate for your device....

I think I'm gonna go ahead and close this, as there are no recent reports of OpenGL being drastically faster than Vulkan.

hrydgard avatar Oct 26 '22 14:10 hrydgard

Does the type 0 fixed?? i can't pass through the elevator at the start of mission. it crashes everytime

Xavierneil avatar May 05 '23 01:05 Xavierneil