Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
Hello, I am reading the iOS guide by Apple for avoiding misaligned data in OpenGL ES. I don't understand. Here is the excerpt from the article that I don't understand:

"When you are designing your vertex structure, align the beginning of each attribute to an offset that is either a multiple of its component size or 4 bytes, whichever is larger."

I think I understand why it must be a multiple of four, is it because iOS has memory granularity of 4, meaning that it can pull 4 bytes in one CPU call (making padding necessary)? Or is this something entirely different? What would be the purpose of making the size of the vertex structure a multiple of the component size? It's my understanding that it still must be a multiple of four to avoid misaligned data due to the granularity of 4.

It's possible that I am completely misinformed, any help is greatly appreciated.

Thanks!
 
ARM processors have 32 bit ( = 4 byte ) wide words... not sure if that's related or not.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.