mesa: plug in GL_ARB_draw_buffers_blend functions
[mesa.git] / src / mesa / main / bufferobj.h
index c68291ab919de3b9170a64dae3886c600c7019aa..09ccab31742bf845773477250f29535b6f4d2b60 100644 (file)
@@ -29,7 +29,8 @@
 #define BUFFEROBJ_H
 
 
-#include "context.h"
+#include "mfeatures.h"
+#include "mtypes.h"
 
 
 /*
@@ -39,7 +40,7 @@
 
 /** Is the given buffer object currently mapped? */
 static INLINE GLboolean
-_mesa_bufferobj_mapped(struct gl_buffer_object *obj)
+_mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
 {
    return obj->Pointer != NULL;
 }
@@ -50,28 +51,31 @@ _mesa_bufferobj_mapped(struct gl_buffer_object *obj)
  * always have Name==0.  User created buffers have Name!=0.
  */
 static INLINE GLboolean
-_mesa_is_bufferobj(struct gl_buffer_object *obj)
+_mesa_is_bufferobj(const struct gl_buffer_object *obj)
 {
    return obj->Name != 0;
 }
 
 
 extern void
-_mesa_init_buffer_objects( GLcontext *ctx );
+_mesa_init_buffer_objects( struct gl_context *ctx );
 
 extern void
-_mesa_update_default_objects_buffer_objects(GLcontext *ctx);
+_mesa_free_buffer_objects( struct gl_context *ctx );
+
+extern void
+_mesa_update_default_objects_buffer_objects(struct gl_context *ctx);
 
 
 extern struct gl_buffer_object *
-_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer);
+_mesa_lookup_bufferobj(struct gl_context *ctx, GLuint buffer);
 
 extern void
 _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
                                GLuint name, GLenum target );
 
 extern void
-_mesa_reference_buffer_object(GLcontext *ctx,
+_mesa_reference_buffer_object(struct gl_context *ctx,
                               struct gl_buffer_object **ptr,
                               struct gl_buffer_object *bufObj);
 
@@ -81,32 +85,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(struct gl_context *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(struct gl_context *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(struct gl_context *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(struct gl_context *ctx,
+                   const struct gl_pixelstore_attrib *pack,
+                   GLvoid *dest);
+
+extern GLvoid *
+_mesa_map_validate_pbo_dest(struct gl_context *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(struct gl_context *ctx,
+                     const struct gl_pixelstore_attrib *pack);
 
 
 extern void
@@ -147,6 +158,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);
 
@@ -162,4 +176,15 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
 extern void GLAPIENTRY
 _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
 
+#if FEATURE_APPLE_object_purgeable
+extern GLenum GLAPIENTRY
+_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
+
+extern GLenum GLAPIENTRY
+_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
+
+extern void GLAPIENTRY
+_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params);
+#endif
+
 #endif