@hrydgard
I noticed that some of my saved states didn't even have a screenshot! But I can swear I never deleted the images! They probably were never created! (3 of which are from the 3rd Birthday)
I noticed that Patapon has images but they appear black in the menu:

Here are the screenshots:


This one is black and from Assassin's Creed:

They all appear blank (not black!) in savedata manager.



What hardware and operating system are you running PPSSPP on? GPU might matter if it's a graphical issue.
Android 7.0
Vulkan
Snapdragon 821
Can confirm this, sometimes, my Birth by Sleep savestate images are just...gone? Sometimes. I don't know how it happens. For now, it hasn't happened recently, perhaps a recent build did this?
Specs in: http://steamcommunity.com/id/AkiraPlays
There is also a bug where the screenshots disappear if you switch away from the emulator and back on Android, but I'm fixing that in #10816.
Weird. Because this happens to me too sometimes on Windows. I didn't know this was a Android problem too.
Yeah i have this too, but when i use skip buffer effect
I dont have it when I use buffered rendering
Maybe this help?
Could be. But in some of my games like Patapon I'm using buffered rendering and this still happens.
If you browse into the PSP/PPSSPP_STATE/ folder, do the images show up there (via a file browser), or no?
-[Unknown]
Perhaps you didn't read my post carefully:
some of my saved states didn't even have a screenshot...3 of which are from the 3rd Birthday.
Other screenshots that you see have been uploaded directly from PSP/PPSSPP_STATE/.
@hrydgard
This ain't fixed yet!
@leopard20 Did I say it was?
Sorry! I thought you said in https://github.com/hrydgard/ppsspp/pull/10816 that it'll fix this too. 馃槥
Sorry, it wasn't clear from that comment if the screenshots just weren't visible or if the files weren't created.
To confirm:
Save states run all their operations together when running the CPU:
https://github.com/hrydgard/ppsspp/blob/70481c9444fa1f9abf00cdcec20e60423a9ad35d/Core/System.cpp#L410
And this just uses the display:
https://github.com/hrydgard/ppsspp/blob/0843e2cb980793b00e49a3dd5907b48249758928/GPU/GPUCommon.cpp#L2590
But, I could imagine this happening if you do the following:
In this scenario, the FBO won't exist, and the memory will likely be outdated, so I can definitely see it failing to screenshot or saving black.
That wouldn't happen on Windows, though. However, it might happen on Windows if the save state is queued mid frame, and PSP_RunLoopUntil is called while the FBO is blank (e.g. because the last PSP_RunLoopUntil ended before CORE_NEXTFRAME?)
-[Unknown]
@unknownbrackets
Following the four steps you mentioned caused the screenshots not to be saved, which was obvious.
I noticed a missing screenshot on Windows too, which might have been because of what you said.
I tested the latest version on Android and in many games but didn't encounter any issue in saving screenshots. It might've been a bug in v1.5.4 because all of those states were saved via that version. (maybe because of the memory leak issue I once mentioned because I save and load states a lot and maybe saved a state when my memory was full)
The only thing that still remains is the above screenshots not appearing in pause menu or savedata manager.
One question though. How can I restore a backup saved state? (minus the manual rename method!)
Well, it happened some time ago, a few builds ago, I don't remember which, but it DID happen to me sometimes while using the Windows version of PPSSPP.
I used the steps you suggested, and here is the result in different games:
Monster Hunter - 1st: Windowed Mode, Minimize, Return, Savestate - 2nd: Fullscreen, Desktop, Return, Savestate - 3rd: Fullscreen, Alt Tab, Return, Savestate
https://i.imgur.com/JFUI7do.png
Kingdom Hearts BBS FM - Same thing, but only once with the last savestate...

I guess the problem was fixed on Windows? Maybe it's prolonged playtime?
This is happen to me if I change to skip buffered rendering only. Other than that, Nothing is wrong with the screenshot if I choose buffered rendering
This happened to me before despite using skip buffer effects or using buffered rendering. So I don't think that is the issue.
I suppose it might also happen if you change the rendering mode or certain other settings, and then without resuming the game beforehand, create a save state.
Basically, the save state won't currently include a screenshot if graphics are reset immediately before saving it. On Windows, this doesn't occur when switching apps, but it does when changing certain settings. On Android, this occurs when switching apps and when changing certain settings.
-[Unknown]
@unknownbrackets
Another thing that makes the screenshots appear black in the UI is app update (this is the case with those black patapon screenshots). If I revert to the version they were created with, they display correctly.
It seems it's not the case with the latest builds though. Might've been a bug that's fixed now.
I suppose what we could do to fix this is, if there are no framebuffers, defer creating the screenshot until the very next frame. That would handle the majority of cases without impacting the actual save state.
The other option is deferring the entire save state, but that kinda impacts debugging...
-[Unknown]