draw: corrections to allow for different cliptest cases
[mesa.git] / src / mesa / vbo / vbo_save.h
index b81f275a6029ddcb606dd50b85c67a2f6b03b675..82ba6c8afe786acf725753b5348117bd7c82d8a5 100644 (file)
@@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef VBO_SAVE_H
 #define VBO_SAVE_H
 
-#include "mtypes.h"
+#include "main/mtypes.h"
 #include "vbo.h"
 #include "vbo_attrib.h"
 
@@ -64,6 +64,13 @@ struct vbo_save_vertex_list {
    GLubyte attrsz[VBO_ATTRIB_MAX];
    GLuint vertex_size;
 
+   /* Copy of the final vertex from node->vertex_store->bufferobj.
+    * Keep this in regular (non-VBO) memory to avoid repeated
+    * map/unmap of the VBO when updating GL current data.
+    */
+   GLfloat *current_data;
+   GLuint current_size;
+
    GLuint buffer_offset;
    GLuint count;
    GLuint wrap_count;          /* number of copied vertices at start */
@@ -130,7 +137,7 @@ struct vbo_save_context {
    struct vbo_save_vertex_store *vertex_store;
    struct vbo_save_primitive_store *prim_store;
 
-   GLfloat *vbptr;                /* cursor, points into buffer */
+   GLfloat *buffer_ptr;                   /* cursor, points into buffer */
    GLfloat vertex[VBO_ATTRIB_MAX*4];      /* current values */
    GLfloat *attrptr[VBO_ATTRIB_MAX];
    GLuint vert_count;
@@ -146,6 +153,7 @@ struct vbo_save_context {
    GLubyte *currentsz[VBO_ATTRIB_MAX];
 };
 
+#if FEATURE_dlist
 
 void vbo_save_init( GLcontext *ctx );
 void vbo_save_destroy( GLcontext *ctx );
@@ -166,7 +174,7 @@ void vbo_loopback_vertex_list( GLcontext *ctx,
 void vbo_save_EndList( GLcontext *ctx );
 void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode );
 void vbo_save_EndCallList( GLcontext *ctx );
-void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *list );
+void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *list );
 void vbo_save_SaveFlushVertices( GLcontext *ctx );
 GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode );
 
@@ -174,4 +182,18 @@ void vbo_save_playback_vertex_list( GLcontext *ctx, void *data );
 
 void vbo_save_api_init( struct vbo_save_context *save );
 
-#endif
+#else /* FEATURE_dlist */
+
+static INLINE void
+vbo_save_init( GLcontext *ctx )
+{
+}
+
+static INLINE void
+vbo_save_destroy( GLcontext *ctx )
+{
+}
+
+#endif /* FEATURE_dlist */
+
+#endif /* VBO_SAVE_H */