From 4d12a05e6c11ca8d7325503131b2594dfe304164 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Aug 2006 23:10:14 +0000 Subject: 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. --- src/mesa/main/bufferobj.c | 10 +++++----- src/mesa/main/bufferobj.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 366ffbb30e..1d0f4b4067 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 05e27c984e..f54f9e9ff0 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 ); -- cgit v1.2.3