aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-08-23 23:10:14 +0000
committerBrian Paul <[email protected]>2006-08-23 23:10:14 +0000
commit4d12a05e6c11ca8d7325503131b2594dfe304164 (patch)
treeddfec24494574b8d9a24fdfdefc5c94b3b105a39 /src/mesa/main
parent261a806f9e26347d756bddeae81f4e98325b8e84 (diff)
Added _mesa_lookup_program() and _mesa_lookup_bufferobj() functions to avoid
a lot of casting elsewhere. Use _mesa_lookup_texture() in tdfx driver, use _mesa_lookup_bufferobj() in r300 driver.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/bufferobj.c10
-rw-r--r--src/mesa/main/bufferobj.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 366ffbb30ef..1d0f4b40679 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -469,8 +469,8 @@ _mesa_validate_pbo_access(GLuint dimensions,
* Return the gl_buffer_object for the given ID.
* Always return NULL for ID 0.
*/
-static INLINE struct gl_buffer_object *
-lookup_bufferobj(GLcontext *ctx, GLuint buffer)
+struct gl_buffer_object *
+_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer)
{
if (buffer == 0)
return NULL;
@@ -508,7 +508,7 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer)
}
else {
/* non-default buffer object */
- newBufObj = lookup_bufferobj(ctx, buffer);
+ newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!newBufObj) {
/* if this is a new buffer object id, allocate a buffer object now */
ASSERT(ctx->Driver.NewBufferObject);
@@ -577,7 +577,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
for (i = 0; i < n; i++) {
- struct gl_buffer_object *bufObj = lookup_bufferobj(ctx, ids[i]);
+ struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
if (bufObj) {
/* unbind any vertex pointers bound to this buffer */
GLuint j;
@@ -722,7 +722,7 @@ _mesa_IsBufferARB(GLuint id)
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- bufObj = lookup_bufferobj(ctx, id);
+ bufObj = _mesa_lookup_bufferobj(ctx, id);
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
return bufObj ? GL_TRUE : GL_FALSE;
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 05e27c984ea..f54f9e9ff00 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -44,6 +44,9 @@ _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);
+
extern void
_mesa_initialize_buffer_object( struct gl_buffer_object *obj,
GLuint name, GLenum target );