Outrun 2006 [Vulkan performance issues]
Game or games this happens in
ULES00262 - Outrun 2006
What area of the game
Problem location:
Single player / heart attack mode / Outrun 2006 SP / fourth stage (Left).
Description: During the race there are different missions to win hearts. In the fourth stage going left there is a mission to go through some hoops with fire to win hearts. In this moment the game suffers an abrupt fps drop. Resolution settings, filters, hacks or drivers do not affect the performance (I get 22fps no matter if I use 1X or 5X resolution). This does not happen with OpenGL where the performance is a constant 60fps.
Unfortunately I have no means to generate the adb log.
Speed seen in PPSSPP
32% (22/60 fps)
GE frame capture and debug statistics
No response
Platform
Android
Mobile device model or graphics card (GPU)
Adreno 650
PPSSPP version affected
v1.18.1-1502-gd07d7f7ec4.
Last working version
I can't track down a version where it works well.
Graphics backend (3D API)
Vulkan
Any other notes or things you've tried
No response
Checklist
- [x] Test in the latest git build in case it's already fixed.
- [x] Search for other reports of the same issue.
- [x] Try resetting settings or older versions and include if the issue is related.
- [x] Try changing graphics settings to determine if one causes the slowdown.
- [x] Include logs or screenshots of issue.
https://youtu.be/F_6MSNi6MDo?si=tGNm2i6WEo71hqb8
@Cristobal15 Can you upload a savestate, maybe from around 10 seconds before it happens?
I can confirm the sudden frame drops.
https://github.com/user-attachments/assets/bfd71aaf-68e3-46de-b76a-ae0cd25f4c17
But with psp emulated cpu to 111Mhz can avoid slow down in that particular area.
https://github.com/user-attachments/assets/e4a4fdc2-b8b1-4aa7-8fd3-0f7e9cd18adb
Well, it seems that with 111 it drops from 60 to 30 hz, and then it's able to handle whatever goes slowly there.. so it doesn't really fix it (as the slowness appears to be on the GPU for some reason)
Thanks for providing the save state!
Thanks again for the state. Hm. I'm watching the rendering and our various performance counters when driving through that stretch, and there are two things that stand out:
- We do an absurd amount of texture hashing (to detect changes, but there aren't any), not sure why we detect that some textures need re-hashing every frame but we do, and this is probably fixable. We spend a lot of CPU on that.
- All those clouds create a lot of overdraw. But since resolution changes don't affect performance, this is probably not the cause. I assume you don't have MSAA set to 8x or something...
It's a heavy scene with a lot of draws, but I can't find anything pointing to why Vulkan would be slower, yet... Very odd...
Hm, I am seeing the same behavior on my Galaxy S21 though... OpenGL is using a lot less CPU for some reason.
Playing around with the settings I found a partial solution? By disabling the "hardware transformation" the game returns to its speed and ironically doing it by software is faster even though it spends more CPU as you mention.
https://youtu.be/KRNmUC6eB0A?si=kf1l7nCHlRVJ0rt9
Wow, that is really super strange! Something really unusual is going on here, software transform should practically never be faster...
I tested other games to see if there was the same behavior with the hardware transformation option and with vulkan. In the games I tested indeed the hardware transformation is much faster except in two games "OutRun" and "Motorm Storm" where by disabling the option the fps almost doubles.
Hardware transform
Software transform
Save state
Use the code 60 fps to make the difference more noticeable.
Add this game id to compat.ini [ForceMax60FPS]
Wow, that is really super strange! Something really unusual is going on here, software transform should practically never be faster...
Hi, sorry to bother you here, this problem also appears in LEGO - batman, I'm posting it here because I don't want to fragment the problem.
I tried openGL and it lags intermittently while vulkan is constant, also turning off ‘hardware transform’ doesn't work in LEGO - batman.
Profiled a little bit on PC, and it's much, much faster with hardware transform than with software transform. Strange that it's so different!
Will have to experiment with profiling on Android... been a while since I did that.
I can confirm the sudden frame drops.
XRecorderLite_ppsspp.deafult.settings.mp4 But with psp emulated cpu to 111Mhz can avoid slow down in that particular area.
XRecorderLite.ppsspp.emulated.cpu.111Mhz.mp4
What device do you have? I recently bought a Poco F6 (SD 8sGen2 / Adreno735 / 12G RAM) and the results with Outrun 2006 were very different.
With the SD 8sGen2 there are no FPS drops. Everything works as expected. The hardware transformation is much faster than the software transformation (including in the other games like MotorStorm).
Next I will try to test the behavior on a tablet with SD 680/ Adreno 610/ 8 RAM.
Does anyone have a device with Mali GPU to test if the same thing happens? Maybe the Adreno 6XX GPU series is missing features?
I was able to reproduce this on my Galaxy S21 with Mali, so it's definitely a real problem. I don't understand what could possibly be so slow on the CPU thread in this case... I need to dig into it properly when I have some time.
Messing around with the profiler on Android, I still have no explanation why software transform would be faster.
However this flame effect is using morph heavily, which we don't JIT in the vertex decoder on ARM:
The morphCount used is 4.
Additionally as previously suspected, we're spending a ridiculous amount of time hashing textures. The way we deal with texture hashing will need a re-work in the future.
Hm, noticed that some of these decoder functions are accumulating into (and thus reading from) the destination. That's bad!
There should be a noticeable improvement with #20398. That's enough for 1.19, but there's more to do here so I'm re-tagging to 1.20 instead of closing.
It seems that Android is a problem in itself (no surprise). Indeed the speed improved quite a lot, it's impressive.
Can't blame Android here, it's my mistake, although a really old one that's only noticeable in a few games.