driver->GetIntegerv = NULL;
driver->GetPointerv = NULL;
-#if FEATURE_ARB_vertex_buffer_object
- driver->NewBufferObject = _mesa_new_buffer_object;
- driver->DeleteBuffer = _mesa_delete_buffer_object;
- driver->BindBuffer = NULL;
- driver->BufferData = _mesa_buffer_data;
- driver->BufferSubData = _mesa_buffer_subdata;
- driver->GetBufferSubData = _mesa_buffer_get_subdata;
- driver->MapBuffer = _mesa_buffer_map;
- driver->UnmapBuffer = _mesa_buffer_unmap;
-#endif
-
-#if FEATURE_ARB_map_buffer_range
- driver->MapBufferRange = _mesa_buffer_map_range;
- driver->FlushMappedBufferRange = _mesa_buffer_flush_mapped_range;
-#endif
+ _mesa_init_buffer_object_functions(driver);
#if FEATURE_EXT_framebuffer_object
driver->NewFramebuffer = _mesa_new_framebuffer;
driver->DeleteArrayObject = _mesa_delete_array_object;
driver->BindArrayObject = NULL;
- /* GL_ARB_copy_buffer */
- driver->CopyBufferSubData = _mesa_copy_buffer_subdata;
-
/* T&L stuff */
driver->NeedValidate = GL_FALSE;
driver->ValidateTnlModule = NULL;
*
* Default callback for the \c dd_function_table::NewBufferObject() hook.
*/
-struct gl_buffer_object *
+static struct gl_buffer_object *
_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_buffer_object *obj;
*
* Default callback for the \c dd_function_table::DeleteBuffer() hook.
*/
-void
+static void
_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
{
(void) ctx;
*
* \sa glBufferDataARB, dd_function_table::BufferData.
*/
-void
+static void
_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid * data, GLenum usage,
struct gl_buffer_object * bufObj )
*
* \sa glBufferSubDataARB, dd_function_table::BufferSubData.
*/
-void
+static void
_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid * data,
struct gl_buffer_object * bufObj )
*
* \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData.
*/
-void
+static void
_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, GLvoid * data,
struct gl_buffer_object * bufObj )
*
* \sa glMapBufferARB, dd_function_table::MapBuffer
*/
-void *
+static void *
_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access,
struct gl_buffer_object *bufObj )
{
* Default fallback for \c dd_function_table::MapBufferRange().
* Called via glMapBufferRange().
*/
-void *
+static void *
_mesa_buffer_map_range( GLcontext *ctx, GLenum target, GLintptr offset,
GLsizeiptr length, GLbitfield access,
struct gl_buffer_object *bufObj )
* Default fallback for \c dd_function_table::FlushMappedBufferRange().
* Called via glFlushMappedBufferRange().
*/
-void
+static void
_mesa_buffer_flush_mapped_range( GLcontext *ctx, GLenum target,
GLintptr offset, GLsizeiptr length,
struct gl_buffer_object *obj )
*
* \sa glUnmapBufferARB, dd_function_table::UnmapBuffer
*/
-GLboolean
+static GLboolean
_mesa_buffer_unmap( GLcontext *ctx, GLenum target,
struct gl_buffer_object *bufObj )
{
* Default fallback for \c dd_function_table::CopyBufferSubData().
* Called via glCopyBuffserSubData().
*/
-void
+static void
_mesa_copy_buffer_subdata(GLcontext *ctx,
struct gl_buffer_object *src,
struct gl_buffer_object *dst,
}
+/**
+ * Plug default/fallback buffer object functions into the device
+ * driver hooks.
+ */
+void
+_mesa_init_buffer_object_functions(struct dd_function_table *driver)
+{
+ /* GL_ARB_vertex/pixel_buffer_object */
+ driver->NewBufferObject = _mesa_new_buffer_object;
+ driver->DeleteBuffer = _mesa_delete_buffer_object;
+ driver->BindBuffer = NULL;
+ driver->BufferData = _mesa_buffer_data;
+ driver->BufferSubData = _mesa_buffer_subdata;
+ driver->GetBufferSubData = _mesa_buffer_get_subdata;
+ driver->MapBuffer = _mesa_buffer_map;
+ driver->UnmapBuffer = _mesa_buffer_unmap;
+
+ /* GL_ARB_map_buffer_range */
+ driver->MapBufferRange = _mesa_buffer_map_range;
+ driver->FlushMappedBufferRange = _mesa_buffer_flush_mapped_range;
+
+ /* GL_ARB_copy_buffer */
+ driver->CopyBufferSubData = _mesa_copy_buffer_subdata;
+}
+
+
/**********************************************************************/
/* API Functions */
extern void
_mesa_update_default_objects_buffer_objects(GLcontext *ctx);
-extern struct gl_buffer_object *
-_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target );
-
-extern void
-_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj );
extern struct gl_buffer_object *
_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer);
struct gl_buffer_object **ptr,
struct gl_buffer_object *bufObj);
-extern void
-_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
- const GLvoid * data, GLenum usage,
- struct gl_buffer_object * bufObj );
-
-extern void
-_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
- GLsizeiptrARB size, const GLvoid * data,
- struct gl_buffer_object * bufObj );
-
-extern void
-_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
- GLsizeiptrARB size, GLvoid * data,
- struct gl_buffer_object * bufObj );
-
-extern void *
-_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access,
- struct gl_buffer_object * bufObj );
-
-extern void *
-_mesa_buffer_map_range( GLcontext *ctx, GLenum target, GLintptr offset,
- GLsizeiptr length, GLbitfield access,
- struct gl_buffer_object *bufObj );
-
-extern void
-_mesa_buffer_flush_mapped_range( GLcontext *ctx, GLenum target,
- GLintptr offset, GLsizeiptr length,
- struct gl_buffer_object *obj );
-
-extern GLboolean
-_mesa_buffer_unmap( GLcontext *ctx, GLenum target,
- struct gl_buffer_object * bufObj );
-
-extern void
-_mesa_copy_buffer_subdata(GLcontext *ctx,
- struct gl_buffer_object *src,
- struct gl_buffer_object *dst,
- GLintptr readOffset, GLintptr writeOffset,
- GLsizeiptr size);
-
extern GLboolean
_mesa_validate_pbo_access(GLuint dimensions,
const struct gl_pixelstore_attrib *pack,
const struct gl_pixelstore_attrib *pack);
+extern void
+_mesa_init_buffer_object_functions(struct dd_function_table *driver);
+
/*
* API functions