diff --git a/clutter/cogl/cogl-vertex-buffer.h b/clutter/cogl/cogl-vertex-buffer.h
index 7988e8e07..4e0006701 100644
--- a/clutter/cogl/cogl-vertex-buffer.h
+++ b/clutter/cogl/cogl-vertex-buffer.h
@@ -84,6 +84,15 @@ G_BEGIN_DECLS
CoglHandle
cogl_vertex_buffer_new (guint n_vertices);
+/**
+ * cogl_vertex_buffer_get_n_vertices:
+ * @handle: A vertex buffer handle
+ *
+ * This returns the number of vertices that @handle represents
+ */
+guint
+cogl_vertex_buffer_get_n_vertices (CoglHandle handle);
+
/**
* cogl_vertex_buffer_add:
* @handle: A vertex buffer handle
diff --git a/clutter/cogl/common/cogl-vertex-buffer.c b/clutter/cogl/common/cogl-vertex-buffer.c
index 8a943f4e4..2e9b8749b 100644
--- a/clutter/cogl/common/cogl-vertex-buffer.c
+++ b/clutter/cogl/common/cogl-vertex-buffer.c
@@ -221,6 +221,19 @@ cogl_vertex_buffer_new (guint n_vertices)
return _cogl_vertex_buffer_handle_new (buffer);
}
+guint
+cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
+{
+ CoglVertexBuffer *buffer;
+
+ if (!cogl_is_vertex_buffer (handle))
+ return 0;
+
+ buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+
+ return buffer->n_vertices;
+}
+
/* There are a number of standard OpenGL attributes that we deal with
* specially. These attributes are all namespaced with a "gl_" prefix
* so we should catch any typos instead of silently adding a custom
diff --git a/doc/reference/cogl/cogl-sections.txt b/doc/reference/cogl/cogl-sections.txt
index 78b3eb2e9..aeefa146f 100644
--- a/doc/reference/cogl/cogl-sections.txt
+++ b/doc/reference/cogl/cogl-sections.txt
@@ -298,6 +298,7 @@ cogl_color_get_alpha_float