[journal] Always pad our vertex data as if at least 2 layers are enabled
authorRobert Bragg <robert@linux.intel.com>
Wed, 10 Jun 2009 12:59:45 +0000 (13:59 +0100)
committerRobert Bragg <robert@linux.intel.com>
Tue, 30 Jun 2009 16:13:34 +0000 (17:13 +0100)
commit40cfaeaffc9b744d99c21c1e6cd5b57e358ff37a
tree57e299e3f6fbc256827a42d6ba2357e751ba25b9
parent845ff67301da767926f96c56026a8dd9c7964f01
[journal] Always pad our vertex data as if at least 2 layers are enabled

The number of material layers enabled when logging a quad in the journal
determines the stride of the corresponding vertex data (since we need a set
of texture coordinates for each layer.) By padding data in the case where we
have only one layer we can avoid a change in stride if we are mixing single
and double layer primitives in a scene (e.g.  relevent for a composite
manager that may use 2 layers for all shaped windows) Avoiding stride
changes means we can minimize calls to gl{Vertex,Color}Pointer when flushing
the journal.

Since we need to update the texcoord pointers when the actual number of
layers changes, this adds another batch_and_call() stage to deal with
glTexCoordPointer and enabling/disabling the client arrays.
clutter/cogl/common/cogl-primitives.c