mesa/tnl_dd: Remove color-index support from t_dd_tritmp.h
[mesa.git] / src / mesa / main / bufferobj.h
index ef59ff83c84eadf6f58e551ad154eb8fc7151c4b..f8bca5ff717a2b17041c862b2dfbed7b43eb32b2 100644 (file)
  * Internal functions
  */
 
+
+/** Is the given buffer object currently mapped? */
+static INLINE GLboolean
+_mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
+{
+   return obj->Pointer != NULL;
+}
+
+/**
+ * Is the given buffer object a user-created buffer object?
+ * Mesa uses default buffer objects in several places.  Default buffers
+ * always have Name==0.  User created buffers have Name!=0.
+ */
+static INLINE GLboolean
+_mesa_is_bufferobj(const struct gl_buffer_object *obj)
+{
+   return obj->Name != 0;
+}
+
+
 extern void
 _mesa_init_buffer_objects( GLcontext *ctx );
 
+extern void
+_mesa_free_buffer_objects( GLcontext *ctx );
+
 extern void
 _mesa_update_default_objects_buffer_objects(GLcontext *ctx);
 
@@ -61,32 +84,39 @@ _mesa_validate_pbo_access(GLuint dimensions,
                           GLsizei width, GLsizei height, GLsizei depth,
                           GLenum format, GLenum type, const GLvoid *ptr);
 
-extern const GLubyte *
-_mesa_map_bitmap_pbo(GLcontext *ctx,
+extern const GLvoid *
+_mesa_map_pbo_source(GLcontext *ctx,
                      const struct gl_pixelstore_attrib *unpack,
-                     const GLubyte *bitmap);
-
-extern void
-_mesa_unmap_bitmap_pbo(GLcontext *ctx,
-                       const struct gl_pixelstore_attrib *unpack);
+                     const GLvoid *src);
 
 extern const GLvoid *
-_mesa_map_drawpix_pbo(GLcontext *ctx,
-                      const struct gl_pixelstore_attrib *unpack,
-                      const GLvoid *pixels);
+_mesa_map_validate_pbo_source(GLcontext *ctx,
+                              GLuint dimensions,
+                              const struct gl_pixelstore_attrib *unpack,
+                              GLsizei width, GLsizei height, GLsizei depth,
+                              GLenum format, GLenum type, const GLvoid *ptr,
+                              const char *where);
 
 extern void
-_mesa_unmap_drawpix_pbo(GLcontext *ctx,
-                        const struct gl_pixelstore_attrib *unpack);
+_mesa_unmap_pbo_source(GLcontext *ctx,
+                       const struct gl_pixelstore_attrib *unpack);
 
 extern void *
-_mesa_map_readpix_pbo(GLcontext *ctx,
-                      const struct gl_pixelstore_attrib *pack,
-                      GLvoid *dest);
+_mesa_map_pbo_dest(GLcontext *ctx,
+                   const struct gl_pixelstore_attrib *pack,
+                   GLvoid *dest);
+
+extern GLvoid *
+_mesa_map_validate_pbo_dest(GLcontext *ctx,
+                            GLuint dimensions,
+                            const struct gl_pixelstore_attrib *unpack,
+                            GLsizei width, GLsizei height, GLsizei depth,
+                            GLenum format, GLenum type, GLvoid *ptr,
+                            const char *where);
 
 extern void
-_mesa_unmap_readpix_pbo(GLcontext *ctx,
-                        const struct gl_pixelstore_attrib *pack);
+_mesa_unmap_pbo_dest(GLcontext *ctx,
+                     const struct gl_pixelstore_attrib *pack);
 
 
 extern void
@@ -127,6 +157,9 @@ _mesa_UnmapBufferARB(GLenum target);
 extern void GLAPIENTRY
 _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params);
 
+extern void GLAPIENTRY
+_mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
+
 extern void GLAPIENTRY
 _mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params);