TINYGL: Last optimization batch, performance comparable to the previous version.

This commit is contained in:
Stefano Musumeci 2014-06-08 19:54:58 +02:00
parent d45c455be4
commit 6c7eaca2eb
8 changed files with 33 additions and 47 deletions

View file

@ -25,18 +25,18 @@ void glopArrayElement(GLContext *c, GLParam *param) {
}
if (states & NORMAL_ARRAY) {
i = idx * (3 + c->normal_array_stride);
c->current_normal.X = (c->normal_array[i]);
c->current_normal.Y = (c->normal_array[i + 1]);
c->current_normal.Z = (c->normal_array[i + 2]);
c->current_normal.W = (0.0f); // NOTE: this used to be Z but assigning Z again seemed like a bug...
c->current_normal.X = c->normal_array[i];
c->current_normal.Y = c->normal_array[i + 1];
c->current_normal.Z = c->normal_array[i + 2];
c->current_normal.W = 0.0f; // NOTE: this used to be Z but assigning Z again seemed like a bug...
}
if (states & TEXCOORD_ARRAY) {
int size = c->texcoord_array_size;
i = idx * (size + c->texcoord_array_stride);
c->current_tex_coord.X = (c->texcoord_array[i]);
c->current_tex_coord.Y = (c->texcoord_array[i + 1]);
c->current_tex_coord.Z = (size > 2 ? c->texcoord_array[i + 2] : 0.0f);
c->current_tex_coord.W = (size > 3 ? c->texcoord_array[i + 3] : 1.0f);
c->current_tex_coord.X = c->texcoord_array[i];
c->current_tex_coord.Y = c->texcoord_array[i + 1];
c->current_tex_coord.Z = size > 2 ? c->texcoord_array[i + 2] : 0.0f;
c->current_tex_coord.W = size > 3 ? c->texcoord_array[i + 3] : 1.0f;
}
if (states & VERTEX_ARRAY) {
GLParam p[5];