aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-02-01 19:31:22 -0800
committerKenneth Graunke <[email protected]>2014-02-03 00:53:02 -0800
commit94e07c196075a494642d5617f96e36996c58d116 (patch)
tree8b38750281131b20c9f48807d7cb8dbbd1db82ea /src
parent0dfe50f1a6cc5e1f979ac65cca4ed9359d18869d (diff)
mesa: Rename "arrayObj" local variables to "vao".
Now that the field is named "VAO" instead of "ArrayObj", it makes sense to call the local variables "vao" instead of "arrayObj". Completely generated by: $ find . -type f -print0 | xargs 0 sed -i 's/arrayObj/vao/g' Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_arrayelt.c48
-rw-r--r--src/mesa/main/arrayobj.c44
-rw-r--r--src/mesa/main/arrayobj.h20
-rw-r--r--src/mesa/main/bufferobj.c8
-rw-r--r--src/mesa/main/enable.c26
-rw-r--r--src/mesa/main/varray.c98
-rw-r--r--src/mesa/vbo/vbo_exec_array.c16
7 files changed, 130 insertions, 130 deletions
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 09f314b8e45..8beda6265f7 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1472,11 +1472,11 @@ check_vbo(AEcontext *actx, struct gl_buffer_object *vbo)
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;
}
}
@@ -1494,50 +1494,50 @@ _ae_update_state(struct gl_context *ctx)
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.
@@ -1556,7 +1556,7 @@ _ae_update_state(struct gl_context *ctx)
/* 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;
@@ -1583,24 +1583,24 @@ _ae_update_state(struct gl_context *ctx)
}
/* 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);
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 9b4e7dd881e..0bfaf97f911 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -124,16 +124,16 @@ _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
/**
- * 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 */
@@ -159,24 +159,24 @@ _mesa_reference_array_object_(struct gl_context *ctx,
}
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);
}
}
@@ -292,10 +292,10 @@ remove_array_object( struct gl_context *ctx, struct gl_array_object *obj )
/**
* 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);
@@ -304,7 +304,7 @@ compute_max_element(struct gl_array_object *arrayObj, GLbitfield64 enabled)
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);
@@ -319,19 +319,19 @@ compute_max_element(struct gl_array_object *arrayObj, GLbitfield64 enabled)
*/
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);
}
@@ -341,9 +341,9 @@ _mesa_update_array_object_max_element(struct gl_context *ctx,
*/
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;
@@ -353,9 +353,9 @@ _mesa_update_array_object_client_arrays(struct gl_context *ctx,
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);
diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h
index 7c3720242b0..cc3360cbb5c 100644
--- a/src/mesa/main/arrayobj.h
+++ b/src/mesa/main/arrayobj.h
@@ -57,15 +57,15 @@ _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
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);
}
@@ -76,11 +76,11 @@ _mesa_initialize_array_object( struct gl_context *ctx,
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.
@@ -89,9 +89,9 @@ _mesa_update_array_object_client_arrays(struct gl_context *ctx,
* 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.
@@ -101,9 +101,9 @@ _mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj)
* 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));
}
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index eb2fd688590..646e88c82a1 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1082,7 +1082,7 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
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);
@@ -1095,14 +1095,14 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
}
/* 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 );
}
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 04552f71e31..faa4740d000 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -63,46 +63,46 @@ update_derived_primitive_restart_state(struct gl_context *ctx)
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;
@@ -131,11 +131,11 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
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 );
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index d4e50c3ff31..2d3073e013b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -112,20 +112,20 @@ static void
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;
}
}
@@ -139,8 +139,8 @@ bind_vertex_buffer(struct gl_context *ctx, GLuint index,
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 ||
@@ -153,7 +153,7 @@ bind_vertex_buffer(struct gl_context *ctx, GLuint index,
binding->Offset = offset;
binding->Stride = stride;
- arrayObj->NewArrays |= binding->_BoundArrays;
+ vao->NewArrays |= binding->_BoundArrays;
}
}
@@ -166,14 +166,14 @@ static void
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;
}
}
@@ -664,7 +664,7 @@ _mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type,
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) {
@@ -673,16 +673,16 @@ _mesa_EnableVertexAttribArray(GLuint index)
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);
}
}
@@ -690,7 +690,7 @@ _mesa_EnableVertexAttribArray(GLuint 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) {
@@ -699,16 +699,16 @@ _mesa_DisableVertexAttribArray(GLuint index)
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);
}
}
@@ -722,7 +722,7 @@ static GLuint
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) {
@@ -730,9 +730,9 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
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:
@@ -746,7 +746,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
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))
@@ -757,7 +757,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
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:
@@ -1365,7 +1365,7 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
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);
@@ -1412,8 +1412,8 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
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);
@@ -1758,25 +1758,25 @@ print_array(const char *name, GLint index, const struct gl_client_array *array)
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);
}
@@ -1801,9 +1801,9 @@ _mesa_init_varray(struct gl_context *ctx)
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);
}
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index fd27f4b86a7..854dec8e7c8 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -287,7 +287,7 @@ static void
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;
@@ -318,17 +318,17 @@ check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
}
/* 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]);
}
}
@@ -352,7 +352,7 @@ print_draw_arrays(struct gl_context *ctx,
{
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",
@@ -368,7 +368,7 @@ print_draw_arrays(struct gl_context *ctx,
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);