#include <stdbool.h>
#include "main/glheader.h"
+#include "main/draw.h"
#ifdef __cplusplus
extern "C" {
struct gl_context;
-struct _mesa_prim
-{
- GLuint mode:8; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
- GLuint indexed:1;
- GLuint begin:1;
- GLuint end:1;
- GLuint is_indirect:1;
- GLuint pad:20;
-
- GLuint start;
- GLuint count;
- GLint basevertex;
- GLuint num_instances;
- GLuint base_instance;
- GLuint draw_id;
-
- GLsizeiptr indirect_offset;
-};
-
-/* Would like to call this a "vbo_index_buffer", but this would be
- * confusing as the indices are not neccessarily yet in a non-null
- * buffer object.
- */
-struct _mesa_index_buffer
-{
- GLuint count;
- unsigned index_size;
- struct gl_buffer_object *obj;
- const void *ptr;
-};
-
-
-
GLboolean
-_vbo_CreateContext(struct gl_context *ctx);
+_vbo_CreateContext(struct gl_context *ctx, bool use_buffer_objects);
void
_vbo_DestroyContext(struct gl_context *ctx);
void
-_vbo_draw_indirect(struct gl_context *ctx, GLuint mode,
- struct gl_buffer_object *indirect_data,
- GLsizeiptr indirect_offset, unsigned draw_count,
- unsigned stride,
- struct gl_buffer_object *indirect_draw_count_buffer,
- GLsizeiptr indirect_draw_count_offset,
- const struct _mesa_index_buffer *ib);
-
+vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj);
void
-vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj);
+vbo_get_minmax_index_mapped(unsigned count, unsigned index_size,
+ unsigned restartIndex, bool restart,
+ const void *indices,
+ unsigned *min_index, unsigned *max_index);
void
vbo_get_minmax_indices(struct gl_context *ctx, const struct _mesa_prim *prim,
const struct _mesa_index_buffer *ib,
GLuint *min_index, GLuint *max_index, GLuint nr_prims);
-void
-vbo_use_buffer_objects(struct gl_context *ctx);
-
-void
-vbo_always_unmap_buffers(struct gl_context *ctx);
-
void
vbo_sw_primitive_restart(struct gl_context *ctx,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
- struct gl_buffer_object *indirect);
+ GLuint num_instances, GLuint base_instance,
+ struct gl_buffer_object *indirect,
+ GLsizeiptr indirect_offset);
const struct gl_array_attributes*