88
_mesa_reference_buffer_object(ctx, &obj->Vertex.BufferObj, NULL);
89
_mesa_reference_buffer_object(ctx, &obj->Weight.BufferObj, NULL);
90
_mesa_reference_buffer_object(ctx, &obj->Normal.BufferObj, NULL);
91
_mesa_reference_buffer_object(ctx, &obj->Color.BufferObj, NULL);
92
_mesa_reference_buffer_object(ctx, &obj->SecondaryColor.BufferObj, NULL);
93
_mesa_reference_buffer_object(ctx, &obj->FogCoord.BufferObj, NULL);
94
_mesa_reference_buffer_object(ctx, &obj->Index.BufferObj, NULL);
95
_mesa_reference_buffer_object(ctx, &obj->EdgeFlag.BufferObj, NULL);
97
for (i = 0; i < Elements(obj->TexCoord); i++)
98
_mesa_reference_buffer_object(ctx, &obj->TexCoord[i].BufferObj, NULL);
100
86
for (i = 0; i < Elements(obj->VertexAttrib); i++)
101
_mesa_reference_buffer_object(ctx, &obj->VertexAttrib[i].BufferObj,NULL);
103
#if FEATURE_point_size_array
104
_mesa_reference_buffer_object(ctx, &obj->PointSize.BufferObj, NULL);
87
_mesa_reference_buffer_object(ctx, &obj->VertexAttrib[i].BufferObj, NULL);
208
191
array->Ptr = NULL;
209
192
array->Enabled = GL_FALSE;
210
193
array->Normalized = GL_FALSE;
194
array->Integer = GL_FALSE;
211
195
array->_ElementSize = size * _mesa_sizeof_type(type);
212
#if FEATURE_ARB_vertex_buffer_object
213
196
/* Vertex array buffers */
214
197
_mesa_reference_buffer_object(ctx, &array->BufferObj,
215
198
ctx->Shared->NullBufferObj);
233
215
obj->RefCount = 1;
235
217
/* Init the individual arrays */
236
init_array(ctx, &obj->Vertex, 4, GL_FLOAT);
237
init_array(ctx, &obj->Weight, 1, GL_FLOAT);
238
init_array(ctx, &obj->Normal, 3, GL_FLOAT);
239
init_array(ctx, &obj->Color, 4, GL_FLOAT);
240
init_array(ctx, &obj->SecondaryColor, 3, GL_FLOAT);
241
init_array(ctx, &obj->FogCoord, 1, GL_FLOAT);
242
init_array(ctx, &obj->Index, 1, GL_FLOAT);
243
for (i = 0; i < Elements(obj->TexCoord); i++) {
244
init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT);
246
init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL);
247
218
for (i = 0; i < Elements(obj->VertexAttrib); i++) {
248
init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT);
220
case VERT_ATTRIB_WEIGHT:
221
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_WEIGHT], 1, GL_FLOAT);
223
case VERT_ATTRIB_NORMAL:
224
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_NORMAL], 3, GL_FLOAT);
226
case VERT_ATTRIB_COLOR1:
227
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_COLOR1], 3, GL_FLOAT);
229
case VERT_ATTRIB_FOG:
230
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_FOG], 1, GL_FLOAT);
232
case VERT_ATTRIB_COLOR_INDEX:
233
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX], 1, GL_FLOAT);
235
case VERT_ATTRIB_EDGEFLAG:
236
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL);
251
238
#if FEATURE_point_size_array
252
init_array(ctx, &obj->PointSize, 1, GL_FLOAT);
239
case VERT_ATTRIB_POINT_SIZE:
240
init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_POINT_SIZE], 1, GL_FLOAT);
244
init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT);
249
_mesa_reference_buffer_object(ctx, &obj->ElementArrayBufferObj,
250
ctx->Shared->NullBufferObj);
305
299
_mesa_update_array_object_max_element(struct gl_context *ctx,
306
300
struct gl_array_object *arrayObj)
302
GLbitfield64 enabled = arrayObj->_Enabled;
310
min = update_min(min, &arrayObj->Vertex);
311
min = update_min(min, &arrayObj->Weight);
312
min = update_min(min, &arrayObj->Normal);
313
min = update_min(min, &arrayObj->Color);
314
min = update_min(min, &arrayObj->SecondaryColor);
315
min = update_min(min, &arrayObj->FogCoord);
316
min = update_min(min, &arrayObj->Index);
317
min = update_min(min, &arrayObj->EdgeFlag);
318
#if FEATURE_point_size_array
319
min = update_min(min, &arrayObj->PointSize);
321
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
322
min = update_min(min, &arrayObj->TexCoord[i]);
323
for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
324
min = update_min(min, &arrayObj->VertexAttrib[i]);
306
GLint attrib = _mesa_ffsll(enabled) - 1;
307
enabled &= ~BITFIELD64_BIT(attrib);
308
min = update_min(min, &arrayObj->VertexAttrib[attrib]);
326
311
/* _MaxElement is one past the last legal array element */
327
312
arrayObj->_MaxElement = min;
374
359
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
363
/* The "Interactions with APPLE_vertex_array_object" section of the
364
* GL_ARB_vertex_array_object spec says:
366
* "The first bind call, either BindVertexArray or
367
* BindVertexArrayAPPLE, determines the semantic of the object."
369
newObj->ARBsemantics = genRequired;
377
370
save_array_object(ctx, newObj);
381
374
ctx->NewState |= _NEW_ARRAY;
382
ctx->Array.NewState |= _NEW_ARRAY_ALL;
375
ctx->Array.NewState |= VERT_BIT_ALL;
383
376
_mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj);
385
378
/* Pass BindVertexArray call to device driver */