diff options
author | Roland Scheidegger <rscheidegger@gmx.ch> | 2006-10-07 01:04:49 +0000 |
---|---|---|
committer | Roland Scheidegger <rscheidegger@gmx.ch> | 2006-10-07 01:04:49 +0000 |
commit | fa65447d8c3aa4c5e418c567a648dccacfbde0da (patch) | |
tree | ca517504477fb16388ec36e73560f26b61a2fbf5 /src/mesa | |
parent | 524bf7bbcf75bc4887dbc0f2f87ed79a8c44ab20 (diff) |
do not import arrays for generic arb attribs if the array is not enabled (same as for generic attribs for nv vp is already done). Since the requested stride is 16, otherwise the code would end up doing lots of unnecessary import work (in doom3, trans_4_GLfloat_4f_raw caused by that was by far the single most time-consuming function in the r200 driver, not importing the disabled arrays caused the cpu time spent in the driver to drop from 45% to 30%, though real-world gain was pretty minimal as it's not really cpu bound here in the first place).
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/tnl/t_array_import.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0677a1fd3b..13c5689ceb 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -327,9 +327,10 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) } else if (index >= VERT_ATTRIB_GENERIC1 && index <= VERT_ATTRIB_GENERIC15) { - if (program && !program->IsNVProgram) { + const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0; + if (program && !program->IsNVProgram && + ctx->Array.ArrayObj->VertexAttrib[arrayIndex].Enabled) { /* GL_ARB_vertex_program: bind a generic attribute array */ - const GLuint arrayIndex = index - VERT_ATTRIB_GENERIC0; _tnl_import_attrib(ctx, arrayIndex, GL_FALSE, GL_TRUE); VB->AttribPtr[index] = &tmp->Attribs[arrayIndex]; } |