else
vao->VertexAttribBufferMask &= ~array_bit;
- if (flush_vertices) {
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- }
-
vao->BufferBinding[array->BufferBindingIndex]._BoundArrays &= ~array_bit;
vao->BufferBinding[bindingIndex]._BoundArrays |= array_bit;
array->BufferBindingIndex = bindingIndex;
vao->NewArrays |= vao->_Enabled & array_bit;
+ ctx->NewState |= _NEW_ARRAY;
}
}
if (binding->BufferObj != vbo ||
binding->Offset != offset ||
binding->Stride != stride) {
- if (flush_vertices) {
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- }
_mesa_reference_buffer_object(ctx, &binding->BufferObj, vbo);
vao->VertexAttribBufferMask |= binding->_BoundArrays;
vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
+ ctx->NewState |= _NEW_ARRAY;
}
}
assert(!vao->SharedAndImmutable);
if (binding->InstanceDivisor != divisor) {
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
binding->InstanceDivisor = divisor;
vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
+ ctx->NewState |= _NEW_ARRAY;
}
}
* \param doubles Double values not reduced to floats
* \param relativeOffset Offset of the first element relative to the binding
* offset.
- * \param flush_verties Should \c FLUSH_VERTICES be invoked before updating
- * state?
*/
void
_mesa_update_array_format(struct gl_context *ctx,
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_POS, GL_RGBA, 4, size, type, stride,
GL_FALSE, GL_FALSE, GL_FALSE, ptr);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
GLbitfield legalTypes = (ctx->API == API_OPENGLES)
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
_mesa_NormalPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr )
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_NORMAL, GL_RGBA, 3, 3, type, stride, GL_TRUE,
GL_FALSE, GL_FALSE, ptr);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
update_array(ctx, VERT_ATTRIB_COLOR0, format, BGRA_OR_4, size,
GET_CURRENT_CONTEXT(ctx);
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 4 : 3;
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
_mesa_FogCoordPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_FOG, GL_RGBA, 1, 1, type, stride, GL_FALSE,
GL_FALSE, GL_FALSE, ptr);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
const GLbitfield legalTypes = (HALF_BIT | FLOAT_BIT | DOUBLE_BIT);
_mesa_IndexPointer_no_error(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_COLOR_INDEX, GL_RGBA, 1, 1, type, stride,
GL_FALSE, GL_FALSE, GL_FALSE, ptr);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
const GLbitfield legalTypes = (UNSIGNED_BYTE_BIT | SHORT_BIT | INT_BIT |
FLOAT_BIT | DOUBLE_BIT);
GLsizei stride, const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
update_array(ctx, VERT_ATTRIB_COLOR1, format, BGRA_OR_4, size, type,
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT |
SHORT_BIT | UNSIGNED_SHORT_BIT |
{
GET_CURRENT_CONTEXT(ctx);
const GLuint unit = ctx->Array.ActiveTexture;
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_TEX(unit), GL_RGBA, 4, size, type,
stride, GL_FALSE, GL_FALSE, GL_FALSE, ptr);
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
const GLuint unit = ctx->Array.ActiveTexture;
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
/* this is the same type that glEdgeFlag uses */
const GLboolean integer = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_EDGEFLAG, GL_RGBA, 1, 1, GL_UNSIGNED_BYTE,
stride, GL_FALSE, integer, GL_FALSE, ptr);
const GLboolean integer = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
const GLbitfield legalTypes = UNSIGNED_BYTE_BIT;
const GLvoid *ptr)
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
update_array(ctx, VERT_ATTRIB_POINT_SIZE, GL_RGBA, 1, 1, type, stride,
GL_FALSE, GL_FALSE, GL_FALSE, ptr);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
GLenum format = GL_RGBA;
if (ctx->API != API_OPENGLES) {
_mesa_error(ctx, GL_INVALID_OPERATION,
if (!vao->VertexAttrib[attrib].Enabled) {
/* was disabled, now being enabled */
- if (flush_vertices) {
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- }
-
vao->VertexAttrib[attrib].Enabled = GL_TRUE;
const GLbitfield array_bit = VERT_BIT(attrib);
vao->_Enabled |= array_bit;
vao->NewArrays |= array_bit;
+ ctx->NewState |= _NEW_ARRAY;
/* Update the map mode if needed */
if (array_bit & (VERT_BIT_POS|VERT_BIT_GENERIC0))
if (vao->VertexAttrib[attrib].Enabled) {
/* was enabled, now being disabled */
- if (flush_vertices) {
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- }
-
vao->VertexAttrib[attrib].Enabled = GL_FALSE;
const GLbitfield array_bit = VERT_BIT(attrib);
vao->_Enabled &= ~array_bit;
vao->NewArrays |= array_bit;
+ ctx->NewState |= _NEW_ARRAY;
/* Update the map mode if needed */
if (array_bit & (VERT_BIT_POS|VERT_BIT_GENERIC0))
GLint defstride; /* default stride */
GLint c, f;
- FLUSH_VERTICES(ctx, 0);
-
f = sizeof(GLfloat);
c = f * ((4 * sizeof(GLubyte) + (f - 1)) / f);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
{
GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glUnlockArrays\n");
static void
primitive_restart_index(struct gl_context *ctx, GLuint index)
{
- if (ctx->Array.RestartIndex != index) {
- FLUSH_VERTICES(ctx, 0);
- ctx->Array.RestartIndex = index;
- }
+ ctx->Array.RestartIndex = index;
}
}
}
- FLUSH_VERTICES(ctx, 0);
-
_mesa_update_array_format(ctx, ctx->Array.VAO,
VERT_ATTRIB_GENERIC(attribIndex), size, type,
format, normalized, integer, doubles,
}
}
- FLUSH_VERTICES(ctx, 0);
-
_mesa_update_array_format(ctx, vao, VERT_ATTRIB_GENERIC(attribIndex), size,
type, format, normalized, integer, doubles,
relativeOffset);