hello,
could anybody explain why to swizzle textures?
this document explain how to:
http://wiki.pspdev.org/psp:ge_faq
this document explain, that cache consists of 64b chunks. and cache is 8kb like in ps2.
http://goop.org/psp/cache-howto.html
but i dont understand why it's better to rearange texture data THAT way
i understand, that it will have better and not scatter access (so faster), but i want to understand, how the texture in cache is reading and why in that (seems scattered to me) order.
why to swizzle? and how works reading...
that's what is called "swizzling" here is a commonly used technique since 3dfx/voodoo years, there it was called "tiling".
You rearrange the texture data to optimize locality, so that you improve GE texture cache usage (not to confuse with the processor's caches). linear texture filtering and small triangles (the common cases) access very likely texture data of neighboring horizontal pixels and vertical rows of your texture, so it makes sense to keep them close together in memory so that a cache miss will fetch the entire set of soon-to-use data at once.
You rearrange the texture data to optimize locality, so that you improve GE texture cache usage (not to confuse with the processor's caches). linear texture filtering and small triangles (the common cases) access very likely texture data of neighboring horizontal pixels and vertical rows of your texture, so it makes sense to keep them close together in memory so that a cache miss will fetch the entire set of soon-to-use data at once.
ahaaa :) now i understand. thanksholger wrote:that's what is called "swizzling" here is a commonly used technique since 3dfx/voodoo years, there it was called "tiling".
You rearrange the texture data to optimize locality, so that you improve GE texture cache usage (not to confuse with the processor's caches). linear texture filtering and small triangles (the common cases) access very likely texture data of neighboring horizontal pixels and vertical rows of your texture, so it makes sense to keep them close together in memory so that a cache miss will fetch the entire set of soon-to-use data at once.
so, swizzling is trying to keep the neighbourhood data of texels together in clean lines of cache