Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A better way to handle texture scale/cache
06-18-2014, 11:04 PM (This post was last modified: 06-18-2014 11:05 PM by [Unknown].)
Post: #4
RE: A better way to handle texture scale/cache
Right, at least not for most textures. For simple full screen ones it might work out, but it may cost and slow down games like Tales of Phantasia X which hit the software transform path a lot and generally don't have this problem.

If the goal is just higher definition textures, maybe a better option is texture replacement. We could have definitions that allow e.g. a texture at a specific address to be replaced, or even to specify the size of bytes at that address to hash. That is:

Code:
auto replacements = replaceMap.find(cacheKey);
if (replacements != replaceMap.end()) {
    std::map<u32, u32> hashes;
    for (auto replacement : replacements->second) {
        if (hashes.find(replacement.size) == hashes.end()) {
            hashes[replacement.size] = ReplaceTexHash(texaddr, replacement.size);
        }
        if (hashes[replacement.size] == replacement.hash) {
            SetReplacedTexture(replacement);
            return;
        }
    }
}

But that would naturally be a very high-maintenance (for humans, not meaning code) way of maintaining replaced texture sets.

-[Unknown]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: A better way to handle texture scale/cache - [Unknown] - 06-18-2014 11:04 PM

Forum Jump: