vbo: remove dead code in vbo_can_merge_prims
[mesa.git] / src / mesa / vbo / vbo.h
index 9b15066291504cbe90d89384ab800cec8bd51121..17d668e386f8418423dc05fbe5bd1124f36ba9dd 100644 (file)
 
 #include <stdbool.h>
 #include "main/glheader.h"
+#include "main/draw.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct gl_vertex_array;
 struct gl_context;
-struct gl_transform_feedback_object;
-
-struct _mesa_prim
-{
-   GLuint mode:8;    /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
-   GLuint indexed:1;
-   GLuint begin:1;
-   GLuint end:1;
-   GLuint weak:1;
-   GLuint no_current_update:1;
-   GLuint is_indirect:1;
-   GLuint pad:18;
-
-   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);
@@ -104,7 +68,8 @@ void
 vbo_save_SaveFlushVertices(struct gl_context *ctx);
 
 void
-vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
+vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode,
+                     bool no_current_update);
 
 void
 vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
@@ -119,16 +84,6 @@ void
 vbo_save_EndCallList(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);
-
-
 void
 vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj);
 
@@ -137,12 +92,6 @@ 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,
@@ -151,39 +100,12 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
                          struct gl_buffer_object *indirect);
 
 
-/**
- * Utility that tracks and updates the current array entries.
- */
-struct vbo_inputs
-{
-   /**
-    * Array of inputs to be set to the _DrawArrays pointer.
-    * The array contains pointers into the _DrawVAO and to the vbo modules
-    * current values. The array of pointers is updated incrementally
-    * based on the current and vertex_processing_mode values below.
-    */
-   struct gl_vertex_array inputs[VERT_ATTRIB_MAX];
-   /** Those VERT_BIT_'s where the inputs array point to current values. */
-   GLbitfield current;
-   /** Store which aliasing current values - generics or materials - are set. */
-   gl_vertex_processing_mode vertex_processing_mode;
-};
-
-
-/**
- * Initialize inputs.
- */
-void
-_vbo_init_inputs(struct vbo_inputs *inputs);
+const struct gl_array_attributes*
+_vbo_current_attrib(const struct gl_context *ctx, gl_vert_attrib attr);
 
 
-/**
- * Update the gl_vertex_array array inside the vbo_inputs structure
- * provided the current _VPMode, the provided vao and
- * the vao's enabled arrays filtered by the filter bitmask.
- */
-void
-_vbo_update_inputs(struct gl_context *ctx, struct vbo_inputs *inputs);
+const struct gl_vertex_buffer_binding*
+_vbo_current_binding(const struct gl_context *ctx);
 
 
 void GLAPIENTRY