summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-01-24 09:14:35 -0700
committerBrian Paul <[email protected]>2018-01-29 08:35:14 -0700
commit0d044f7d619c56c67d8235312363d93e2362248f (patch)
tree14c151223842438d386f5369075b007f44d4c377 /src/mesa/main/varray.h
parentd9894ede02d13735c62da3e0ace9e9c647e2956a (diff)
mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()
The arrays specified by ctx->Array._DrawArrays are used for all vertex drawing via vbo_context::draw_prims(). Different arrays are used for immediate mode, vertex arrays, display lists, etc. Changing from one to another requires updating derived/driver array state. Before, we indirectly specifid the arrays with the gl_draw_method values. Now we just directly specify the arrays instead. This is simpler and will allow a subsequent display list optimization. In the future, it might make sense to get rid of ctx->Array._DrawArrays entirely and just pass the arrays as another parameter to vbo_context::draw_prims(). Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.h')
-rw-r--r--src/mesa/main/varray.h15
1 files changed, 15 insertions, 0 deletions
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,