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 <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -1472,11 +1472,11 @@ check_vbo(AEcontext *actx, struct gl_buffer_object *vbo)
|
|||||||
static inline void
|
static inline void
|
||||||
update_derived_client_arrays(struct gl_context *ctx)
|
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) {
|
if (vao->NewArrays) {
|
||||||
_mesa_update_array_object_client_arrays(ctx, arrayObj);
|
_mesa_update_array_object_client_arrays(ctx, vao);
|
||||||
arrayObj->NewArrays = 0;
|
vao->NewArrays = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1494,50 +1494,50 @@ _ae_update_state(struct gl_context *ctx)
|
|||||||
AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */
|
AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */
|
||||||
AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */
|
AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */
|
||||||
GLuint i;
|
GLuint i;
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
|
|
||||||
actx->nr_vbos = 0;
|
actx->nr_vbos = 0;
|
||||||
|
|
||||||
/* conventional vertex arrays */
|
/* conventional vertex arrays */
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX];
|
||||||
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
|
aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_EDGEFLAG];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_EDGEFLAG];
|
||||||
aa->offset = _gloffset_EdgeFlagv;
|
aa->offset = _gloffset_EdgeFlagv;
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_NORMAL];
|
||||||
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
|
aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR0];
|
||||||
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
|
aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR1];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_COLOR1];
|
||||||
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
|
aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
|
if (vao->_VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_FOG];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_FOG];
|
||||||
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
|
aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||||
struct gl_client_array *attribArray =
|
struct gl_client_array *attribArray =
|
||||||
&arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)];
|
&vao->_VertexAttrib[VERT_ATTRIB_TEX(i)];
|
||||||
if (attribArray->Enabled) {
|
if (attribArray->Enabled) {
|
||||||
/* NOTE: we use generic glVertexAttribNV functions here.
|
/* NOTE: we use generic glVertexAttribNV functions here.
|
||||||
* If we ever remove GL_NV_vertex_program this will have to change.
|
* 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 */
|
/* generic vertex attribute arrays */
|
||||||
for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
|
for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
|
||||||
struct gl_client_array *attribArray =
|
struct gl_client_array *attribArray =
|
||||||
&arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)];
|
&vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)];
|
||||||
if (attribArray->Enabled) {
|
if (attribArray->Enabled) {
|
||||||
GLint intOrNorm;
|
GLint intOrNorm;
|
||||||
at->array = attribArray;
|
at->array = attribArray;
|
||||||
@@ -1583,24 +1583,24 @@ _ae_update_state(struct gl_context *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* finally, vertex position */
|
/* 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
|
/* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
|
||||||
* issued as the last (provoking) attribute).
|
* 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? */
|
assert(aa->array->Size >= 2); /* XXX fix someday? */
|
||||||
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
|
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
else if (arrayObj->_VertexAttrib[VERT_ATTRIB_POS].Enabled) {
|
else if (vao->_VertexAttrib[VERT_ATTRIB_POS].Enabled) {
|
||||||
aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_POS];
|
aa->array = &vao->_VertexAttrib[VERT_ATTRIB_POS];
|
||||||
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
|
aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
|
||||||
check_vbo(actx, aa->array->BufferObj);
|
check_vbo(actx, aa->array->BufferObj);
|
||||||
aa++;
|
aa++;
|
||||||
}
|
}
|
||||||
|
|
||||||
check_vbo(actx, arrayObj->ElementArrayBufferObj);
|
check_vbo(actx, vao->ElementArrayBufferObj);
|
||||||
|
|
||||||
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
|
ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
|
||||||
ASSERT(aa - actx->arrays < 32);
|
ASSERT(aa - actx->arrays < 32);
|
||||||
|
@@ -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()
|
* Note: this should only be called from the _mesa_reference_array_object()
|
||||||
* inline function.
|
* inline function.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_reference_array_object_(struct gl_context *ctx,
|
_mesa_reference_array_object_(struct gl_context *ctx,
|
||||||
struct gl_array_object **ptr,
|
struct gl_array_object **ptr,
|
||||||
struct gl_array_object *arrayObj)
|
struct gl_array_object *vao)
|
||||||
{
|
{
|
||||||
assert(*ptr != arrayObj);
|
assert(*ptr != vao);
|
||||||
|
|
||||||
if (*ptr) {
|
if (*ptr) {
|
||||||
/* Unreference the old array object */
|
/* Unreference the old array object */
|
||||||
@@ -159,24 +159,24 @@ _mesa_reference_array_object_(struct gl_context *ctx,
|
|||||||
}
|
}
|
||||||
ASSERT(!*ptr);
|
ASSERT(!*ptr);
|
||||||
|
|
||||||
if (arrayObj) {
|
if (vao) {
|
||||||
/* reference new array object */
|
/* reference new array object */
|
||||||
_glthread_LOCK_MUTEX(arrayObj->Mutex);
|
_glthread_LOCK_MUTEX(vao->Mutex);
|
||||||
if (arrayObj->RefCount == 0) {
|
if (vao->RefCount == 0) {
|
||||||
/* this array's being deleted (look just above) */
|
/* this array's being deleted (look just above) */
|
||||||
/* Not sure this can every really happen. Warn if it does. */
|
/* Not sure this can every really happen. Warn if it does. */
|
||||||
_mesa_problem(NULL, "referencing deleted array object");
|
_mesa_problem(NULL, "referencing deleted array object");
|
||||||
*ptr = NULL;
|
*ptr = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrayObj->RefCount++;
|
vao->RefCount++;
|
||||||
#if 0
|
#if 0
|
||||||
printf("ArrayObj %p %d INCR to %d\n",
|
printf("ArrayObj %p %d INCR to %d\n",
|
||||||
(void *) arrayObj, arrayObj->Name, arrayObj->RefCount);
|
(void *) vao, vao->Name, vao->RefCount);
|
||||||
#endif
|
#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().
|
* Helper for _mesa_update_array_object_max_element().
|
||||||
* \return min(arrayObj->_VertexAttrib[*]._MaxElement).
|
* \return min(vao->_VertexAttrib[*]._MaxElement).
|
||||||
*/
|
*/
|
||||||
static GLuint
|
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);
|
GLuint min = ~((GLuint)0);
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ compute_max_element(struct gl_array_object *arrayObj, GLbitfield64 enabled)
|
|||||||
GLint attrib = ffsll(enabled) - 1;
|
GLint attrib = ffsll(enabled) - 1;
|
||||||
enabled ^= BITFIELD64_BIT(attrib);
|
enabled ^= BITFIELD64_BIT(attrib);
|
||||||
|
|
||||||
client_array = &arrayObj->_VertexAttrib[attrib];
|
client_array = &vao->_VertexAttrib[attrib];
|
||||||
assert(client_array->Enabled);
|
assert(client_array->Enabled);
|
||||||
_mesa_update_array_max_element(client_array);
|
_mesa_update_array_max_element(client_array);
|
||||||
min = MIN2(min, client_array->_MaxElement);
|
min = MIN2(min, client_array->_MaxElement);
|
||||||
@@ -319,19 +319,19 @@ compute_max_element(struct gl_array_object *arrayObj, GLbitfield64 enabled)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_mesa_update_array_object_max_element(struct gl_context *ctx,
|
_mesa_update_array_object_max_element(struct gl_context *ctx,
|
||||||
struct gl_array_object *arrayObj)
|
struct gl_array_object *vao)
|
||||||
{
|
{
|
||||||
GLbitfield64 enabled;
|
GLbitfield64 enabled;
|
||||||
|
|
||||||
if (!ctx->VertexProgram._Current ||
|
if (!ctx->VertexProgram._Current ||
|
||||||
ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) {
|
ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) {
|
||||||
enabled = _mesa_array_object_get_enabled_ff(arrayObj);
|
enabled = _mesa_array_object_get_enabled_ff(vao);
|
||||||
} else {
|
} 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 */
|
/* _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
|
void
|
||||||
_mesa_update_array_object_client_arrays(struct gl_context *ctx,
|
_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) {
|
while (arrays) {
|
||||||
struct gl_client_array *client_array;
|
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;
|
GLint attrib = ffsll(arrays) - 1;
|
||||||
arrays ^= BITFIELD64_BIT(attrib);
|
arrays ^= BITFIELD64_BIT(attrib);
|
||||||
|
|
||||||
attrib_array = &arrayObj->VertexAttrib[attrib];
|
attrib_array = &vao->VertexAttrib[attrib];
|
||||||
buffer_binding = &arrayObj->VertexBinding[attrib_array->VertexBinding];
|
buffer_binding = &vao->VertexBinding[attrib_array->VertexBinding];
|
||||||
client_array = &arrayObj->_VertexAttrib[attrib];
|
client_array = &vao->_VertexAttrib[attrib];
|
||||||
|
|
||||||
_mesa_update_client_array(ctx, client_array, attrib_array,
|
_mesa_update_client_array(ctx, client_array, attrib_array,
|
||||||
buffer_binding);
|
buffer_binding);
|
||||||
|
@@ -57,15 +57,15 @@ _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
|
|||||||
extern void
|
extern void
|
||||||
_mesa_reference_array_object_(struct gl_context *ctx,
|
_mesa_reference_array_object_(struct gl_context *ctx,
|
||||||
struct gl_array_object **ptr,
|
struct gl_array_object **ptr,
|
||||||
struct gl_array_object *arrayObj);
|
struct gl_array_object *vao);
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_mesa_reference_array_object(struct gl_context *ctx,
|
_mesa_reference_array_object(struct gl_context *ctx,
|
||||||
struct gl_array_object **ptr,
|
struct gl_array_object **ptr,
|
||||||
struct gl_array_object *arrayObj)
|
struct gl_array_object *vao)
|
||||||
{
|
{
|
||||||
if (*ptr != arrayObj)
|
if (*ptr != vao)
|
||||||
_mesa_reference_array_object_(ctx, ptr, arrayObj);
|
_mesa_reference_array_object_(ctx, ptr, vao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -76,11 +76,11 @@ _mesa_initialize_array_object( struct gl_context *ctx,
|
|||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_update_array_object_max_element(struct gl_context *ctx,
|
_mesa_update_array_object_max_element(struct gl_context *ctx,
|
||||||
struct gl_array_object *arrayObj);
|
struct gl_array_object *vao);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
_mesa_update_array_object_client_arrays(struct gl_context *ctx,
|
_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.
|
/** 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.
|
* are available.
|
||||||
*/
|
*/
|
||||||
static inline GLbitfield64
|
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.
|
/** 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.
|
* precedence over the legacy position array.
|
||||||
*/
|
*/
|
||||||
static inline GLbitfield64
|
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));
|
return enabled & ~(VERT_BIT_POS & (enabled >> VERT_ATTRIB_GENERIC0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1082,7 +1082,7 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
|
|||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
|
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
|
||||||
if (bufObj) {
|
if (bufObj) {
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
GLuint j;
|
GLuint j;
|
||||||
|
|
||||||
ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
|
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 */
|
/* unbind any vertex pointers bound to this buffer */
|
||||||
for (j = 0; j < Elements(arrayObj->VertexBinding); j++) {
|
for (j = 0; j < Elements(vao->VertexBinding); j++) {
|
||||||
unbind(ctx, &arrayObj->VertexBinding[j].BufferObj, bufObj);
|
unbind(ctx, &vao->VertexBinding[j].BufferObj, bufObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Array.ArrayBufferObj == bufObj) {
|
if (ctx->Array.ArrayBufferObj == bufObj) {
|
||||||
_mesa_BindBuffer( GL_ARRAY_BUFFER_ARB, 0 );
|
_mesa_BindBuffer( GL_ARRAY_BUFFER_ARB, 0 );
|
||||||
}
|
}
|
||||||
if (arrayObj->ElementArrayBufferObj == bufObj) {
|
if (vao->ElementArrayBufferObj == bufObj) {
|
||||||
_mesa_BindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
_mesa_BindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,46 +63,46 @@ update_derived_primitive_restart_state(struct gl_context *ctx)
|
|||||||
static void
|
static void
|
||||||
client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
|
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;
|
GLbitfield64 flag;
|
||||||
GLboolean *var;
|
GLboolean *var;
|
||||||
|
|
||||||
switch (cap) {
|
switch (cap) {
|
||||||
case GL_VERTEX_ARRAY:
|
case GL_VERTEX_ARRAY:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_POS].Enabled;
|
||||||
flag = VERT_BIT_POS;
|
flag = VERT_BIT_POS;
|
||||||
break;
|
break;
|
||||||
case GL_NORMAL_ARRAY:
|
case GL_NORMAL_ARRAY:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
|
||||||
flag = VERT_BIT_NORMAL;
|
flag = VERT_BIT_NORMAL;
|
||||||
break;
|
break;
|
||||||
case GL_COLOR_ARRAY:
|
case GL_COLOR_ARRAY:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled;
|
||||||
flag = VERT_BIT_COLOR0;
|
flag = VERT_BIT_COLOR0;
|
||||||
break;
|
break;
|
||||||
case GL_INDEX_ARRAY:
|
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;
|
flag = VERT_BIT_COLOR_INDEX;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_COORD_ARRAY:
|
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);
|
flag = VERT_BIT_TEX(ctx->Array.ActiveTexture);
|
||||||
break;
|
break;
|
||||||
case GL_EDGE_FLAG_ARRAY:
|
case GL_EDGE_FLAG_ARRAY:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled;
|
||||||
flag = VERT_BIT_EDGEFLAG;
|
flag = VERT_BIT_EDGEFLAG;
|
||||||
break;
|
break;
|
||||||
case GL_FOG_COORDINATE_ARRAY_EXT:
|
case GL_FOG_COORDINATE_ARRAY_EXT:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_FOG].Enabled;
|
||||||
flag = VERT_BIT_FOG;
|
flag = VERT_BIT_FOG;
|
||||||
break;
|
break;
|
||||||
case GL_SECONDARY_COLOR_ARRAY_EXT:
|
case GL_SECONDARY_COLOR_ARRAY_EXT:
|
||||||
var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
|
var = &vao->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled;
|
||||||
flag = VERT_BIT_COLOR1;
|
flag = VERT_BIT_COLOR1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_POINT_SIZE_ARRAY_OES:
|
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;
|
flag = VERT_BIT_POINT_SIZE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -131,11 +131,11 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||||||
update_derived_primitive_restart_state(ctx);
|
update_derived_primitive_restart_state(ctx);
|
||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
arrayObj->_Enabled |= flag;
|
vao->_Enabled |= flag;
|
||||||
else
|
else
|
||||||
arrayObj->_Enabled &= ~flag;
|
vao->_Enabled &= ~flag;
|
||||||
|
|
||||||
arrayObj->NewArrays |= flag;
|
vao->NewArrays |= flag;
|
||||||
|
|
||||||
if (ctx->Driver.Enable) {
|
if (ctx->Driver.Enable) {
|
||||||
ctx->Driver.Enable( ctx, cap, state );
|
ctx->Driver.Enable( ctx, cap, state );
|
||||||
|
@@ -112,20 +112,20 @@ static void
|
|||||||
vertex_attrib_binding(struct gl_context *ctx, GLuint attribIndex,
|
vertex_attrib_binding(struct gl_context *ctx, GLuint attribIndex,
|
||||||
GLuint bindingIndex)
|
GLuint bindingIndex)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
struct gl_vertex_attrib_array *array = &arrayObj->VertexAttrib[attribIndex];
|
struct gl_vertex_attrib_array *array = &vao->VertexAttrib[attribIndex];
|
||||||
|
|
||||||
if (array->VertexBinding != bindingIndex) {
|
if (array->VertexBinding != bindingIndex) {
|
||||||
const GLbitfield64 array_bit = VERT_BIT(attribIndex);
|
const GLbitfield64 array_bit = VERT_BIT(attribIndex);
|
||||||
|
|
||||||
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
||||||
|
|
||||||
arrayObj->VertexBinding[array->VertexBinding]._BoundArrays &= ~array_bit;
|
vao->VertexBinding[array->VertexBinding]._BoundArrays &= ~array_bit;
|
||||||
arrayObj->VertexBinding[bindingIndex]._BoundArrays |= array_bit;
|
vao->VertexBinding[bindingIndex]._BoundArrays |= array_bit;
|
||||||
|
|
||||||
array->VertexBinding = bindingIndex;
|
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,
|
struct gl_buffer_object *vbo,
|
||||||
GLintptr offset, GLsizei stride)
|
GLintptr offset, GLsizei stride)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
struct gl_vertex_buffer_binding *binding = &arrayObj->VertexBinding[index];
|
struct gl_vertex_buffer_binding *binding = &vao->VertexBinding[index];
|
||||||
|
|
||||||
if (binding->BufferObj != vbo ||
|
if (binding->BufferObj != vbo ||
|
||||||
binding->Offset != offset ||
|
binding->Offset != offset ||
|
||||||
@@ -153,7 +153,7 @@ bind_vertex_buffer(struct gl_context *ctx, GLuint index,
|
|||||||
binding->Offset = offset;
|
binding->Offset = offset;
|
||||||
binding->Stride = stride;
|
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,
|
vertex_binding_divisor(struct gl_context *ctx, GLuint bindingIndex,
|
||||||
GLuint divisor)
|
GLuint divisor)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
struct gl_vertex_buffer_binding *binding =
|
struct gl_vertex_buffer_binding *binding =
|
||||||
&arrayObj->VertexBinding[bindingIndex];
|
&vao->VertexBinding[bindingIndex];
|
||||||
|
|
||||||
if (binding->InstanceDivisor != divisor) {
|
if (binding->InstanceDivisor != divisor) {
|
||||||
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
||||||
binding->InstanceDivisor = divisor;
|
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
|
void GLAPIENTRY
|
||||||
_mesa_EnableVertexAttribArray(GLuint index)
|
_mesa_EnableVertexAttribArray(GLuint index)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj;
|
struct gl_array_object *vao;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
|
||||||
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
|
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
|
||||||
@@ -673,16 +673,16 @@ _mesa_EnableVertexAttribArray(GLuint index)
|
|||||||
return;
|
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 */
|
/* was disabled, now being enabled */
|
||||||
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
||||||
arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE;
|
vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE;
|
||||||
arrayObj->_Enabled |= VERT_BIT_GENERIC(index);
|
vao->_Enabled |= VERT_BIT_GENERIC(index);
|
||||||
arrayObj->NewArrays |= VERT_BIT_GENERIC(index);
|
vao->NewArrays |= VERT_BIT_GENERIC(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ _mesa_EnableVertexAttribArray(GLuint index)
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_DisableVertexAttribArray(GLuint index)
|
_mesa_DisableVertexAttribArray(GLuint index)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj;
|
struct gl_array_object *vao;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
|
||||||
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
|
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
|
||||||
@@ -699,16 +699,16 @@ _mesa_DisableVertexAttribArray(GLuint index)
|
|||||||
return;
|
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 */
|
/* was enabled, now being disabled */
|
||||||
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
FLUSH_VERTICES(ctx, _NEW_ARRAY);
|
||||||
arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE;
|
vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE;
|
||||||
arrayObj->_Enabled &= ~VERT_BIT_GENERIC(index);
|
vao->_Enabled &= ~VERT_BIT_GENERIC(index);
|
||||||
arrayObj->NewArrays |= 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,
|
get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
|
||||||
const char *caller)
|
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;
|
const struct gl_vertex_attrib_array *array;
|
||||||
|
|
||||||
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
|
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;
|
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) {
|
switch (pname) {
|
||||||
case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
|
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:
|
case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB:
|
||||||
return array->Normalized;
|
return array->Normalized;
|
||||||
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB:
|
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:
|
case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
|
||||||
if ((_mesa_is_desktop_gl(ctx)
|
if ((_mesa_is_desktop_gl(ctx)
|
||||||
&& (ctx->Version >= 30 || ctx->Extensions.EXT_gpu_shader4))
|
&& (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:
|
case GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB:
|
||||||
if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_instanced_arrays)
|
if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_instanced_arrays)
|
||||||
|| _mesa_is_gles3(ctx)) {
|
|| _mesa_is_gles3(ctx)) {
|
||||||
return arrayObj->VertexBinding[array->VertexBinding].InstanceDivisor;
|
return vao->VertexBinding[array->VertexBinding].InstanceDivisor;
|
||||||
}
|
}
|
||||||
goto error;
|
goto error;
|
||||||
case GL_VERTEX_ATTRIB_BINDING:
|
case GL_VERTEX_ATTRIB_BINDING:
|
||||||
@@ -1365,7 +1365,7 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
|
|||||||
GLsizei stride)
|
GLsizei stride)
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
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;
|
struct gl_buffer_object *vbo;
|
||||||
|
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||||
@@ -1412,8 +1412,8 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer == arrayObj->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
|
if (buffer == vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj->Name) {
|
||||||
vbo = arrayObj->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
|
vbo = vao->VertexBinding[VERT_ATTRIB_GENERIC(bindingIndex)].BufferObj;
|
||||||
} else if (buffer != 0) {
|
} else if (buffer != 0) {
|
||||||
vbo = _mesa_lookup_bufferobj(ctx, buffer);
|
vbo = _mesa_lookup_bufferobj(ctx, buffer);
|
||||||
|
|
||||||
@@ -1758,25 +1758,25 @@ print_array(const char *name, GLint index, const struct gl_client_array *array)
|
|||||||
void
|
void
|
||||||
_mesa_print_arrays(struct gl_context *ctx)
|
_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;
|
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);
|
printf("Array Object %u\n", vao->Name);
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_POS].Enabled)
|
if (vao->_VertexAttrib[VERT_ATTRIB_POS].Enabled)
|
||||||
print_array("Vertex", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_POS]);
|
print_array("Vertex", -1, &vao->_VertexAttrib[VERT_ATTRIB_POS]);
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled)
|
if (vao->_VertexAttrib[VERT_ATTRIB_NORMAL].Enabled)
|
||||||
print_array("Normal", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_NORMAL]);
|
print_array("Normal", -1, &vao->_VertexAttrib[VERT_ATTRIB_NORMAL]);
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled)
|
if (vao->_VertexAttrib[VERT_ATTRIB_COLOR0].Enabled)
|
||||||
print_array("Color", -1, &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR0]);
|
print_array("Color", -1, &vao->_VertexAttrib[VERT_ATTRIB_COLOR0]);
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)].Enabled)
|
if (vao->_VertexAttrib[VERT_ATTRIB_TEX(i)].Enabled)
|
||||||
print_array("TexCoord", i, &arrayObj->_VertexAttrib[VERT_ATTRIB_TEX(i)]);
|
print_array("TexCoord", i, &vao->_VertexAttrib[VERT_ATTRIB_TEX(i)]);
|
||||||
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++)
|
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++)
|
||||||
if (arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)].Enabled)
|
if (vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)].Enabled)
|
||||||
print_array("Attrib", i, &arrayObj->_VertexAttrib[VERT_ATTRIB_GENERIC(i)]);
|
print_array("Attrib", i, &vao->_VertexAttrib[VERT_ATTRIB_GENERIC(i)]);
|
||||||
printf(" _MaxElement = %u\n", arrayObj->_MaxElement);
|
printf(" _MaxElement = %u\n", vao->_MaxElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1801,9 +1801,9 @@ _mesa_init_varray(struct gl_context *ctx)
|
|||||||
static void
|
static void
|
||||||
delete_arrayobj_cb(GLuint id, void *data, void *userData)
|
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;
|
struct gl_context *ctx = (struct gl_context *) userData;
|
||||||
_mesa_delete_array_object(ctx, arrayObj);
|
_mesa_delete_array_object(ctx, vao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -287,7 +287,7 @@ static void
|
|||||||
check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
|
check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
|
||||||
const void *elements, GLint basevertex)
|
const void *elements, GLint basevertex)
|
||||||
{
|
{
|
||||||
struct gl_array_object *arrayObj = ctx->Array.VAO;
|
struct gl_array_object *vao = ctx->Array.VAO;
|
||||||
const void *elemMap;
|
const void *elemMap;
|
||||||
GLint i, k;
|
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 */
|
/* check element j of each enabled array */
|
||||||
for (k = 0; k < Elements(arrayObj->_VertexAttrib); k++) {
|
for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
|
||||||
check_array_data(ctx, &arrayObj->_VertexAttrib[k], k, j);
|
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);
|
ctx->Driver.UnmapBuffer(ctx, ctx->Array.VAO->ElementArrayBufferObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k = 0; k < Elements(arrayObj->_VertexAttrib); k++) {
|
for (k = 0; k < Elements(vao->_VertexAttrib); k++) {
|
||||||
unmap_array_buffer(ctx, &arrayObj->_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_context *vbo = vbo_context(ctx);
|
||||||
struct vbo_exec_context *exec = &vbo->exec;
|
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;
|
int i;
|
||||||
|
|
||||||
printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
|
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,
|
exec->array.inputs[i]->Size,
|
||||||
stride,
|
stride,
|
||||||
/*exec->array.inputs[i]->Enabled,*/
|
/*exec->array.inputs[i]->Enabled,*/
|
||||||
arrayObj->_VertexAttrib[VERT_ATTRIB_FF(i)].Enabled,
|
vao->_VertexAttrib[VERT_ATTRIB_FF(i)].Enabled,
|
||||||
exec->array.inputs[i]->Ptr,
|
exec->array.inputs[i]->Ptr,
|
||||||
bufName);
|
bufName);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user