/** * Examine the enabled vertex arrays to set the exec->array.inputs[] values. * These will point to the arrays to actually use for drawing. Some will * be user-provided arrays, other will be zero-stride const-valued arrays. * Note that this might set the _NEW_VARYING_VP_INPUTS dirty flag so state * validation must be done after this call. */ void vbo_bind_arrays(struct gl_context *ctx) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; vbo_draw_method(vbo, DRAW_ARRAYS); if (exec->array.recalculate_inputs) { recalculate_input_bindings(ctx); exec->array.recalculate_inputs = GL_FALSE; /* 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) { /* Setting "validating" to TRUE prevents _mesa_update_state from * invalidating what we just did. */ exec->validating = GL_TRUE; _mesa_update_state(ctx); exec->validating = GL_FALSE; } } }
static void bind_arrays( GLcontext *ctx ) { #if 0 if (ctx->Array.ArrayObj.Name != exec->array.array_obj) { bind_array_obj(ctx); recalculate_input_bindings(ctx); } else if (exec->array.program_mode != get_program_mode(ctx) || exec->array.enabled_flags != ctx->Array.ArrayObj->_Enabled) { recalculate_input_bindings(ctx); } #else bind_array_obj(ctx); recalculate_input_bindings(ctx); #endif }