Slightly reducde the number of calls to glUniformMatrix4fv.

It doesn't make a big difference to bigass1 (yet ?), but it does clean up
apitrace a little.
This commit is contained in:
Bill Currie 2012-07-03 10:57:35 +09:00
parent 1a1b406e5b
commit e170f4ee75
1 changed files with 7 additions and 5 deletions

View File

@ -805,11 +805,13 @@ draw_elechain (elechain_t *ec, int matloc, int vertloc, int tlstloc,
qfeglVertexAttrib4fv (quake_bsp.color.location, color); qfeglVertexAttrib4fv (quake_bsp.color.location, color);
} }
} }
if (ec->transform) { if (ec->elements && ec->elements->list->size) {
Mat4Mult (bsp_vp, ec->transform, mat); if (ec->transform) {
qfeglUniformMatrix4fv (matloc, 1, false, mat); Mat4Mult (bsp_vp, ec->transform, mat);
} else { qfeglUniformMatrix4fv (matloc, 1, false, mat);
qfeglUniformMatrix4fv (matloc, 1, false, bsp_vp); } else {
qfeglUniformMatrix4fv (matloc, 1, false, bsp_vp);
}
} }
for (el = ec->elements; el; el = el->next) { for (el = ec->elements; el; el = el->next) {
if (!el->list->size) if (!el->list->size)