The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
}
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= VERT_BIT_ALL;
_mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj);
/* Pass BindVertexArray call to device driver */
|| _mesa_IsBufferARB(src->ArrayObj->ElementArrayBufferObj->Name))
_mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
src->ArrayObj->ElementArrayBufferObj->Name);
-
- /* FIXME: Should some bits in ctx->Array->NewState also be set
- * FIXME: here? It seems like it should be set to inclusive-or
- * FIXME: of the old ArrayObj->_Enabled and the new _Enabled.
- * ... just do it.
- */
- dest->NewState |= src->ArrayObj->_Enabled | dest->ArrayObj->_Enabled;
}
/**
return;
FLUSH_VERTICES(ctx, _NEW_ARRAY);
- ctx->Array.NewState |= flag;
_ae_invalidate_state(ctx, _NEW_ARRAY);
else
arrayObj->_Enabled &= ~flag;
+ arrayObj->NewArrays |= flag;
+
if (ctx->Driver.Enable) {
ctx->Driver.Enable( ctx, cap, state );
}
/** Mask of VERT_BIT_* values indicating which arrays are enabled */
GLbitfield64 _Enabled;
+ /** Mask of VERT_BIT_* values indicating changed/dirty arrays */
+ GLbitfield64 NewArrays;
+
/**
* Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs
* we can determine the max legal (in bounds) glDrawElements array index.
GLboolean PrimitiveRestart;
GLuint RestartIndex;
- GLbitfield64 NewState; /**< mask of VERT_BIT_* values */
-
/* GL_ARB_vertex_buffer_object */
struct gl_buffer_object *ArrayBufferObj;
};
new_state = ctx->NewState | new_prog_state;
ctx->NewState = 0;
ctx->Driver.UpdateState(ctx, new_state);
- ctx->Array.NewState = 0;
+ ctx->Array.ArrayObj->NewArrays = 0x0;
}
ctx->Array.ArrayBufferObj);
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= VERT_BIT(attrib);
+ ctx->Array.ArrayObj->NewArrays |= VERT_BIT(attrib);
}
FLUSH_VERTICES(ctx, _NEW_ARRAY);
arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE;
arrayObj->_Enabled |= VERT_BIT_GENERIC(index);
- ctx->Array.NewState |= VERT_BIT_GENERIC(index);
+ arrayObj->NewArrays |= VERT_BIT_GENERIC(index);
}
}
FLUSH_VERTICES(ctx, _NEW_ARRAY);
arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE;
arrayObj->_Enabled &= ~VERT_BIT_GENERIC(index);
- ctx->Array.NewState |= VERT_BIT_GENERIC(index);
+ arrayObj->NewArrays |= VERT_BIT_GENERIC(index);
}
}
ctx->Array.LockCount = count;
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= VERT_BIT_ALL;
}
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= VERT_BIT_ALL;
}
if (array->InstanceDivisor != divisor) {
FLUSH_VERTICES(ctx, _NEW_ARRAY);
array->InstanceDivisor = divisor;
- ctx->Array.NewState |= VERT_BIT(VERT_ATTRIB_GENERIC(index));
+ ctx->Array.ArrayObj->NewArrays |= VERT_BIT(VERT_ATTRIB_GENERIC(index));
}
}