* is responsible for initiating any fallback actions required:
*/
vbo_draw_func draw_prims;
+
+ /* Optional callback for indirect draws. This allows multidraws to not be
+ * broken up, as well as for the actual count to be passed in as a separate
+ * indirect parameter.
+ */
+ vbo_indirect_draw_func draw_indirect_prims;
};
{
switch (format) {
case GL_FLOAT:
+ case GL_DOUBLE:
+ return GL_FALSE;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ return GL_TRUE;
+ default:
+ assert(0);
return GL_FALSE;
+ }
+}
+
+static inline GLboolean
+vbo_attrtype_to_double_flag(GLenum format)
+{
+ switch (format) {
+ case GL_FLOAT:
case GL_INT:
case GL_UNSIGNED_INT:
+ return GL_FALSE;
+ case GL_DOUBLE:
return GL_TRUE;
default:
assert(0);
}
}
+
+/**
+ * Compute the max number of vertices which can be stored in
+ * a vertex buffer, given the current vertex size, and the amount
+ * of space already used.
+ */
+static inline unsigned
+vbo_compute_max_verts(const struct vbo_exec_context *exec)
+{
+ unsigned n = (VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) /
+ (exec->vtx.vertex_size * sizeof(GLfloat));
+ if (n == 0)
+ return 0;
+ /* Subtract one so we're always sure to have room for an extra
+ * vertex for GL_LINE_LOOP -> GL_LINE_STRIP conversion.
+ */
+ n--;
+ return n;
+}
+
+
#ifdef __cplusplus
} // extern "C"
#endif