From fa65447d8c3aa4c5e418c567a648dccacfbde0da Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 7 Oct 2006 01:04:49 +0000 Subject: [PATCH] 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). --- src/mesa/tnl/t_array_import.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0677a1fd3b2..13c5689ceb9 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]; } -- 2.30.2