Emulator Issues #7750
closedSafe Texture Cache is extremely demanding
0%
Description
Game Name?
Too many to really list, but I have a few examples.
Castlevania III (VC) - FEQE01
Pokemon XD Gale of Darkness - GXXE01
The Legend of Zelda: Twilight Princess - GZ2E01
New Super Mario Bros. Wii - SMNE01
And hundreds of others.
What's the problem? Describe what went wrong in few words.
A lot of games require the safe texture cache option for the game to be emulated properly. Even when they don't, using this option causes an extremely high loss of performance in most situations. While this greatly varies, sometimes as little as a small hit, sometimes a ridiculous hit that can bring any computer to their knees.
Castlevania III for the NES Virtual Console goes from 300+ fps to under 50 fps, for example. You can determine this just by opening up the game and playing with the cache settings.
Pokemon XD and Colosseum is similar. A Shadow Pokemon showing up can drop the framerate way, way down. It turns a very smooth experience into one that can be plagued with crashes due to dualcore desyncs.
Twilight Princess's map needs safe texture cache, and can be a huge drain mixed with EFB2Ram!
This has been a Dolphin problem for as long as the emulator has existed, but there are possible solutions that can be done to help this. These include using a GPU texture decoder, the hashless branch, the locking WIP branch, among other ideas.
The ultimate goal would to have a solution that doesn't need texture cache settings whatsoever.
What are your PC specifications? (including, but not limited to: Operating
System, CPU and GPU)
Core i5 3570K, GTX 760, Radeon HD5850, Windows 7 x64
Updated by rigation over 10 years ago
Maybe a stupid question: often games only need the medium setting of texture caching (that is much faster than the safe setting), but in the game.ini is always put the safe texture caching no matter if it is really needed or not...why?
Updated by JMC4789 over 10 years ago
Medium works okay in a lot of games that require safe, but they still don't work correctly. For that extra boost to accuracy, safe is used.
For an example where medium works fine, Starfox Assault uses medium in the INI.
Updated by JMC4789 over 10 years ago
Fiora's faster hashing code helps a lot, but I'm not ready to close this issue until we can get it even better.
Updated by mimimi over 10 years ago
Some info i found out by staring at the code:
safe setting = 0
medium setting = 512
fast setting = 128
But what does that mean? Well for medium and fast it means that the algorithm calculates the hash with 512 or 128 pieces of the data, with each piece being 64 bit in size. So the fast setting actually calculates the hash for every texture with just 1 KB of its data, no matter its size, and the medium setting uses 4 KB. This results in the fast setting being 4 times faster than the medium one.
The safe setting(0) is taken out with an if, and forces the algorithm to calculate the hash with all the data.
So how does this info help? Well, it explains the huge speed difference between the safe and medium that can happen in some games. Hashing 10 times more data, or even more, is possible there.
Now add the fact that the .ini settings don't force the value to be 0,512 or 128 and then we get? - Trying a higher number for games where:
- the medium setting is way more than fast enough to play the game
- the medium setting still has glitches
- the safe setting is unplayable slow
TLDR: Use 1024, 2048 or 4096 in the .ini file for iSafeTextureCache_ColorSamples(or what's it called in the .ini), for games where safe caching is too slow and medium has bugs.
Hope this helps a bit
Updated by rigation over 10 years ago
I think 512 is safe setting, not medium...
Updated by comexk over 10 years ago
hashless. please, someone other than me do it and stop messing with useless hashes
Updated by rigation over 10 years ago
If I don't remember wrong the problem of the old hashless branch (2012?) was that you had to use copy to RAM in order to get rid of the problems that actually medium or safe cache fixes
Updated by degasus over 10 years ago
We could add an option to not rehash textures until a cache invalidation command was given. This would likely speed this up much, but I'm pretty sure it will break some games.
@JMC47: why does the ztp minimap require the safe hash? Do you use efb2ram cache?
Updated by JMC4789 over 7 years ago
- Status changed from Accepted to Fixed
The latest batch of fixes have made it so Safe Texture Cache isn't as demanding again. It's actually quite speedy in most cases, but, still slower than fast.
The main reason I made this issue was to complain about a game being slow, and that game isn't slow. Other settings like EFB2RAM remain bigger slowdowns... so this isn't really necessary any more.