aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/arrayobj.c25
-rw-r--r--src/mesa/main/attrib.c5
-rw-r--r--src/mesa/main/mtypes.h16
-rw-r--r--src/mesa/main/varray.h15
4 files changed, 28 insertions, 33 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 0f474243a78..2810647c7e7 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -433,20 +433,17 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, bool no_error)
newObj->EverBound = GL_TRUE;
}
- if (ctx->Array.DrawMethod == DRAW_ARRAYS) {
- /* The _DrawArrays pointer is pointing at the VAO being unbound and
- * that VAO may be in the process of being deleted. If it's not going
- * to be deleted, this will have no effect, because the pointer needs
- * to be updated by the VBO module anyway.
- *
- * Before the VBO module can update the pointer, we have to set it
- * to NULL for drivers not to set up arrays which are not bound,
- * or to prevent a crash if the VAO being unbound is going to be
- * deleted.
- */
- ctx->Array._DrawArrays = NULL;
- ctx->Array.DrawMethod = DRAW_NONE;
- }
+ /* The _DrawArrays pointer is pointing at the VAO being unbound and
+ * that VAO may be in the process of being deleted. If it's not going
+ * to be deleted, this will have no effect, because the pointer needs
+ * to be updated by the VBO module anyway.
+ *
+ * Before the VBO module can update the pointer, we have to set it
+ * to NULL for drivers not to set up arrays which are not bound,
+ * or to prevent a crash if the VAO being unbound is going to be
+ * deleted.
+ */
+ _mesa_set_drawing_arrays(ctx, NULL);
ctx->NewState |= _NEW_ARRAY;
_mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 0fdadaf0aaa..50b65c413e5 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1538,9 +1538,8 @@ copy_array_attrib(struct gl_context *ctx,
/* skip ArrayBufferObj */
/* skip IndexBufferObj */
- /* Invalidate draw state. It will be updated during the next draw. */
- dest->DrawMethod = DRAW_NONE;
- dest->_DrawArrays = NULL;
+ /* Invalidate array state. It will be updated during the next draw. */
+ _mesa_set_drawing_arrays(ctx, NULL);
}
/**
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 361b63c1c40..9cd32c3aaa5 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1604,19 +1604,6 @@ struct gl_vertex_array_object
/**
- * Used to signal when transitioning from one kind of drawing method
- * to another.
- */
-typedef enum
-{
- DRAW_NONE, /**< Initial value only */
- DRAW_BEGIN_END,
- DRAW_DISPLAY_LIST,
- DRAW_ARRAYS
-} gl_draw_method;
-
-
-/**
* Enum for the OpenGL APIs we know about and may support.
*
* NOTE: This must match the api_enum table in
@@ -1666,9 +1653,6 @@ struct gl_array_attrib
GLuint RestartIndex;
/*@}*/
- /** One of the DRAW_xxx flags, not consumed by drivers */
- gl_draw_method DrawMethod;
-
/* GL_ARB_vertex_buffer_object */
struct gl_buffer_object *ArrayBufferObj;
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 65e0f7b56c6..93f2f477faf 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -78,6 +78,21 @@ _mesa_attr_zero_aliases_vertex(const struct gl_context *ctx)
return ctx->_AttribZeroAliasesVertex;
}
+
+/**
+ * This specifies the set of vertex arrays used by the driver for drawing.
+ */
+static inline void
+_mesa_set_drawing_arrays(struct gl_context *ctx,
+ const struct gl_vertex_array **arrays)
+{
+ if (ctx->Array._DrawArrays != arrays) {
+ ctx->Array._DrawArrays = arrays;
+ ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+ }
+}
+
+
extern void
_mesa_update_array_format(struct gl_context *ctx,
struct gl_vertex_array_object *vao,