GLuint i;
/* identity mapping */
- for (i = 0; i < Elements(vbo->map_vp_none); i++)
+ for (i = 0; i < ARRAY_SIZE(vbo->map_vp_none); i++)
vbo->map_vp_none[i] = i;
/* map material attribs to generic slots */
for (i = 0; i < NR_MAT_ATTRIBS; i++)
vbo->map_vp_none[VERT_ATTRIB_GENERIC(i)]
= VBO_ATTRIB_MAT_FRONT_AMBIENT + i;
- for (i = 0; i < Elements(vbo->map_vp_arb); i++)
+ for (i = 0; i < ARRAY_SIZE(vbo->map_vp_arb); i++)
vbo->map_vp_arb[i] = i;
}
_mesa_noop_vtxfmt_init(&exec->vtxfmt_noop);
for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) {
- assert(i < Elements(exec->vtx.attrsz));
+ assert(i < ARRAY_SIZE(exec->vtx.attrsz));
exec->vtx.attrsz[i] = 0;
- assert(i < Elements(exec->vtx.attrtype));
+ assert(i < ARRAY_SIZE(exec->vtx.attrtype));
exec->vtx.attrtype[i] = GL_FLOAT;
- assert(i < Elements(exec->vtx.active_sz));
+ assert(i < ARRAY_SIZE(exec->vtx.active_sz));
exec->vtx.active_sz[i] = 0;
}
for (i = 0 ; i < VERT_ATTRIB_MAX; i++) {
- assert(i < Elements(exec->vtx.inputs));
- assert(i < Elements(exec->vtx.arrays));
+ assert(i < ARRAY_SIZE(exec->vtx.inputs));
+ assert(i < ARRAY_SIZE(exec->vtx.arrays));
exec->vtx.inputs[i] = &exec->vtx.arrays[i];
}
/* Drop any outstanding reference to the vertex buffer
*/
- for (i = 0; i < Elements(exec->vtx.arrays); i++) {
+ for (i = 0; i < ARRAY_SIZE(exec->vtx.arrays); i++) {
_mesa_reference_buffer_object(ctx,
&exec->vtx.arrays[i].BufferObj,
NULL);
}
/* check element j of each enabled array */
- for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
+ for (k = 0; k < ARRAY_SIZE(vao->_VertexAttrib); k++) {
check_array_data(ctx, &vao->_VertexAttrib[k], k, j);
}
}
MAP_INTERNAL);
}
- for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
+ for (k = 0; k < ARRAY_SIZE(vao->_VertexAttrib); k++) {
unmap_array_buffer(ctx, &vao->_VertexAttrib[k]);
}
}
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}
for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
- assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
+ assert(VERT_ATTRIB_GENERIC(attr) < ARRAY_SIZE(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT+attr];
}
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}
for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) {
- assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
+ assert(VERT_ATTRIB_GENERIC(attr) < ARRAY_SIZE(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_GENERIC0+attr];
}
(GLbyte *)exec->vtx.vertex;
/* override the default array set above */
- assert(attr < Elements(exec->vtx.inputs));
- assert(attr < Elements(exec->vtx.arrays)); /* arrays[] */
+ assert(attr < ARRAY_SIZE(exec->vtx.inputs));
+ assert(attr < ARRAY_SIZE(exec->vtx.arrays)); /* arrays[] */
exec->vtx.inputs[attr] = &arrays[attr];
if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr )
{
- assert(attr < Elements(exec->eval.map1));
+ assert(attr < ARRAY_SIZE(exec->eval.map1));
exec->eval.map1[attr].map = NULL;
}
static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr )
{
- assert(attr < Elements(exec->eval.map2));
+ assert(attr < ARRAY_SIZE(exec->eval.map2));
exec->eval.map2[attr].map = NULL;
}
static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
struct gl_1d_map *map )
{
- assert(attr < Elements(exec->eval.map1));
+ assert(attr < ARRAY_SIZE(exec->eval.map1));
if (!exec->eval.map1[attr].map) {
exec->eval.map1[attr].map = map;
exec->eval.map1[attr].sz = dim;
static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
struct gl_2d_map *map )
{
- assert(attr < Elements(exec->eval.map2));
+ assert(attr < ARRAY_SIZE(exec->eval.map2));
if (!exec->eval.map2[attr].map) {
exec->eval.map2[attr].map = map;
exec->eval.map2[attr].sz = dim;