Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A better way to handle texture scale/cache
06-18-2014, 05:25 PM
Post: #2
RE: A better way to handle texture scale/cache
The basic problem here is that textures are loaded from memory. What else are you going to hash?

If you want to try to figure out when a game is loading textures based on file access or something else, good luck. At best you will end up with an emulator which only supports one or a few games from the same developer, and has lots of problems with any other games.

The PSP itself has no special mechanism for loading textures like OpenGL does. From its perspective, it just needs to know:

Where does the texture start in RAM? __________
What is the size of the texture in texels? ___ x ___ (must be powers of two)
How many texels between each line? ____ (need not be a power of two)
What format is the texture in? _________
Is the texture using a CLUT? [ ] Yes, its format is ___________
Do I need to load the CULT? [ ] Yes, its address is __________
<many other settings dealing with clamp/wrap, UV handling, etc.>

The PSP textures directly from memory. This is great, and why it doesn't need to deal with the problems we have. Unfortunately, there's no way to tell OpenGL to texture directly from memory - we have to provide it with the full texture and update the texture when the memory changes.

Additionally, the PSP supports CLUTs and compressed formats not supported in GLES 2. So we have to also decode these and send them to OpenGL. This means even if it could texture directly from RAM, it couldn't work for these (very common) textures anyway.

It's true that games probably "load" this memory from other places: sometimes other RAM, sometimes files, sometimes functions that generate the texture. All of this is highly game specific (or at least game engine specific.) And, you'll never catch every case.

-[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 05:25 PM

Forum Jump: