Commit 395bcad8 authored by Brian Paul's avatar Brian Paul

mesa: updated comments

parent 75e3ccf6
/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 7.2 * Version: 7.5
* *
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2009 VMware, Inc. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
/** /**
* \file bufferobj.c * \file bufferobj.c
* \brief Functions for the GL_ARB_vertex_buffer_object extension. * \brief Functions for the GL_ARB_vertex/pixel_buffer_object extensions.
* \author Brian Paul, Ian Romanick * \author Brian Paul, Ian Romanick
*/ */
...@@ -144,8 +145,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, ...@@ -144,8 +145,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
/** /**
* Allocate and initialize a new buffer object. * Allocate and initialize a new buffer object.
* *
* This function is intended to be called via * Default callback for the \c dd_function_table::NewBufferObject() hook.
* \c dd_function_table::NewBufferObject.
*/ */
struct gl_buffer_object * struct gl_buffer_object *
_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target )
...@@ -163,8 +163,7 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) ...@@ -163,8 +163,7 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target )
/** /**
* Delete a buffer object. * Delete a buffer object.
* *
* This function is intended to be called via * Default callback for the \c dd_function_table::DeleteBuffer() hook.
* \c dd_function_table::DeleteBuffer.
*/ */
void void
_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
...@@ -271,9 +270,8 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj, ...@@ -271,9 +270,8 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
* previously stored in the buffer object is lost. If \c data is \c NULL, * previously stored in the buffer object is lost. If \c data is \c NULL,
* memory will be allocated, but no copy will occur. * memory will be allocated, but no copy will occur.
* *
* This function is intended to be called via * This is the default callback for \c dd_function_table::BufferData()
* \c dd_function_table::BufferData. This function need not set GL error * Note that all GL error checking will have been done already.
* codes. The input parameters will have been tested before calling.
* *
* \param ctx GL context. * \param ctx GL context.
* \param target Buffer object target on which to operate. * \param target Buffer object target on which to operate.
...@@ -312,9 +310,8 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, ...@@ -312,9 +310,8 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
* specified by \c size + \c offset extends beyond the end of the buffer or * specified by \c size + \c offset extends beyond the end of the buffer or
* if \c data is \c NULL, no copy is performed. * if \c data is \c NULL, no copy is performed.
* *
* This function is intended to be called by * This is the default callback for \c dd_function_table::BufferSubData()
* \c dd_function_table::BufferSubData. This function need not set GL error * Note that all GL error checking will have been done already.
* codes. The input parameters will have been tested before calling.
* *
* \param ctx GL context. * \param ctx GL context.
* \param target Buffer object target on which to operate. * \param target Buffer object target on which to operate.
...@@ -346,15 +343,14 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, ...@@ -346,15 +343,14 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
* specified by \c size + \c offset extends beyond the end of the buffer or * specified by \c size + \c offset extends beyond the end of the buffer or
* if \c data is \c NULL, no copy is performed. * if \c data is \c NULL, no copy is performed.
* *
* This function is intended to be called by * This is the default callback for \c dd_function_table::GetBufferSubData()
* \c dd_function_table::BufferGetSubData. This function need not set GL error * Note that all GL error checking will have been done already.
* codes. The input parameters will have been tested before calling.
* *
* \param ctx GL context. * \param ctx GL context.
* \param target Buffer object target on which to operate. * \param target Buffer object target on which to operate.
* \param offset Offset of the first byte to be modified. * \param offset Offset of the first byte to be fetched.
* \param size Size, in bytes, of the data range. * \param size Size, in bytes, of the data range.
* \param data Pointer to the data to store in the buffer object. * \param data Destination for data
* \param bufObj Object to be used. * \param bufObj Object to be used.
* *
* \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData. * \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData.
...@@ -373,9 +369,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, ...@@ -373,9 +369,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
/** /**
* Fallback function called via ctx->Driver.MapBuffer(). * Default callback for \c dd_function_tabel::MapBuffer().
* Hardware drivers that really implement buffer objects should never use
* this function.
* *
* The function parameters will have been already tested for errors. * The function parameters will have been already tested for errors.
* *
...@@ -407,9 +401,7 @@ _mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, ...@@ -407,9 +401,7 @@ _mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access,
/** /**
* Fallback function called via ctx->Driver.MapBuffer(). * Default callback for \c dd_function_table::MapBuffer().
* Hardware drivers that really implement buffer objects should never use
* function.
* *
* The input parameters will have been already tested for errors. * The input parameters will have been already tested for errors.
* *
...@@ -446,6 +438,7 @@ _mesa_init_buffer_objects( GLcontext *ctx ) ...@@ -446,6 +438,7 @@ _mesa_init_buffer_objects( GLcontext *ctx )
ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj;
} }
/** /**
* Bind the specified target to buffer for the specified context. * Bind the specified target to buffer for the specified context.
*/ */
...@@ -796,11 +789,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) ...@@ -796,11 +789,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]); struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
if (bufObj) { if (bufObj) {
/* unbind any vertex pointers bound to this buffer */
GLuint j; GLuint j;
ASSERT(bufObj->Name == ids[i]); ASSERT(bufObj->Name == ids[i]);
/* unbind any vertex pointers bound to this buffer */
unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj); unbind(ctx, &ctx->Array.ArrayObj->Vertex.BufferObj, bufObj);
unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj); unbind(ctx, &ctx->Array.ArrayObj->Normal.BufferObj, bufObj);
unbind(ctx, &ctx->Array.ArrayObj->Color.BufferObj, bufObj); unbind(ctx, &ctx->Array.ArrayObj->Color.BufferObj, bufObj);
...@@ -822,6 +815,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) ...@@ -822,6 +815,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ); _mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
} }
/* unbind any pixel pack/unpack pointers bound to this buffer */
if (ctx->Pack.BufferObj == bufObj) { if (ctx->Pack.BufferObj == bufObj) {
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 ); _mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment