View Full Version : to interleave or not
with my drawing i notice im doing both, which prolly aint ideal.
from my testing interleaved seems slightly (a couple of percent) faster.
but i like sticking the eg verts in a group so i can iterate over them cleaner
*v++ = x; *v++ = y; *v++ = z;
what are others doing?
will interleaved always (within reason) be a few % quicker or are there possible instances where there can be much higher performance benefits
09-25-2007, 06:10 PM
I interleave exclusively. Not necessarily because it's faster or slower, but because it's more convenient for me that way.
09-25-2007, 10:34 PM
For the GPU, I think it's better for the cache if you interleave. There is the other benefit that you don't have to call glBindBuffer for vertex, then normal, then....
On the CPU, it might be better to NOT interleave. It might even be better to have xyzw for SSE coding.
edit : oops, forgot the NOT
09-26-2007, 04:01 AM
I interleave for static meshes (interleaved are faster for the GPU), but separate out the attributes for dynamic meshes so I only have to subdata the attributes that have changed (usually positions).
I think that's a general rule-of-thumb.
09-26-2007, 05:43 AM
I agree with knackered. If you have a static set interleaving is better. If you are working with the data (for example in a modelling application), using non interleaved data and seperate buffers for the VBO for each attribute is the better way to go. Also, using seperate buffers can push your memory limits a littlebit higher as for example allocating a single buffer with 100MB will more often fail compared to allocating 4 buffers with 25MB each if you are low on memory.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.