forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

why to swizzle? and how works reading...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
outtony



Joined: 13 Oct 2005
Posts: 26
Location: Slovakia

PostPosted: Thu Oct 13, 2005 6:59 pm    Post subject: why to swizzle? and how works reading... Reply with quote

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.
_________________
-----------------------------
Tony

www.n3.sk
Back to top
View user's profile Send private message Send e-mail Visit poster's website
holger



Joined: 18 Aug 2005
Posts: 204

PostPosted: Thu Oct 13, 2005 7:25 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
outtony



Joined: 13 Oct 2005
Posts: 26
Location: Slovakia

PostPosted: Thu Oct 13, 2005 7:31 pm    Post subject: Reply with quote

holger 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.


ahaaa :) now i understand. thanks

so, swizzling is trying to keep the neighbourhood data of texels together in clean lines of cache
_________________
-----------------------------
Tony

www.n3.sk
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group