* structures. */
static int
-get_array_stride(struct gl_context *ctx, const struct gl_vertex_array *a)
+get_array_stride(struct gl_context *ctx, const struct tnl_vertex_array *a)
{
struct nouveau_render_state *render = to_render_state(ctx);
const struct gl_vertex_buffer_binding *binding = a->BufferBinding;
static void
vbo_init_arrays(struct gl_context *ctx, const struct _mesa_index_buffer *ib,
- const struct gl_vertex_array *arrays)
+ const struct tnl_vertex_array *arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
GLboolean imm = (render->mode == IMM);
}
FOR_EACH_BOUND_ATTR(render, i, attr) {
- const struct gl_vertex_array *array = &arrays[attr];
+ const struct tnl_vertex_array *array = &arrays[attr];
const struct gl_vertex_buffer_binding *binding =
array->BufferBinding;
const struct gl_array_attributes *attrib = array->VertexAttrib;
static void
vbo_deinit_arrays(struct gl_context *ctx, const struct _mesa_index_buffer *ib,
- const struct gl_vertex_array *arrays)
+ const struct tnl_vertex_array *arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
int i, attr;
/* Make some rendering decisions from the GL context. */
static void
-vbo_choose_render_mode(struct gl_context *ctx, const struct gl_vertex_array *arrays)
+vbo_choose_render_mode(struct gl_context *ctx, const struct tnl_vertex_array *arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
int i;
}
static void
-vbo_emit_attr(struct gl_context *ctx, const struct gl_vertex_array *arrays,
+vbo_emit_attr(struct gl_context *ctx, const struct tnl_vertex_array *arrays,
int attr)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct nouveau_render_state *render = to_render_state(ctx);
- const struct gl_vertex_array *array = &arrays[attr];
+ const struct tnl_vertex_array *array = &arrays[attr];
const struct gl_vertex_buffer_binding *binding = array->BufferBinding;
const struct gl_array_attributes *attrib = array->VertexAttrib;
const GLubyte *p = _mesa_vertex_attrib_address(attrib, binding);
#define MAT(a) VERT_ATTRIB_MAT(MAT_ATTRIB_##a)
static void
-vbo_choose_attrs(struct gl_context *ctx, const struct gl_vertex_array *arrays)
+vbo_choose_attrs(struct gl_context *ctx, const struct tnl_vertex_array *arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
int i;
}
static int
-get_max_client_stride(struct gl_context *ctx, const struct gl_vertex_array *arrays)
+get_max_client_stride(struct gl_context *ctx, const struct tnl_vertex_array *arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
int i, attr, s = 0;
FOR_EACH_BOUND_ATTR(render, i, attr) {
- const struct gl_vertex_array *a = &arrays[attr];
+ const struct tnl_vertex_array *a = &arrays[attr];
if (!_mesa_is_bufferobj(a->BufferBinding->BufferObj))
s = MAX2(s, get_array_stride(ctx, a));
static void
TAG(vbo_render_prims)(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLboolean index_bounds_valid,
struct gl_buffer_object *indirect);
static GLboolean
-vbo_maybe_split(struct gl_context *ctx, const struct gl_vertex_array *arrays,
+vbo_maybe_split(struct gl_context *ctx, const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLuint min_index, GLuint max_index)
}
static void
-vbo_bind_vertices(struct gl_context *ctx, const struct gl_vertex_array *arrays,
+vbo_bind_vertices(struct gl_context *ctx, const struct tnl_vertex_array *arrays,
int base, unsigned min_index, unsigned max_index, int *pdelta)
{
struct nouveau_render_state *render = to_render_state(ctx);
*pdelta = -1;
FOR_EACH_BOUND_ATTR(render, i, attr) {
- const struct gl_vertex_array *array = &arrays[attr];
+ const struct tnl_vertex_array *array = &arrays[attr];
const struct gl_vertex_buffer_binding *binding =
array->BufferBinding;
const struct gl_array_attributes *attrib = array->VertexAttrib;
}
static void
-vbo_draw_vbo(struct gl_context *ctx, const struct gl_vertex_array *arrays,
+vbo_draw_vbo(struct gl_context *ctx, const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib, GLuint min_index,
GLuint max_index)
}
static void
-vbo_draw_imm(struct gl_context *ctx, const struct gl_vertex_array *arrays,
+vbo_draw_imm(struct gl_context *ctx, const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib, GLuint min_index,
GLuint max_index)
static void
TAG(vbo_render_prims)(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLboolean index_bounds_valid,
static void
TAG(vbo_check_render_prims)(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims, GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLboolean index_bounds_valid,
struct gl_buffer_object *indirect)
{
/* Borrow and update the inputs list from the tnl context */
- const struct gl_vertex_array* arrays = _tnl_bind_inputs(ctx);
+ const struct tnl_vertex_array* arrays = _tnl_bind_inputs(ctx);
TAG(vbo_check_render_prims)(ctx, arrays,
prims, nr_prims, ib,
};
-/**
- * Vertex array information which is derived from gl_array_attributes
- * and gl_vertex_buffer_binding information. Used by the VBO module and
- * device drivers.
- */
-struct gl_vertex_array
-{
- /** Vertex attribute array */
- const struct gl_array_attributes *VertexAttrib;
- /** Vertex buffer binding */
- const struct gl_vertex_buffer_binding *BufferBinding;
-};
-
-
/**
* A representation of "Vertex Array Objects" (VAOs) from OpenGL 3.1+ /
* the GL_ARB_vertex_array_object extension.
GLuint divisor);
-/**
- * Shallow copy one vertex array to another.
- */
-static inline void
-_mesa_copy_vertex_array(struct gl_vertex_array *dst,
- const struct gl_vertex_array *src)
-{
- dst->VertexAttrib = src->VertexAttrib;
- dst->BufferBinding = src->BufferBinding;
-}
-
-
extern void
_mesa_copy_vertex_attrib_array(struct gl_context *ctx,
struct gl_array_attributes *dst,
struct _mesa_index_buffer;
struct _mesa_prim;
-struct gl_vertex_array;
struct gl_context;
struct st_context;
_math_init_transformation();
_math_init_translate();
- /* Keep our list of gl_vertex_array inputs */
- _vbo_init_inputs(&tnl->draw_arrays);
+ /* Keep our list of tnl_vertex_array inputs */
+ _tnl_init_inputs(&tnl->draw_arrays);
return GL_TRUE;
}
#include "vbo/vbo.h"
+#include "tnl.h"
+
#define MAX_PIPELINE_STAGES 30
/*
};
+/**
+ * Utility that tracks and updates the current array entries.
+ */
+struct tnl_inputs
+{
+ /**
+ * Array of inputs to be set to the _DrawArrays pointer.
+ * The array contains pointers into the _DrawVAO and to the vbo modules
+ * current values. The array of pointers is updated incrementally
+ * based on the current and vertex_processing_mode values below.
+ */
+ struct tnl_vertex_array inputs[VERT_ATTRIB_MAX];
+ /** Those VERT_BIT_'s where the inputs array point to current values. */
+ GLbitfield current;
+ /** Store which aliasing current values - generics or materials - are set. */
+ gl_vertex_processing_mode vertex_processing_mode;
+};
+
+
+/**
+ * Initialize inputs.
+ */
+void
+_tnl_init_inputs(struct tnl_inputs *inputs);
+
+
+/**
+ * Update the tnl_vertex_array array inside the tnl_inputs structure
+ * provided the current _VPMode, the provided vao and
+ * the vao's enabled arrays filtered by the filter bitmask.
+ */
+void
+_tnl_update_inputs(struct gl_context *ctx, struct tnl_inputs *inputs);
+
+
/**
* Context state for T&L context.
*/
struct tnl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */
/**@}*/
- /* The list of gl_vertex_array inputs. */
- struct vbo_inputs draw_arrays;
+ /* The list of tnl_vertex_array inputs. */
+ struct tnl_inputs draw_arrays;
} TNLcontext;
#include <stdio.h>
#include "main/glheader.h"
+#include "main/arrayobj.h"
#include "main/bufferobj.h"
#include "main/condrender.h"
#include "main/context.h"
static void bind_inputs( struct gl_context *ctx,
- const struct gl_vertex_array *inputs,
+ const struct tnl_vertex_array *inputs,
GLint count,
struct gl_buffer_object **bo,
GLuint *nr_bo )
/* Map all the VBOs
*/
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- const struct gl_vertex_array *array = &inputs[i];
+ const struct tnl_vertex_array *array = &inputs[i];
const struct gl_vertex_buffer_binding *binding = array->BufferBinding;
const struct gl_array_attributes *attrib = array->VertexAttrib;
const void *ptr;
/* This is the main workhorse doing all the rendering work.
*/
void _tnl_draw_prims(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
}
-const struct gl_vertex_array*
+void
+_tnl_init_inputs(struct tnl_inputs *inputs)
+{
+ inputs->current = 0;
+ inputs->vertex_processing_mode = VP_MODE_FF;
+}
+
+
+/**
+ * Update the tnl_inputs's arrays to point to the vao->_VertexArray arrays
+ * according to the 'enable' bitmask.
+ * \param enable bitfield of VERT_BIT_x flags.
+ */
+static inline void
+update_vao_inputs(struct gl_context *ctx,
+ struct tnl_inputs *inputs, GLbitfield enable)
+{
+ const struct gl_vertex_array_object *vao = ctx->Array._DrawVAO;
+
+ /* Make sure we process only arrays enabled in the VAO */
+ assert((enable & ~_mesa_get_vao_vp_inputs(vao)) == 0);
+
+ /* Fill in the client arrays from the VAO */
+ const struct gl_vertex_buffer_binding *bindings = &vao->BufferBinding[0];
+ while (enable) {
+ const int attr = u_bit_scan(&enable);
+ struct tnl_vertex_array *input = &inputs->inputs[attr];
+ const struct gl_array_attributes *attrib;
+ attrib = _mesa_draw_array_attrib(vao, attr);
+ input->VertexAttrib = attrib;
+ input->BufferBinding = &bindings[attrib->BufferBindingIndex];
+ }
+}
+
+
+/**
+ * Update the tnl_inputs's arrays to point to the vbo->currval arrays
+ * according to the 'current' bitmask.
+ * \param current bitfield of VERT_BIT_x flags.
+ */
+static inline void
+update_current_inputs(struct gl_context *ctx,
+ struct tnl_inputs *inputs, GLbitfield current)
+{
+ gl_vertex_processing_mode mode = ctx->VertexProgram._VPMode;
+
+ /* All previously non current array pointers need update. */
+ GLbitfield mask = current & ~inputs->current;
+ /* On mode change, the slots aliasing with materials need update too */
+ if (mode != inputs->vertex_processing_mode)
+ mask |= current & VERT_BIT_MAT_ALL;
+
+ while (mask) {
+ const int attr = u_bit_scan(&mask);
+ struct tnl_vertex_array *input = &inputs->inputs[attr];
+ input->VertexAttrib = _vbo_current_attrib(ctx, attr);
+ input->BufferBinding = _vbo_current_binding(ctx);
+ }
+
+ inputs->current = current;
+ inputs->vertex_processing_mode = mode;
+}
+
+
+/**
+ * Update the tnl_inputs's arrays to point to the vao->_VertexArray and
+ * vbo->currval arrays according to Array._DrawVAO and
+ * Array._DrawVAOEnableAttribs.
+ */
+void
+_tnl_update_inputs(struct gl_context *ctx, struct tnl_inputs *inputs)
+{
+ const GLbitfield enable = ctx->Array._DrawVAOEnabledAttribs;
+
+ /* Update array input pointers */
+ update_vao_inputs(ctx, inputs, enable);
+
+ /* The rest must be current inputs. */
+ update_current_inputs(ctx, inputs, ~enable & VERT_BIT_ALL);
+}
+
+
+const struct tnl_vertex_array*
_tnl_bind_inputs( struct gl_context *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- _vbo_update_inputs(ctx, &tnl->draw_arrays);
+ _tnl_update_inputs(ctx, &tnl->draw_arrays);
return tnl->draw_arrays.inputs;
}
{
/* Update TNLcontext::draw_arrays and return that pointer.
*/
- const struct gl_vertex_array* arrays = _tnl_bind_inputs(ctx);
+ const struct tnl_vertex_array* arrays = _tnl_bind_inputs(ctx);
_tnl_draw_prims(ctx, arrays, prim, nr_prims, ib,
index_bounds_valid, min_index, max_index,
* all or nothing.
*/
void t_rebase_prims( struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
tnl_draw_func draw )
{
struct gl_array_attributes tmp_attribs[VERT_ATTRIB_MAX];
- struct gl_vertex_array tmp_arrays[VERT_ATTRIB_MAX];
+ struct tnl_vertex_array tmp_arrays[VERT_ATTRIB_MAX];
struct _mesa_index_buffer tmp_ib;
struct _mesa_prim *tmp_prims = NULL;
#include "tnl.h"
void t_rebase_prims( struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
void
_tnl_split_prims(struct gl_context *ctx,
- const struct gl_vertex_array arrays[],
+ const struct tnl_vertex_array arrays[],
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
void
_tnl_split_inplace(struct gl_context *ctx,
- const struct gl_vertex_array arrays[],
+ const struct tnl_vertex_array arrays[],
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
*/
void
_tnl_split_copy(struct gl_context *ctx,
- const struct gl_vertex_array arrays[],
+ const struct tnl_vertex_array arrays[],
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
*/
struct copy_context {
struct gl_context *ctx;
- const struct gl_vertex_array *array;
+ const struct tnl_vertex_array *array;
const struct _mesa_prim *prim;
GLuint nr_prims;
const struct _mesa_index_buffer *ib;
struct {
GLuint attr;
GLuint size;
- const struct gl_vertex_array *array;
+ const struct tnl_vertex_array *array;
const GLubyte *src_ptr;
struct gl_vertex_buffer_binding dstbinding;
} varying[VERT_ATTRIB_MAX];
GLuint nr_varying;
- struct gl_vertex_array dstarray[VERT_ATTRIB_MAX];
+ struct tnl_vertex_array dstarray[VERT_ATTRIB_MAX];
struct _mesa_index_buffer dstib;
GLuint *translated_elt_buf;
}
+/**
+ * Shallow copy one vertex array to another.
+ */
+static inline void
+copy_vertex_array(struct tnl_vertex_array *dst,
+ const struct tnl_vertex_array *src)
+{
+ dst->VertexAttrib = src->VertexAttrib;
+ dst->BufferBinding = src->BufferBinding;
+}
+
+
/**
* Starts returning true slightly before the buffer fills, to ensure
* that there is sufficient room for any remaining vertices to finish
*/
static void
dump_draw_info(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prims,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
printf(" Prim mode 0x%x\n", prims[i].mode);
printf(" IB: %p\n", (void*) ib);
for (j = 0; j < VERT_ATTRIB_MAX; j++) {
- const struct gl_vertex_array *array = &arrays[j];
+ const struct tnl_vertex_array *array = &arrays[j];
const struct gl_vertex_buffer_binding *binding
= array->BufferBinding;
const struct gl_array_attributes *attrib = array->VertexAttrib;
GLuint i;
for (i = 0; i < copy->nr_varying; i++) {
- const struct gl_vertex_array *srcarray = copy->varying[i].array;
+ const struct tnl_vertex_array *srcarray = copy->varying[i].array;
const struct gl_vertex_buffer_binding* srcbinding
= srcarray->BufferBinding;
const GLubyte *srcptr
*/
copy->vertex_size = 0;
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- const struct gl_vertex_array *array = ©->array[i];
+ const struct tnl_vertex_array *array = ©->array[i];
const struct gl_vertex_buffer_binding *binding = array->BufferBinding;
if (binding->Stride == 0) {
- _mesa_copy_vertex_array(©->dstarray[i], array);
+ copy_vertex_array(©->dstarray[i], array);
}
else {
const struct gl_array_attributes *attrib = array->VertexAttrib;
/* Setup new vertex arrays to point into the output buffer:
*/
for (offset = 0, i = 0; i < copy->nr_varying; i++) {
- const struct gl_vertex_array *src = copy->varying[i].array;
+ const struct tnl_vertex_array *src = copy->varying[i].array;
const struct gl_array_attributes *srcattr = src->VertexAttrib;
- struct gl_vertex_array *dst = ©->dstarray[i];
+ struct tnl_vertex_array *dst = ©->dstarray[i];
struct gl_vertex_buffer_binding *dstbind = ©->varying[i].dstbinding;
struct gl_array_attributes *dstattr = ©->varying[i].dstattribs;
*/
void
_tnl_split_copy(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
*/
struct split_context {
struct gl_context *ctx;
- const struct gl_vertex_array *array;
+ const struct tnl_vertex_array *array;
const struct _mesa_prim *prim;
GLuint nr_prims;
const struct _mesa_index_buffer *ib;
void
_tnl_split_inplace(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
#include "main/glheader.h"
-struct gl_vertex_array;
struct gl_context;
struct gl_program;
struct gl_buffer_object;
extern void
_tnl_need_projected_coords( struct gl_context *ctx, GLboolean flag );
-extern const struct gl_vertex_array*
+
+/**
+ * Vertex array information which is derived from gl_array_attributes
+ * and gl_vertex_buffer_binding information. Used by the TNL module and
+ * device drivers.
+ */
+struct tnl_vertex_array
+{
+ /** Vertex attribute array */
+ const struct gl_array_attributes *VertexAttrib;
+ /** Vertex buffer binding */
+ const struct gl_vertex_buffer_binding *BufferBinding;
+};
+
+
+extern const struct tnl_vertex_array*
_tnl_bind_inputs( struct gl_context *ctx );
void
_tnl_draw_prims(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
* This may be deprecated in the future
*/
typedef void (*tnl_draw_func)(struct gl_context *ctx,
- const struct gl_vertex_array* arrays,
+ const struct tnl_vertex_array* arrays,
const struct _mesa_prim *prims,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
void
_tnl_split_prims(struct gl_context *ctx,
- const struct gl_vertex_array *arrays,
+ const struct tnl_vertex_array *arrays,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
extern "C" {
#endif
-struct gl_vertex_array;
struct gl_context;
-struct gl_transform_feedback_object;
struct _mesa_prim
{
struct gl_buffer_object *indirect);
-/**
- * Utility that tracks and updates the current array entries.
- */
-struct vbo_inputs
-{
- /**
- * Array of inputs to be set to the _DrawArrays pointer.
- * The array contains pointers into the _DrawVAO and to the vbo modules
- * current values. The array of pointers is updated incrementally
- * based on the current and vertex_processing_mode values below.
- */
- struct gl_vertex_array inputs[VERT_ATTRIB_MAX];
- /** Those VERT_BIT_'s where the inputs array point to current values. */
- GLbitfield current;
- /** Store which aliasing current values - generics or materials - are set. */
- gl_vertex_processing_mode vertex_processing_mode;
-};
-
-
-/**
- * Initialize inputs.
- */
-void
-_vbo_init_inputs(struct vbo_inputs *inputs);
-
-
-/**
- * Update the gl_vertex_array array inside the vbo_inputs structure
- * provided the current _VPMode, the provided vao and
- * the vao's enabled arrays filtered by the filter bitmask.
- */
-void
-_vbo_update_inputs(struct gl_context *ctx, struct vbo_inputs *inputs);
-
-
const struct gl_array_attributes*
_vbo_current_attrib(const struct gl_context *ctx, gl_vert_attrib attr);
p0->count += p1->count;
p0->end = p1->end;
}
-
-
-void
-_vbo_init_inputs(struct vbo_inputs *inputs)
-{
- inputs->current = 0;
- inputs->vertex_processing_mode = VP_MODE_FF;
-}
-
-
-/**
- * Update the vbo_inputs's arrays to point to the vao->_VertexArray arrays
- * according to the 'enable' bitmask.
- * \param enable bitfield of VERT_BIT_x flags.
- */
-static inline void
-update_vao_inputs(struct gl_context *ctx,
- struct vbo_inputs *inputs, GLbitfield enable)
-{
- const struct gl_vertex_array_object *vao = ctx->Array._DrawVAO;
-
- /* Make sure we process only arrays enabled in the VAO */
- assert((enable & ~_mesa_get_vao_vp_inputs(vao)) == 0);
-
- /* Fill in the client arrays from the VAO */
- const GLubyte *const map = _mesa_vao_attribute_map[vao->_AttributeMapMode];
- const struct gl_array_attributes *attribs = &vao->VertexAttrib[0];
- const struct gl_vertex_buffer_binding *bindings = &vao->BufferBinding[0];
- while (enable) {
- const int attr = u_bit_scan(&enable);
- struct gl_vertex_array *input = &inputs->inputs[attr];
- const struct gl_array_attributes *attrib = &attribs[map[attr]];
- input->VertexAttrib = attrib;
- input->BufferBinding = &bindings[attrib->BufferBindingIndex];
- }
-}
-
-
-/**
- * Update the vbo_inputs's arrays to point to the vbo->currval arrays
- * according to the 'current' bitmask.
- * \param current bitfield of VERT_BIT_x flags.
- */
-static inline void
-update_current_inputs(struct gl_context *ctx,
- struct vbo_inputs *inputs, GLbitfield current)
-{
- gl_vertex_processing_mode mode = ctx->VertexProgram._VPMode;
-
- /* All previously non current array pointers need update. */
- GLbitfield mask = current & ~inputs->current;
- /* On mode change, the slots aliasing with materials need update too */
- if (mode != inputs->vertex_processing_mode)
- mask |= current & VERT_BIT_MAT_ALL;
-
- struct vbo_context *vbo = vbo_context(ctx);
- const struct gl_array_attributes *const currval = &vbo->current[0];
- const GLubyte *const map = _vbo_attribute_alias_map[mode];
- while (mask) {
- const int attr = u_bit_scan(&mask);
- struct gl_vertex_array *input = &inputs->inputs[attr];
- input->VertexAttrib = &currval[map[attr]];
- input->BufferBinding = &vbo->binding;
- }
-
- inputs->current = current;
- inputs->vertex_processing_mode = mode;
-}
-
-
-/**
- * Update the vbo_inputs's arrays to point to the vao->_VertexArray and
- * vbo->currval arrays according to Array._DrawVAO and
- * Array._DrawVAOEnableAttribs.
- */
-void
-_vbo_update_inputs(struct gl_context *ctx, struct vbo_inputs *inputs)
-{
- const GLbitfield enable = ctx->Array._DrawVAOEnabledAttribs;
-
- /* Update array input pointers */
- update_vao_inputs(ctx, inputs, enable);
-
- /* The rest must be current inputs. */
- update_current_inputs(ctx, inputs, ~enable & VERT_BIT_ALL);
-}