static inline void
update_derived_client_arrays(struct gl_context *ctx)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
- if (arrayObj->NewArrays) {
- _mesa_update_array_object_client_arrays(ctx, arrayObj);
- arrayObj->NewArrays = 0;
+ if (vao->NewArrays) {
+ _mesa_update_array_object_client_arrays(ctx, vao);
+ vao->NewArrays = 0;
}
}
AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */
AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */
GLuint i;
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
actx->nr_vbos = 0;
/* conventional vertex arrays */
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX];
+ if (vao->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX];
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_EDGEFLAG];
+ if (vao->_VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_EDGEFLAG];
aa->offset = _gloffset_EdgeFlagv;
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL];
+ if (vao->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_NORMAL];
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0];
+ if (vao->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR0];
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR1];
+ if (vao->_VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR1];
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_FOG];
+ if (vao->_VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_FOG];
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
struct gl_client_array *attribArray =
- &arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)];
+ &vao->_VertexAttrib[VERT_ATTRIB_TEX(i)];
if (attribArray->Enabled) {
/* NOTE: we use generic glVertexAttribNV functions here.
* If we ever remove GL_NV_vertex_program this will have to change.
/* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
struct gl_client_array *attribArray =
- &arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)];
+ &vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)];
if (attribArray->Enabled) {
GLint intOrNorm;
at->array = attribArray;
}
/* finally, vertex position */
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) {
+ if (vao->_VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) {
/* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
* issued as the last (provoking) attribute).
*/
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC0];
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_GENERIC0];
assert(aa->array->Size >= 2); /* XXX fix someday? */
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- else if (arrayObj->_VertexAttrib[VERT_ATTRIB_POS].Enabled) {
- aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_POS];
+ else if (vao->_VertexAttrib[VERT_ATTRIB_POS].Enabled) {
+ aa->array = &vao->_VertexAttrib[VERT_ATTRIB_POS];
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
check_vbo(actx, aa->array->BufferObj);
aa++;
}
- check_vbo(actx, arrayObj->ElementArrayBufferObj);
+ check_vbo(actx, vao->ElementArrayBufferObj);
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
ASSERT(aa - actx->arrays < 32);
/**
- * Set ptr to arrayObj w/ reference counting.
+ * Set ptr to vao w/ reference counting.
* Note: this should only be called from the _mesa_reference_array_object()
* inline function.
*/
void
_mesa_reference_array_object_(struct gl_context *ctx,
struct gl_array_object **ptr,
- struct gl_array_object *arrayObj)
+ struct gl_array_object *vao)
{
- assert(*ptr != arrayObj);
+ assert(*ptr != vao);
if (*ptr) {
/* Unreference the old array object */
}
ASSERT(!*ptr);
- if (arrayObj) {
+ if (vao) {
/* reference new array object */
- _glthread_LOCK_MUTEX(arrayObj->Mutex);
- if (arrayObj->RefCount == 0) {
+ _glthread_LOCK_MUTEX(vao->Mutex);
+ if (vao->RefCount == 0) {
/* this array's being deleted (look just above) */
/* Not sure this can every really happen. Warn if it does. */
_mesa_problem(NULL, "referencing deleted array object");
*ptr = NULL;
}
else {
- arrayObj->RefCount++;
+ vao->RefCount++;
#if 0
printf("ArrayObj %p %d INCR to %d\n",
- (void *) arrayObj, arrayObj->Name, arrayObj->RefCount);
+ (void *) vao, vao->Name, vao->RefCount);
#endif
- *ptr = arrayObj;
+ *ptr = vao;
}
- _glthread_UNLOCK_MUTEX(arrayObj->Mutex);
+ _glthread_UNLOCK_MUTEX(vao->Mutex);
}
}
/**
* Helper for _mesa_update_array_object_max_element().
- * \return min(arrayObj->_VertexAttrib[*]._MaxElement).
+ * \return min(vao->_VertexAttrib[*]._MaxElement).
*/
static GLuint
-compute_max_element(struct gl_array_object *arrayObj, GLbitfield64 enabled)
+compute_max_element(struct gl_array_object *vao, GLbitfield64 enabled)
{
GLuint min = ~((GLuint)0);
GLint attrib = ffsll(enabled) - 1;
enabled ^= BITFIELD64_BIT(attrib);
- client_array = &arrayObj->_VertexAttrib[attrib];
+ client_array = &vao->_VertexAttrib[attrib];
assert(client_array->Enabled);
_mesa_update_array_max_element(client_array);
min = MIN2(min, client_array->_MaxElement);
*/
void
_mesa_update_array_object_max_element(struct gl_context *ctx,
- struct gl_array_object *arrayObj)
+ struct gl_array_object *vao)
{
GLbitfield64 enabled;
if (!ctx->VertexProgram._Current ||
ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) {
- enabled = _mesa_array_object_get_enabled_ff(arrayObj);
+ enabled = _mesa_array_object_get_enabled_ff(vao);
} else {
- enabled = _mesa_array_object_get_enabled_arb(arrayObj);
+ enabled = _mesa_array_object_get_enabled_arb(vao);
}
/* _MaxElement is one past the last legal array element */
- arrayObj->_MaxElement = compute_max_element(arrayObj, enabled);
+ vao->_MaxElement = compute_max_element(vao, enabled);
}
*/
void
_mesa_update_array_object_client_arrays(struct gl_context *ctx,
- struct gl_array_object *arrayObj)
+ struct gl_array_object *vao)
{
- GLbitfield64 arrays = arrayObj->NewArrays;
+ GLbitfield64 arrays = vao->NewArrays;
while (arrays) {
struct gl_client_array *client_array;
GLint attrib = ffsll(arrays) - 1;
arrays ^= BITFIELD64_BIT(attrib);
- attrib_array = &arrayObj->VertexAttrib[attrib];
- buffer_binding = &arrayObj->VertexBinding[attrib_array->VertexBinding];
- client_array = &arrayObj->_VertexAttrib[attrib];
+ attrib_array = &vao->VertexAttrib[attrib];
+ buffer_binding = &vao->VertexBinding[attrib_array->VertexBinding];
+ client_array = &vao->_VertexAttrib[attrib];
_mesa_update_client_array(ctx, client_array, attrib_array,
buffer_binding);
extern void
_mesa_reference_array_object_(struct gl_context *ctx,
struct gl_array_object **ptr,
- struct gl_array_object *arrayObj);
+ struct gl_array_object *vao);
static inline void
_mesa_reference_array_object(struct gl_context *ctx,
struct gl_array_object **ptr,
- struct gl_array_object *arrayObj)
+ struct gl_array_object *vao)
{
- if (*ptr != arrayObj)
- _mesa_reference_array_object_(ctx, ptr, arrayObj);
+ if (*ptr != vao)
+ _mesa_reference_array_object_(ctx, ptr, vao);
}
extern void
_mesa_update_array_object_max_element(struct gl_context *ctx,
- struct gl_array_object *arrayObj);
+ struct gl_array_object *vao);
extern void
_mesa_update_array_object_client_arrays(struct gl_context *ctx,
- struct gl_array_object *arrayObj);
+ struct gl_array_object *vao);
/** Returns the bitmask of all enabled arrays in fixed function mode.
* are available.
*/
static inline GLbitfield64
-_mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj)
+_mesa_array_object_get_enabled_ff(const struct gl_array_object *vao)
{
- return arrayObj->_Enabled & VERT_BIT_FF_ALL;
+ return vao->_Enabled & VERT_BIT_FF_ALL;
}
/** Returns the bitmask of all enabled arrays in arb/glsl shader mode.
* precedence over the legacy position array.
*/
static inline GLbitfield64
-_mesa_array_object_get_enabled_arb(const struct gl_array_object *arrayObj)
+_mesa_array_object_get_enabled_arb(const struct gl_array_object *vao)
{
- GLbitfield64 enabled = arrayObj->_Enabled;
+ GLbitfield64 enabled = vao->_Enabled;
return enabled & ~(VERT_BIT_POS & (enabled >> VERT_ATTRIB_GENERIC0));
}
for (i = 0; i < n; i++) {
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
if (bufObj) {
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
GLuint j;
ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
}
/* unbind any vertex pointers bound to this buffer */
- for (j = 0; j < Elements(arrayObj->VertexBinding); j++) {
- unbind(ctx, &arrayObj->VertexBinding[j].BufferObj, bufObj);
+ for (j = 0; j < Elements(vao->VertexBinding); j++) {
+ unbind(ctx, &vao->VertexBinding[j].BufferObj, bufObj);
}
if (ctx->Array.ArrayBufferObj == bufObj) {
_mesa_BindBuffer( GL_ARRAY_BUFFER_ARB, 0 );
}
- if (arrayObj->ElementArrayBufferObj == bufObj) {
+ if (vao->ElementArrayBufferObj == bufObj) {
_mesa_BindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
}
static void
client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
GLbitfield64 flag;
GLboolean *var;
switch (cap) {
case GL_VERTEX_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_POS].Enabled;
flag = VERT_BIT_POS;
break;
case GL_NORMAL_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
flag = VERT_BIT_NORMAL;
break;
case GL_COLOR_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
flag = VERT_BIT_COLOR0;
break;
case GL_INDEX_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled;
flag = VERT_BIT_COLOR_INDEX;
break;
case GL_TEXTURE_COORD_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].Enabled;
flag = VERT_BIT_TEX(ctx->Array.ActiveTexture);
break;
case GL_EDGE_FLAG_ARRAY:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
flag = VERT_BIT_EDGEFLAG;
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
flag = VERT_BIT_FOG;
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
flag = VERT_BIT_COLOR1;
break;
case GL_POINT_SIZE_ARRAY_OES:
- var = &arrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
+ var = &vao->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled;
flag = VERT_BIT_POINT_SIZE;
break;
update_derived_primitive_restart_state(ctx);
if (state)
- arrayObj->_Enabled |= flag;
+ vao->_Enabled |= flag;
else
- arrayObj->_Enabled &= ~flag;
+ vao->_Enabled &= ~flag;
- arrayObj->NewArrays |= flag;
+ vao->NewArrays |= flag;
if (ctx->Driver.Enable) {
ctx->Driver.Enable( ctx, cap, state );
vertex_attrib_binding(struct gl_context *ctx, GLuint attribIndex,
GLuint bindingIndex)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
- struct gl_vertex_attrib_array *array = &arrayObj->VertexAttrib[attribIndex];
+ struct gl_array_object *vao = ctx->Array.VAO;
+ struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attribIndex];
if (array->VertexBinding != bindingIndex) {
const GLbitfield64 array_bit = VERT_BIT(attribIndex);
FLUSH_VERTICES(ctx, _NEW_ARRAY);
- arrayObj->VertexBinding[array->VertexBinding]._BoundArrays &= ~array_bit;
- arrayObj->VertexBinding[bindingIndex]._BoundArrays |= array_bit;
+ vao->VertexBinding[array->VertexBinding]._BoundArrays &= ~array_bit;
+ vao->VertexBinding[bindingIndex]._BoundArrays |= array_bit;
array->VertexBinding = bindingIndex;
- arrayObj->NewArrays |= array_bit;
+ vao->NewArrays |= array_bit;
}
}
struct gl_buffer_object *vbo,
GLintptr offset, GLsizei stride)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
- struct gl_vertex_buffer_binding *binding = &arrayObj->VertexBinding[index];
+ struct gl_array_object *vao = ctx->Array.VAO;
+ struct gl_vertex_buffer_binding *binding = &vao->VertexBinding[index];
if (binding->BufferObj != vbo ||
binding->Offset != offset ||
binding->Offset = offset;
binding->Stride = stride;
- arrayObj->NewArrays |= binding->_BoundArrays;
+ vao->NewArrays |= binding->_BoundArrays;
}
}
vertex_binding_divisor(struct gl_context *ctx, GLuint bindingIndex,
GLuint divisor)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
struct gl_vertex_buffer_binding *binding =
- &arrayObj->VertexBinding[bindingIndex];
+ &vao->VertexBinding[bindingIndex];
if (binding->InstanceDivisor != divisor) {
FLUSH_VERTICES(ctx, _NEW_ARRAY);
binding->InstanceDivisor = divisor;
- arrayObj->NewArrays |= binding->_BoundArrays;
+ vao->NewArrays |= binding->_BoundArrays;
}
}
void GLAPIENTRY
_mesa_EnableVertexAttribArray(GLuint index)
{
- struct gl_array_object *arrayObj;
+ struct gl_array_object *vao;
GET_CURRENT_CONTEXT(ctx);
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
return;
}
- arrayObj = ctx->Array.VAO;
+ vao = ctx->Array.VAO;
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(arrayObj->_VertexAttrib));
+ ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->_VertexAttrib));
- if (!arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
+ if (!vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was disabled, now being enabled */
FLUSH_VERTICES(ctx, _NEW_ARRAY);
- arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE;
- arrayObj->_Enabled |= VERT_BIT_GENERIC(index);
- arrayObj->NewArrays |= VERT_BIT_GENERIC(index);
+ vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE;
+ vao->_Enabled |= VERT_BIT_GENERIC(index);
+ vao->NewArrays |= VERT_BIT_GENERIC(index);
}
}
void GLAPIENTRY
_mesa_DisableVertexAttribArray(GLuint index)
{
- struct gl_array_object *arrayObj;
+ struct gl_array_object *vao;
GET_CURRENT_CONTEXT(ctx);
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
return;
}
- arrayObj = ctx->Array.VAO;
+ vao = ctx->Array.VAO;
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(arrayObj->_VertexAttrib));
+ ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->_VertexAttrib));
- if (arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
+ if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was enabled, now being disabled */
FLUSH_VERTICES(ctx, _NEW_ARRAY);
- arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE;
- arrayObj->_Enabled &= ~VERT_BIT_GENERIC(index);
- arrayObj->NewArrays |= VERT_BIT_GENERIC(index);
+ vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE;
+ vao->_Enabled &= ~VERT_BIT_GENERIC(index);
+ vao->NewArrays |= VERT_BIT_GENERIC(index);
}
}
get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
const char *caller)
{
- const struct gl_array_object *arrayObj = ctx->Array.VAO;
+ const struct gl_array_object *vao = ctx->Array.VAO;
const struct gl_vertex_attrib_array *array;
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
return 0;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(arrayObj->VertexAttrib));
+ ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
- array = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)];
+ array = &vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)];
switch (pname) {
case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB:
return array->Normalized;
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB:
- return arrayObj->VertexBinding[array->VertexBinding].BufferObj->Name;
+ return vao->VertexBinding[array->VertexBinding].BufferObj->Name;
case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
if ((_mesa_is_desktop_gl(ctx)
&& (ctx->Version >= 30 || ctx->Extensions.EXT_gpu_shader4))
case GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB:
if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_instanced_arrays)
|| _mesa_is_gles3(ctx)) {
- return arrayObj->VertexBinding[array->VertexBinding].InstanceDivisor;
+ return vao->VertexBinding[array->VertexBinding].InstanceDivisor;
}
goto error;
case GL_VERTEX_ATTRIB_BINDING:
GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
- const struct gl_array_object *arrayObj = ctx->Array.VAO;
+ const struct gl_array_object *vao = ctx->Array.VAO;
struct gl_buffer_object *vbo;
ASSERT_OUTSIDE_BEGIN_END(ctx);
return;
}
- if (buffer == arrayObj->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
- vbo = arrayObj->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
+ if (buffer == vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
+ vbo = vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
} else if (buffer != 0) {
vbo = _mesa_lookup_bufferobj(ctx, buffer);
void
_mesa_print_arrays(struct gl_context *ctx)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
GLuint i;
- _mesa_update_array_object_max_element(ctx, arrayObj);
+ _mesa_update_array_object_max_element(ctx, vao);
- printf("Array Object %u\n", arrayObj->Name);
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_POS].Enabled)
- print_array("Vertex", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_POS]);
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled)
- print_array("Normal", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL]);
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled)
- print_array("Color", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0]);
+ printf("Array Object %u\n", vao->Name);
+ if (vao->_VertexAttrib[VERT_ATTRIB_POS].Enabled)
+ print_array("Vertex", -1, &vao->_VertexAttrib[VERT_ATTRIB_POS]);
+ if (vao->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled)
+ print_array("Normal", -1, &vao->_VertexAttrib[VERT_ATTRIB_NORMAL]);
+ if (vao->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled)
+ print_array("Color", -1, &vao->_VertexAttrib[VERT_ATTRIB_COLOR0]);
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)].Enabled)
- print_array("TexCoord", i, &arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)]);
+ if (vao->_VertexAttrib[VERT_ATTRIB_TEX(i)].Enabled)
+ print_array("TexCoord", i, &vao->_VertexAttrib[VERT_ATTRIB_TEX(i)]);
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++)
- if (arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)].Enabled)
- print_array("Attrib", i, &arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)]);
- printf(" _MaxElement = %u\n", arrayObj->_MaxElement);
+ if (vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)].Enabled)
+ print_array("Attrib", i, &vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)]);
+ printf(" _MaxElement = %u\n", vao->_MaxElement);
}
static void
delete_arrayobj_cb(GLuint id, void *data, void *userData)
{
- struct gl_array_object *arrayObj = (struct gl_array_object *) data;
+ struct gl_array_object *vao = (struct gl_array_object *) data;
struct gl_context *ctx = (struct gl_context *) userData;
- _mesa_delete_array_object(ctx, arrayObj);
+ _mesa_delete_array_object(ctx, vao);
}
check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
const void *elements, GLint basevertex)
{
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
const void *elemMap;
GLint i, k;
}
/* check element j of each enabled array */
- for (k = 0; k < Elements(arrayObj->_VertexAttrib); k++) {
- check_array_data(ctx, &arrayObj->_VertexAttrib[k], k, j);
+ for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
+ check_array_data(ctx, &vao->_VertexAttrib[k], k, j);
}
}
- if (_mesa_is_bufferobj(arrayObj->ElementArrayBufferObj)) {
+ if (_mesa_is_bufferobj(vao->ElementArrayBufferObj)) {
ctx->Driver.UnmapBuffer(ctx, ctx->Array.VAO->ElementArrayBufferObj);
}
- for (k = 0; k < Elements(arrayObj->_VertexAttrib); k++) {
- unmap_array_buffer(ctx, &arrayObj->_VertexAttrib[k]);
+ for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
+ unmap_array_buffer(ctx, &vao->_VertexAttrib[k]);
}
}
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
- struct gl_array_object *arrayObj = ctx->Array.VAO;
+ struct gl_array_object *vao = ctx->Array.VAO;
int i;
printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
exec->array.inputs[i]->Size,
stride,
/*exec->array.inputs[i]->Enabled,*/
- arrayObj->_VertexAttrib[VERT_ATTRIB_FF(i)].Enabled,
+ vao->_VertexAttrib[VERT_ATTRIB_FF(i)].Enabled,
exec->array.inputs[i]->Ptr,
bufName);