From ce7a049191c14be1d3dd456cdc72463b01ccf34c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 14:32:37 -0600 Subject: mesa: use Elements() for loop limit --- src/mesa/main/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 5e0f2d7b1b..ff9dd488c7 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -455,7 +455,7 @@ _mesa_init_current(GLcontext *ctx) GLuint i; /* Init all to (0,0,0,1) */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) { + for (i = 0; i < Elements(ctx->Current.Attrib); i++) { ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 ); } -- cgit v1.2.3 From 29c6c8eb18ace95b9af6dcf34e02c2b8db0ffda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 30 May 2009 12:38:45 -0700 Subject: mesa: Add success/failures return value to _mesa_make_current. --- src/mesa/main/context.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ec0dc12a3e..884b6ad282 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1259,7 +1259,7 @@ initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb) * \param drawBuffer the drawing framebuffer * \param readBuffer the reading framebuffer */ -void +GLboolean _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer ) { @@ -1272,14 +1272,14 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, if (!check_compatible(newCtx, drawBuffer)) { _mesa_warning(newCtx, "MakeCurrent: incompatible visuals for context and drawbuffer"); - return; + return GL_FALSE; } } if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) { if (!check_compatible(newCtx, readBuffer)) { _mesa_warning(newCtx, "MakeCurrent: incompatible visuals for context and readbuffer"); - return; + return GL_FALSE; } } @@ -1384,6 +1384,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, newCtx->FirstTimeCurrent = GL_FALSE; } } + + return GL_TRUE; } -- cgit v1.2.3 From 12e94d892e3322be5c8a1594702d69e7a02d5274 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Jun 2009 10:27:05 -0600 Subject: mesa: release VBO and PBO references upon context destruction --- src/mesa/main/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 884b6ad282..a947f69632 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1007,6 +1007,16 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj); +#if FEATURE_ARB_pixel_buffer_object + _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); + _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL); +#endif + +#if FEATURE_ARB_vertex_buffer_object + _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); + _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL); +#endif + #if FEATURE_ARB_vertex_buffer_object _mesa_delete_buffer_object(ctx, ctx->Array.NullBufferObj); #endif -- cgit v1.2.3