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!
"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!