summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorkeithw <keithw@keithw-laptop.(none)>2007-01-15 11:58:06 +0000
committerkeithw <keithw@keithw-laptop.(none)>2007-01-15 11:58:06 +0000
commit1b7c24c33c43e2c0db391735b2f2ca0026459cc9 (patch)
tree8773345bebd39c3662a3e8e65ca790135f63d8ba /src/mesa/vbo
parent4557dfe13206495916d4ff8557f1633194a12c0f (diff)
Hook in split functionality
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo.h36
-rw-r--r--src/mesa/vbo/vbo_context.h8
2 files changed, 37 insertions, 7 deletions
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 80f7a3322bf..c81d83f9b61 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -65,4 +65,40 @@ void _vbo_DestroyContext( GLcontext *ctx );
void _vbo_InvalidateState( GLcontext *ctx, GLuint new_state );
+typedef void (*vbo_draw_func)( GLcontext *ctx,
+ const struct gl_client_array **arrays,
+ const struct _mesa_prim *prims,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index );
+
+
+
+
+/* Utility function to cope with various constraints on tnl modules or
+ * hardware. This can be used to split an incoming set of arrays and
+ * primitives against the following constraints:
+ * - Maximum number of indices in index buffer.
+ * - Maximum number of vertices referenced by index buffer.
+ * - Maximum hardware vertex buffer size.
+ */
+struct split_limits {
+ GLuint max_verts;
+ GLuint max_indices;
+ GLuint max_vb_size; /* bytes */
+};
+
+
+void vbo_split_prims( GLcontext *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index,
+ vbo_draw_func draw,
+ const struct split_limits *limits );
+
+
#endif
diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
index 4c5ed96765b..0dc1019b39f 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -79,13 +79,7 @@ struct vbo_context {
/* Callback into the driver. This must always succeed, the driver
* is responsible for initiating any fallback actions required:
*/
- void (*draw_prims)( GLcontext *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prims,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index );
+ vbo_draw_func draw_prims;
};