_mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
src->ArrayObj->ElementArrayBufferObj->Name);
- /* Better safe than sorry?! */
- dest->RebindArrays = GL_TRUE;
-
/* FIXME: Should some bits in ctx->Array->NewState also be set
* FIXME: here? It seems like it should be set to inclusive-or
* FIXME: of the old ArrayObj->_Enabled and the new _Enabled.
void
vbo_bind_arrays(struct gl_context *ctx)
{
- if (!ctx->Array.RebindArrays) {
- return;
- }
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+
+ vbo_draw_method(exec, DRAW_ARRAYS);
- recalculate_input_bindings(ctx);
- ctx->Array.RebindArrays = GL_FALSE;
+ if (exec->array.recalculate_inputs) {
+ recalculate_input_bindings(ctx);
+
+ /* Again... because we may have changed the bitmask of per-vertex varying
+ * attributes. If we regenerate the fixed-function vertex program now
+ * we may be able to prune down the number of vertex attributes which we
+ * need in the shader.
+ */
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+
+ exec->array.recalculate_inputs = GL_FALSE;
+ }
}
vbo_bind_arrays(ctx);
- vbo_draw_method(exec, DRAW_ARRAYS);
-
- /* Again... because we may have changed the bitmask of per-vertex varying
- * attributes. If we regenerate the fixed-function vertex program now
- * we may be able to prune down the number of vertex attributes which we
- * need in the shader.
- */
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
/* init most fields to zero */
memset(prim, 0, sizeof(prim));
prim[0].begin = 1;
return;
}
- vbo_bind_arrays( ctx );
-
- vbo_draw_method(exec, DRAW_ARRAYS);
-
- /* check for dirty state again */
- if (ctx->NewState)
- _mesa_update_state( ctx );
+ vbo_bind_arrays(ctx);
ib.count = count;
ib.type = type;
return;
}
- /* Decide if we can do this all as one set of primitives sharing the
- * same index buffer, or if we have to reset the index pointer per
- * primitive.
- */
- vbo_bind_arrays( ctx );
-
- /* check for dirty state again */
- if (ctx->NewState)
- _mesa_update_state( ctx );
+ vbo_bind_arrays(ctx);
min_index_ptr = (uintptr_t)indices[0];
max_index_ptr = 0;
vbo_bind_arrays(ctx);
- /* Again... because we may have changed the bitmask of per-vertex varying
- * attributes. If we regenerate the fixed-function vertex program now
- * we may be able to prune down the number of vertex attributes which we
- * need in the shader.
- */
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
/* init most fields to zero */
memset(prim, 0, sizeof(prim));
prim[0].begin = 1;