mesa: remove DD_TRI_OFFSET flag
[mesa.git] / src / mesa / vbo / vbo_save.h
index 23cbea2afc18066da3df88bcda8861288d8095dd..750117b12398f64a74d256fab5ea1f4a6248d1fd 100644 (file)
@@ -34,6 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef VBO_SAVE_H
 #define VBO_SAVE_H
 
+#include "main/mfeatures.h"
 #include "main/mtypes.h"
 #include "vbo.h"
 #include "vbo_attrib.h"
@@ -62,6 +63,7 @@ struct vbo_save_copied_vtx {
  */
 struct vbo_save_vertex_list {
    GLubyte attrsz[VBO_ATTRIB_MAX];
+   GLenum attrtype[VBO_ATTRIB_MAX];
    GLuint vertex_size;
 
    /* Copy of the final vertex from node->vertex_store->bufferobj.
@@ -72,7 +74,7 @@ struct vbo_save_vertex_list {
    GLuint current_size;
 
    GLuint buffer_offset;
-   GLuint count;
+   GLuint count;                /**< vertex count */
    GLuint wrap_count;          /* number of copied vertices at start */
    GLboolean dangling_attr_ref;        /* current attr implicitly referenced 
                                   outside the list */
@@ -121,13 +123,17 @@ struct vbo_save_primitive_store {
 struct vbo_save_context {
    struct gl_context *ctx;
    GLvertexformat vtxfmt;
+   GLvertexformat vtxfmt_noop;  /**< Used if out_of_memory is true */
    struct gl_client_array arrays[VBO_ATTRIB_MAX];
    const struct gl_client_array *inputs[VBO_ATTRIB_MAX];
 
    GLubyte attrsz[VBO_ATTRIB_MAX];
+   GLenum attrtype[VBO_ATTRIB_MAX];
    GLubyte active_sz[VBO_ATTRIB_MAX];
    GLuint vertex_size;
 
+   GLboolean out_of_memory;  /**< True if last VBO allocation failed */
+
    GLfloat *buffer;
    GLuint count;
    GLuint wrap_count;
@@ -145,7 +151,6 @@ struct vbo_save_context {
    GLuint vert_count;
    GLuint max_vert;
    GLboolean dangling_attr_ref;
-   GLboolean have_materials;
 
    GLuint opcode_vertex_list;
 
@@ -155,8 +160,6 @@ struct vbo_save_context {
    GLubyte *currentsz[VBO_ATTRIB_MAX];
 };
 
-#if FEATURE_dlist
-
 void vbo_save_init( struct gl_context *ctx );
 void vbo_save_destroy( struct gl_context *ctx );
 void vbo_save_fallback( struct gl_context *ctx, GLboolean fallback );
@@ -184,18 +187,12 @@ void vbo_save_playback_vertex_list( struct gl_context *ctx, void *data );
 
 void vbo_save_api_init( struct vbo_save_context *save );
 
-#else /* FEATURE_dlist */
-
-static INLINE void
-vbo_save_init( struct gl_context *ctx )
-{
-}
-
-static INLINE void
-vbo_save_destroy( struct gl_context *ctx )
-{
-}
+GLfloat *
+vbo_save_map_vertex_store(struct gl_context *ctx,
+                          struct vbo_save_vertex_store *vertex_store);
 
-#endif /* FEATURE_dlist */
+void
+vbo_save_unmap_vertex_store(struct gl_context *ctx,
+                            struct vbo_save_vertex_store *vertex_store);
 
 #endif /* VBO_SAVE_H */