hrydgard/ppsspp — pull request #337 by unknownbrackets (2013-01-06 01:34:43+00:00)
Title: Do more texcache checking for sceKernelDcacheWritebackAll()

So, even after I had it mostly working, I found lots of graphics and other text that were not updated properly. The game I was mainly testing with was Unchained Blades and this fixes all the texcache issues in it.

The compromise I came up with was to trigger off the number of `sceKernelDcacheWritebackAll()` calls, and also the size.

When it's been invalidated enough times, it hashes the entire texture. This won't incur the wrath of the GPU upload, and I hope that it's fast / infrequent enough on mobile that it's not a big deal there.

Unfortunately, the game I've been testing at least seems (afaict) to basically create full screen textures, and then just write small font characters to a spot on the texture, and upload (in some places.) So spot checking doesn't cut it after all.

Anyway, with this, a game that uses `sceKernelDcacheWritebackAll()` should have the worst-case scenario of for example showing incorrect textures for e.g. 3 seconds. This will also make it much easier to see when this is an issue.

If this hurts performance, I won't be hurt if you don't merge/revert it.

-[Unknown]