summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo/vbo_save.h')
-rw-r--r--src/mesa/vbo/vbo_save.h55
1 files changed, 48 insertions, 7 deletions
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 14ac831ffd7..44dc8c201f8 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -100,6 +100,52 @@ aligned_vertex_buffer_offset(const struct vbo_save_vertex_list *node)
}
+/**
+ * Return the stride in bytes of the display list node.
+ */
+static inline GLsizei
+_vbo_save_get_stride(const struct vbo_save_vertex_list *node)
+{
+ return node->VAO[0]->BufferBinding[0].Stride;
+}
+
+
+/**
+ * Return the first referenced vertex index in the display list node.
+ */
+static inline GLuint
+_vbo_save_get_min_index(const struct vbo_save_vertex_list *node)
+{
+ assert(node->prim_count > 0);
+ return node->prims[0].start;
+}
+
+
+/**
+ * Return the last referenced vertex index in the display list node.
+ */
+static inline GLuint
+_vbo_save_get_max_index(const struct vbo_save_vertex_list *node)
+{
+ assert(node->prim_count > 0);
+ const struct _mesa_prim *last_prim = &node->prims[node->prim_count - 1];
+ return last_prim->start + last_prim->count - 1;
+}
+
+
+/**
+ * Return the vertex count in the display list node.
+ */
+static inline GLuint
+_vbo_save_get_vertex_count(const struct vbo_save_vertex_list *node)
+{
+ assert(node->prim_count > 0);
+ const struct _mesa_prim *first_prim = &node->prims[0];
+ const struct _mesa_prim *last_prim = &node->prims[node->prim_count - 1];
+ return last_prim->start - first_prim->start + last_prim->count;
+}
+
+
/* These buffers should be a reasonable size to support upload to
* hardware. Current vbo implementation will re-upload on any
* changes, so don't make too big or apps which dynamically create
@@ -178,13 +224,8 @@ void vbo_save_fallback(struct gl_context *ctx, GLboolean fallback);
/* save_loopback.c:
*/
-void vbo_loopback_vertex_list(struct gl_context *ctx,
- const GLfloat *buffer,
- const GLubyte *attrsz,
- const struct _mesa_prim *prim,
- GLuint prim_count,
- GLuint wrap_count,
- GLuint vertex_size);
+void _vbo_loopback_vertex_list(struct gl_context *ctx,
+ const struct vbo_save_vertex_list* node);
/* Callbacks:
*/